The input-denominated fee
The hosted canonical pool charges 20 basis points on each direct fill. For gross amount g spent in a bin and rate r, ObeliskMath.split computes the fee as the residual after rounding down net input. The cut is denominated in tUSDC on a buy and WHYPE on a sell.
= ⌈g · r / 10,000⌉
The treasury allocation is T = ⌊F/5⌋, the creator allocation is C = ⌊F/10⌋ and the LP allocation is L = F − T − C. For a 1 tUSDC fill the gross amount is 1,000,000 input atoms and the fee is 2,000 atoms.
Reserve and fee accounting
On a buy with output y, the bin’s base reserve falls by y and its quote reserve increases by g − T − C. A sell exchanges those reserve roles. This retained input consists of the net consideration and the LP fee. The fill leaves share supply unchanged, assigning the retained fee to incumbent shareholders through their reserve claim.
Δreservein = net + L = g − T − C
The two external fee allocations accrue to separate base/quote ledgers. An authorized recipient calls claimFees() to collect its balance. If treasury and creator coincide, the same call collects both allocations. LPs realize their share through withdrawal. On buys, the lpFeeBase field of BinFilled translates the quote-denominated LP fee into base atoms at the fill midpoint using ⌊L · S / pᵢ⌋. The inventory credit itself remains in quote.
Reconciling a multi-bin receipt
For the 150 tUSDC two-bin buy, the ledger reconciles as follows. Every number in the table is a tUSDC atom, with six decimal places per whole token.
| Bin | Fee | Treasury | Creator | LP |
|---|---|---|---|---|
| 10 | 201,403 | 40,280 | 20,140 | 140,983 |
| 11 | 98,598 | 19,719 | 9,859 | 69,020 |
| Total | 300,001 | 59,999 | 29,999 | 210,003 |
Multiplying the total input by 20 bps gives 300,000 fee atoms. The receipt contains 300,001 because settlement takes the fee ceiling twice. A reconciler must split each fill before summing beneficiary balances. Applying the split once to the aggregate fee would credit a different number of atoms to each beneficiary. Inspect the underlying fill amounts →