Energy · Market design
Build the market
around the real world.
Electricity can have a negative price. A stale reading can put a trading account at risk. Building a power and gas venue means making room for the world as it is.
- Problem
- Power can trade below zero, and a stale reading could close a position that should have stayed open.
- Role
- As co-founder, I designed the reference-pricing rules and reworked the sequence for an account running short of margin.
- Result
- Launch readiness in staging. It had not taken live orders when my role ended.
Even when the price
crosses zero.
The price behind the position
The latest number isn’t always the right one.
My work at Yugadhanavi took me through a power plant and its control rooms before I co-founded a US power and gas venue. There, a stale reading or a brief spike could close a position that should have stayed open, so I designed reference-pricing rules that check across sources, reject old or outlying readings and soften abrupt moves.
The part you cannot rush
Finish one promise before making the next.
When an account ran short of margin while its orders were still moving, I reworked the sequence so the system stopped new activity and waited for the outstanding order events before it moved into liquidation. With my co-founder and the delivery team, we brought the venue to launch readiness in staging. It had not taken live orders when my role ended.
For a closer look at the engineering
The order book
A negative priceis still a valid price.
The venue covered ERCOT power and Henry Hub natural gas, with fully collateralised perpetual swaps and futures designed for round-the-clock trading.
The matching core was a liquibook-derived C++ order book. I extended it to accept signed prices and wrote the CGo bridge to the rest of the system. A negative price could then enter the trade lifecycle; margin and settlement had to interpret it consistently.
Order and risk services also had to agree on what had happened. A transactional outbox kept events tied to database changes, while idempotent consumers handled retries without applying the same change twice.
The reference-price decision
A thin marketcan distort the mark.
A stale feed can become a margin error. A thin-market spike can trigger a liquidation. Reference pricing needed clear rules for when to accept a reading and when to reject it.
I designed rules to reject stale readings and outliers across ERCOT, CME and ICE data. Damping the mark made it less responsive to sudden moves, but more resistant to thin-market manipulation.
For natural gas, the reference index weighted constituents by liquidity and volume, with a monthly roll. The index design supplied a reference for the mark and funding calculations.
The mark fed a SPAN-style margin model. I used risk arrays to work through price scenarios, with isolated, cross and portfolio modes. Pricing and margin had to agree before the system could decide whether an account needed liquidation.
The difficult handoff
Drain the ordersbefore closing the position.
An account can run out of margin while orders are still in flight. Close it too early and the position may change during liquidation. The system has to stop new activity and finish those order events before touching the position.
The synchronous orchestrator kept failing on races between admitting an order, draining the queue and starting a liquidation episode. I replaced it with event-driven choreography: one admission gate and a barrier that waited for every event up to a recorded sequence number to be applied.
A later event finishing says nothing about an earlier one. The barrier waited for the whole sequence, while per-episode idempotency keys handled repeated requests. Liquidation could move on only after the position was ready.
Live products
Open what is already shipped.
Open the live demoChappie is on the App Store. The AI Bubble Index is live on this site. This page is a record of earlier work.