Most people rarely think about how electricity prices are determined. Power flows through the grid, appliances turn on, and a number appears on a monthly bill. Behind that simple experience sits a complicated system of fuel markets, transmission lines, weather patterns, and mathematical models.
Neel Somani believes more people should understand those systems.
The former Citadel quantitative researcher and founder of the blockchain infrastructure company Eclipse has recently begun sharing lessons online explaining how electricity markets work. His videos focus on topics normally discussed inside trading firms, utilities, and engineering departments.
Instead of simplifying those systems into broad generalities, Somani walks viewers through the mechanics step by step. “What I’m going to show you in this video is how you solve problems like this,” he said in one lesson. “They’re called complementarity problems.”
For most readers, that phrase is unfamiliar. In simple terms, a complementarity problem describes a situation where two or more variables depend on each other at the same time. Changing one variable immediately changes the others.
In energy markets, electricity and natural gas are a classic example of this type of relationship. Power plants burn natural gas to generate electricity, which means gas prices influence electricity prices. At the same time, the amount of electricity produced determines how much natural gas power plants consume. That circular relationship means both markets must be modeled together. Somani believes that once people see how these systems interact, the logic behind energy markets becomes much easier to understand.
The Mathematical Models Behind Electricity and Gas Pricing
Electricity markets operate under a unique constraint. Supply and demand must remain balanced every second of the day. If too much electricity enters the grid, or if supply falls short of demand, the system can become unstable.
The challenge with electricity is that it cannot easily be stored in large quantities. To keep the grid balanced, operators rely on mathematical models to determine which power plants should run and how electricity should be priced.
These models must account for several factors at the same time. They consider fuel costs, expected electricity demand, weather conditions, and the efficiency of different types of power plants.
“The first way to solve it is called fixed point iteration,” he said while describing the modeling process. “You start with whatever the market thinks the gas prices are. Then you pass those gas prices into your power model, and the model produces a power price.”
That result becomes the next input.
“After you get the power prices, you feed those into the gas model,” he continued. “Based on those power prices, the gas model produces a new set of gas prices.”
The models then repeat the process again.
“You keep doing that back and forth until it converges,” Somani said.
In plain terms, convergence means the models eventually settle on a stable solution where both markets make sense simultaneously.
Another technique analysts use is known as a mixed complementarity model. While the name sounds intimidating, the concept is fairly straightforward.
“The second way to solve it is called a mixed complementarity problem,” Somani explained. “You specify how power should be priced, specify how gas should be priced, and then define how they’re related. Then under the hood the solver uses what are called KKT conditions to solve for the equilibrium.”
KKT conditions are mathematical rules used in optimization models to identify the most efficient solution within a system that contains multiple constraints. Even inside professional trading firms, the process can feel less formal than the math suggests.
“If that sounds too complicated,” Somani said with a smile, “you can do it how most funds handle it, which is you have each desk yell at the other one until the models output something reasonable.”
The joke reflects a reality about real-world markets. Even with sophisticated modeling tools, human judgment still plays a role in interpreting results. For Somani, helping people understand these frameworks reveals the hidden structure behind infrastructure markets.
What California’s Power Grid Reveals About Modern Energy
One of Somani’s most detailed explanations focuses on California’s electricity market. The state has become a widely studied example of how renewable energy, natural gas generation, and consumer demand interact within a modern power grid.
“The first thing you need to know is the generation stack,” Somani said while explaining the structure of the system. The generation stack refers to the order in which power plants are used to meet electricity demand.
“There are renewables and there are natural gas units,” he said. “In California you don’t really have any of the other stuff like coal.”
Renewable energy sources such as solar and wind operate differently from traditional power plants. Because they do not require fuel like gas or coal, their operating costs are extremely low once the infrastructure is built.
“You basically first meet demand with renewables,” Somani explained. “Those have basically zero marginal cost.”
Marginal cost refers to the cost of producing one additional unit of electricity. Once renewable generation is fully utilized, grid operators begin turning on natural gas plants to meet the remaining demand.
“Then you turn on less and less efficient natural gas units until you’ve met all of the demand,” Somani said.
Electricity prices are determined by the cost of the final generator needed to satisfy demand. Economists refer to this generator as the marginal unit.
The structure of the grid also influences prices. California is divided into two major regions connected by transmission lines.
“There’s Northern California, which is called NP15, and there’s Southern California, which is SP15,” Somani explained. “They’re separated by a transmission line called Path 15.”
If the line becomes congested, electricity prices can diverge between the two regions.
“Southern California sometimes exports power north,” he said. “Sometimes it has to import electricity [from surrounding regions] because it doesn’t have enough generation.”
Weather and human behavior also affect demand.
“When the temperature is extreme, people turn on their heating or their air conditioning,” Somani said. “That increases electricity demand.”
Daily routines create additional patterns.
“During the daytime you have solar generation,” he explained. “Then in the evening the sun goes down and everyone turns on their lights, their TVs, and their ovens.”
This sudden surge in electricity demand after sunset creates what energy analysts call the “duck curve.” The name comes from the shape of a chart that shows demand dipping during the sunny afternoon and then rising sharply in the evening.
Neel Somani noted that battery storage systems are beginning to reduce this effect, but storage capacity is still limited. “They’re definitely growing storage,” he said. “But the lack of storage relative to renewables is what causes the duck curve.”
Understanding these dynamics helps explain why electricity prices fluctuate throughout the day.
Neel Somani Enjoys Systems – And Explaining Them To Others
Somani’s ability to explain these systems comes from years spent studying them professionally. Before founding Eclipse in 2022, he worked as a quantitative researcher at Citadel where he specialized in electricity markets. The work required building models that could analyze large networks of interacting variables.
“The power market in the United States is solved using general optimization techniques, which are even applicable to NP-hard problems,” he said.
In computer science, NP-hard problems are among the most difficult types of optimization challenges because they involve extremely large numbers of possible solutions. Solving them requires sophisticated algorithms and significant computing power.
Electricity markets contain many of these challenges because grid operators must account for fuel costs, plant efficiency, weather forecasts, transmission limits, and demand fluctuations simultaneously.
Somani eventually shifted from quantitative finance into technology entrepreneurship. In 2022 he founded Eclipse, a blockchain infrastructure project focused on improving the scalability of decentralized networks. The company has raised $65 million since its launch.
Despite building in a rapidly evolving technology sector, Somani continues returning to the intellectual curiosity that shaped his early career.
He enjoys understanding systems.
Now he enjoys explaining them.
For many viewers, those lessons offer a rare look into the hidden mechanics of infrastructure markets.
Electricity grids, natural gas pricing, and energy demand patterns may seem distant from everyday life. Yet they influence everything from household utility bills to industrial production costs. Somani believes that when people understand the systems behind those numbers, the world becomes easier to interpret.
When discussing the inspiration behind his teaching videos, Somani explained, “Everything I’m covering is openly available online, but younger people often don’t get exposed to commodities during undergrad the same way we learn about equities or bonds.”
That gap, he says, is exactly what he hopes to change.

0 Comments