The session fee
The fee on every swap is a pure function of the clock. It is highest exactly where a stale pool price is most likely: deep into the closed hours.
The formula
With base and peak in basis points, since the seconds since the last close and since_open the seconds since the bell:
Open: fee = base + (peak - base) * max(0, decay - since_open) / decay
Closed: fee = base + (peak - base) * min(since, ramp) / ramp
Collect: no swaps (the Open Cross is collecting orders)
The program computes the fee in parts per million with integer arithmetic only. The fee is always taken in USDC: on a buy it comes off the USDC paid in, on a sell off the USDC paid out.
Launch parameters
| Parameter | Value | Bound enforced by the program |
|---|---|---|
base_fee_bps | 25 (0.25%) | 1 to 100 |
peak_fee_bps | 60 (0.60%) | at least base, at most 300 |
close_ramp_secs | 7,200 (2 hours) | at most 12 hours |
open_decay_secs | 1,800 (30 minutes) | at most 2 hours |
cross_window_secs | 600 (10 minutes) | 60 seconds to 1 hour |
freeze_secs | 120 (last 2 minutes: add, no cancel) | shorter than the window |
min_order_quote | $50 | $1 to $10,000 |
Parameters change only through UpdatePool, with notice, and take effect at a session close. Values outside the bounds are rejected with ParameterOutOfBounds.
Worked examples (New York time)
| Moment | Since the close | Fee |
|---|---|---|
| Wednesday 9:30 | the bell | 0.60% |
| Wednesday 9:45 | 15 minutes after the bell | 0.25% + 0.35% x 15/30 = 0.425% |
| Tuesday 11:00 | market open, decay done | 0.25% |
| Tuesday 16:30 | 30 minutes | 0.25% + 0.35% x 30/120 = 0.3375% |
| Tuesday 17:00 | 1 hour | 0.425% |
| Tuesday 18:00 onward | 2 hours or more | 0.60% |
| Saturday 03:00 | 35 hours | 0.60% |
| Wednesday 9:25 | collection window | no swaps, orders only |
Why these numbers
The spike replayed six months of the three pools with a flat 0.25% fee against 0.25% open and 0.60% closed. At 70% volume retention in closed hours, LP net income rose 31% to 45% on all three stocks. Even at 50% retention LPs stayed 10% to 13% ahead. Traders already pay an implicit cost in closed hours from drifting prices: 60bp on SPYx, 151bp on NVDAx and 171bp on TSLAx on average per closed window. The added 0.35% is a fraction of that.
The fee split between LPs and the protocol is set in the config account and capped at 25% for the protocol.