EnleashedEnleashed
Fix the energy market
Published

Fair Play Automatic Market Maker (FP-AMM)

A continuously clearing market architecture for coordinating distributed energy resources across the electricity system. FP-AMM combines an Automatic Market Maker, holarchical coordination, stateful fairness and Shapley-based settlement to deliver reliable, economically coherent and transparent operation of modern power systems.

Solution section

Allocation Algorithm

Overview

Once Fair Play has determined that allocation decisions must be made, the market requires a mechanism for selecting between multiple equally feasible participants.

FP-AMM achieves this using a probabilistic allocation process known as Biased Coin Allocation.

Rather than following a fixed deterministic queue or selecting participants uniformly at random, each eligible participant is assigned a probability of selection based upon:

  • their contractual Service Level,
  • their accumulated Fairness History,
  • the current physical feasibility of the electricity system.

Participants are then selected using a weighted random process.

This approach combines the predictability of contractual priorities with the adaptability of probabilistic scheduling, ensuring that fairness emerges naturally over repeated market interactions.


Why a Probabilistic Algorithm?

A deterministic allocation algorithm always produces the same outcome for the same inputs.

While simple, deterministic approaches often create undesirable behaviour.

For example:

  • participants at the front of a queue may consistently receive priority,
  • participants at the end of a queue may repeatedly experience deferral,
  • predictable schedules may become exploitable,
  • fairness depends heavily upon arbitrary ordering.

Random selection avoids these problems but introduces another.

A purely random market forgets previous outcomes and may still repeatedly favour the same participant by chance.

Biased Coin Allocation combines the advantages of both approaches.

The allocation remains probabilistic, but the probabilities continuously adapt according to each participant's Fairness History.


Step 1 — Group by Service Level

Allocation begins by grouping eligible requests according to their contractual Service Level.

For example:

  • Premium
  • Standard
  • Flexible

Service Levels define the contractual reliability purchased by participants.

Higher Service Levels therefore receive proportionally greater opportunity to receive service before lower Service Levels.

Fair Play never overrides these contractual commitments.


Step 2 — Select a Service Level

A Service Level is selected using weighted probabilities.

Higher-priority Service Levels receive greater selection weight, reflecting their contractual reliability guarantees.

This ensures that the market continues to honour participant contracts even during periods of scarcity.

Only after a Service Level has been selected does the market compare individual participants within that class.


Step 3 — Calculate Fairness Weights

Each participant possesses a continuously updated Fairness History.

This records how frequently they have previously received service during scarcity or avoided curtailment during periods of surplus.

Participants that have historically experienced less favourable outcomes receive larger fairness weights.

Participants that have consistently benefited receive proportionally smaller weights.

The weighting therefore creates a continuous negative feedback mechanism that gradually balances outcomes over time.

Importantly, fairness weights are not fixed priorities.

They evolve continuously as the market operates.


Step 4 — Biased Coin Selection

Once fairness weights have been calculated, each eligible participant is assigned a probability of selection proportional to their current weight.

The market then performs a weighted random selection.

Conceptually, this is equivalent to repeatedly flipping a biased coin, where the bias reflects both contractual priority and accumulated fairness.

Participants with greater fairness weight become more likely—but never guaranteed—to be selected.

Similarly, participants with lower fairness weight remain eligible, although with reduced probability.

This probabilistic approach prevents permanent queue positions while continuously correcting historical imbalance.


Step 5 — Feasibility Check

Every selected allocation is verified against the physical state of the electricity network.

If accepting a request would violate engineering constraints such as:

  • thermal limits,
  • voltage limits,
  • transformer capacity,
  • network security,

the allocation is rejected and another eligible participant is considered.

Economic optimisation, physical feasibility and fairness therefore operate together rather than independently.


Continuous Adaptation

Every completed allocation updates the participant's Fairness History.

This immediately influences future allocation probabilities.

The process therefore forms a continuous feedback loop:

Fairness History
        │
        ▼
Fairness Weights
        │
        ▼
Biased Coin Selection
        │
        ▼
Allocation Outcome
        │
        ▼
Updated Fairness History

Rather than relying on static priorities, the market continuously adapts to previous outcomes.


Why This Works

Biased Coin Allocation provides several desirable properties.

No Permanent Winners

Participants cannot permanently remain at the front of the allocation order.

Repeated favourable outcomes naturally reduce future selection probability.


No Permanent Losers

Participants that have historically contributed more flexibility gradually receive increased priority during future allocation decisions.

Persistent disadvantage therefore becomes increasingly unlikely.


Fairness Emerges Naturally

The algorithm does not attempt to equalise every individual market interval.

Instead, fairness emerges statistically across many repeated interactions.

Participants experience occasional variation, but long-term outcomes remain balanced.


Scalable

Each allocation decision depends only upon:

  • Service Level,
  • Fairness History,
  • current network feasibility.

No global optimisation of participant ordering is required.

This allows the mechanism to scale efficiently to millions of distributed energy resources.


Relationship to Fairness History

Biased Coin Allocation does not define fairness itself.

Fairness is represented by the Fairness History maintained for each participant.

The allocation algorithm simply converts that historical information into continuously updated selection probabilities.

Fairness History provides the memory.

Biased Coin Allocation provides the decision-making mechanism.

Together they create a stateful market that continuously learns from previous allocation outcomes.


Relationship to the Mathematical Framework

This page describes the allocation process conceptually.

The following section presents the formal mathematical formulation, including:

  • Service Level queue sampling,
  • inverse fairness weighting,
  • probability calculation,
  • convergence properties,
  • theoretical guarantees.

These mathematical properties demonstrate why Biased Coin Allocation converges towards balanced long-term outcomes while preserving contractual priorities and physical feasibility.