What the pool phase is
The pool phase is a dedicated phase of an event's lifecycle, slotted between the close of new bet placement and the final resolution. Concretely, it's a window of a few minutes just before close, during which:
- No new bets can be placed.
- No user-side cancellation is possible anymore (temporary lock).
- The system gathers all unmatched residuals and computes a mutualized pool.
It starts at a timestamp poolPhaseStartsAt = closesAt − Δ, where Δ depends on the event's duration. You see this timestamp in the event details under "Pool phase starts at."
How long the pool phase lasts
Δ is computed automatically from the event's total duration:
- Event < 1h: Δ = max(5min, 10% of the duration). Example: a 30-minute event → Δ = 5min.
- Event between 1h and 24h: Δ = a fixed 15min.
- Event between 1 and 7 days: Δ = 30min.
- Event > 7 days: Δ = 60min.
The event admin can override this value (between 5 and 120 minutes) at creation, for example for a sensitive event that needs more computation time.
What goes into the pool
When the pool phase starts, the system lists every bet of which some part hasn't found an opponent in phase 1 (live matching). These residuals fall into two sides:
- Side A (for example "Argentina wins"): sum of the residual amounts = mass A.
- Side B ("France wins"): sum of the residual amounts = mass B.
Indicative pool odds are computed for each side: side X odds = (mass A + mass B) / mass X, adjusted for the commission. The smaller a mass is relative to the other, the higher that side's odds.
The iterative computation (and why)
Each participant has a personal minimum pool odds preference (between 1.00 and 5.00, in steps of 0.10, default 1.20). If the odds computed for their side fall below their threshold, they refuse the pool and must be refunded.
But removing a participant changes the masses, which changes the odds, which can push another participant below their threshold. Hence the iterative computation:
- Compute odds A and B with all residuals.
- Identify the participants below their threshold.
- If there are any, refund the most demanding one (the one with the highest threshold). On a tie, FIFO (the oldest first).
- Recompute the odds with the remaining participants.
- Repeat until convergence (everyone above their threshold) or a degenerate pool (one side entirely empty).
On convergence, everyone remaining enters the pool at the final computed odds. Refunded participants receive 100% of their residual with no commission whatsoever.
Atomicity and guarantees
The whole computation runs in memory, then is applied in a single atomic transaction:
- Bet status updates (POOLED for the accepted ones, REFUNDED for the others).
- Creation of the MutualPool + PoolParticipation entries.
- User balance credits for the refunds.
- Insertion of the BET_REFUNDED transactions.
- Full audit of every iteration (debug + support).
- Event transition to the CLOSED status.
If any single element fails, everything is rolled back and the event stays in POOL_PHASE; the system retries (up to 3 times with backoff). Guarantee: no financial drift is possible - not a cent can be lost or created.
The degenerate pool case
If at the start of the pool phase one of the two masses is zero (for example nobody on the side opposite yours among the residuals), the pool is said to be degenerate. No odds can be computed. In that case:
- All residuals are refunded at 100%, with no commission.
- You get a notification "Your bet was refunded (no counterparty in the pool)."
- The event moves directly to CLOSED.
Also: if the pool phase starts with zero residual in total (everything matched in phase 1), the pool phase is skipped and the event moves directly to CLOSED.
Hybrid bets (partially matched P2P)
A bet can be partially matched in phase 1 and have a residual that enters the pool phase. Example:
- You stake 100K. The cascade matches 70K P2P during the event.
- 30K remain as a residual when the pool phase begins.
- The pool accepts your residual at odds 1.40 → your bet is now "70K matched P2P + 30K in the pool at 1.40."
- If you win, you collect: the P2P winnings (70K × P2P odds) + the pool winnings (30K × 1.40), minus the corresponding commissions.
The pool refuses your residual? You keep the 70K matched P2P, and you get the 30K back as a refund. You see both components clearly in the bet details.