Dynamic fees
A swap pays a base fee plus surcharges for pushing the price away from the centre or chopping, and new markets add a decaying launch premium, all capped at half the fee basis.
Updated Nov 11, 2026
A swap pays the Dusk fees below and, for Token-2022 mints, a transfer fee the token program charges on its own.
| Component | When it applies | Budget |
|---|---|---|
| Base fee | Every swap | The market's swap fee, 30 bps by default |
| Divergence surcharge | Trades that push the price outward from the centre, evaluated over the whole trade path | Its own cap |
| Volatility surcharge | Repeated chop; priced from decayed prior state, and a filled trade updates the signal | Its own cap |
| Launch premium | New markets, above the base fee, decaying by time or by price milestones | At most 50% at start |
The fee step
The components come off in a fixed order. With fees taken on the input, the fee basis is the reserve credit after any input transfer fee. Write for the base rate in force, launch premium included, and and for the volatility and divergence caps. Amounts are floored to the token atom, and the three budgets are , and :
The curve then trades . Here is the volatility rate and the divergence potential, both defined below. The divergence path covers the input left after the base fee and the volatility surcharge, .
With fees on the output asset, the curve takes all of and the same steps run on the gross output : the base fee on , the volatility surcharge on , then the divergence surcharge on at the rate , where is the input-path charge above with . Each is limited by its cap on , and the total by .
The divergence surcharge
The charge depends on how far a trade pushes the input reserve past , the input reserve the current curve would hold at the sticky centre. With that excess, zero when the reserve is below , the program charges the change in a potential
where is the divergence coefficient. Its slope is the marginal surcharge rate, close to near the centre:
Once the slope reaches , the cap restated as a toll on the input that remains after the fee, the potential continues as a straight line at that slope. Flow that moves the input reserve back toward pays nothing, and a trade that crosses pays only for the part beyond it. Each charge is a difference of one potential, so splitting a trade into consecutive pieces leaves the uncapped total unchanged.
The volatility surcharge
Each market keeps one volatility accumulator . It decays at its own half-life , and every filled trade adds its own price move , capped per trade by the shock cap and in total by the accumulator cap :
The move is , rounded up, from the trade's start price to its final executable price. The fee reads the decayed accumulator from before the trade and maps it to a rate that stays below 100%:
with the volatility coefficient. Only a successful trade commits its move. On an oracle-guided market a new feed price that moves the curve counts as a move too.
Worked example
A market collects fees on the input at a 30 bps base rate. Its accumulator has decayed to with , the divergence coefficient is , and both surcharge caps are 100 bps. A trader pays in USDC of quote while the quote reserve sits 20,000 USDC past its balanced level .
| Step | Value |
|---|---|
| Base fee, 30 bps of | 150.00 |
| Volatility rate, | 0.4975% |
| Volatility surcharge on 49,850.00 | 248.01 |
| Divergence path, to | 20,000.00 to 69,601.99 |
| Potential at each end | 10.46 and 356.01 |
| Divergence surcharge | 345.55 |
| Total fee | 743.56, or 1.49% of |
| Input the curve trades | 49,256.44 |
Neither surcharge reaches its 500 USDC budget. The divergence slope reaches its limit of 1.0101% at , so the last 17,631.12 of the path is charged at that flat rate. The same trade starting 50,000 USDC below would end below it and pay no divergence surcharge, and a 10,000 USDC trade starting at pays 1.29.
The cap
The fee basis is the input asset, base only or quote only, as the creator chose. When fees are taken from the input, the budget is measured on the reserve credit after the token transfer fee; when taken from the output, on the gross curve output.
Dusk fees together are capped at half of that basis, rounded down. Token transfer fees and price impact are outside the cap.
Each component also has its own ceiling. The base rate in force, the divergence cap and the volatility cap are each at most 50%, and so is their sum (InvalidSwapFeeBps), checked when a fee profile is admitted and again on every swap with the launch premium included. A swap fails with InsufficientOutputAmount when the fees leave nothing for the curve or the curve pays nothing, and with SlippageExceeded when its output, after any output transfer fee, is below the trader's minimum. preview_swap returns every component of a quote, and the SwapExecuted event records them.
Launch schedules
A launch premium starts the base rate at and brings it back to within a duration of up to 30 days from the market's start time. Time decay is linear, or exponential over sixteen periods, and both round up:
For , bps and a 24-hour duration:
| Hours since start | 1 | 3 | 6 | 12 | 18 | 24 |
|---|---|---|---|---|---|---|
| Linear, bps | 960 | 879 | 758 | 515 | 273 | 30 |
| Exponential, bps | 1,000 | 273 | 91 | 34 | 31 | 30 |
A price-milestone schedule lowers the rate as the launch asset's price climbs past its reference, which is fixed at launch. Each full step of a set percentage above the reference counts one period, up to 64 periods, and each period takes a fixed number of basis points off the start rate or cuts it by a fixed fraction, rounding up. The rate never drops below , the duration still ends the premium, and the schedule needs fees collected in base only or quote only.
A size premium can apply on top while the launch limiter runs, for up to 30 days. A swap that buys the launch asset pays , where is the scheduled rate, the input in nine-decimal token units, rounded up, the reference size in the same units and the increment per reference. With bps, , bps and , a 3,500-unit buy pays 423 bps and a 20,000-unit buy pays 1,223 bps.
The size premium keeps no state between transactions, so splitting a buy across transactions lowers it. While the limiter runs, the program refuses a buy of the launch asset in a transaction that holds more than one swap-like instruction on the same market (LaunchRateLimitSplitTransaction): a swap, a leverage open, increase, decrease or close, an emergency_liquidation, or a settle_flash_liquidation that trades through both reserve vaults. Launch settings cannot change once trading has started (LaunchSettingsImmutable).
Parameters
| Setting | Allowed values |
|---|---|
| Base fee | 0 to 50%, and at least 1 bps on a concentrated curve (ConcentratedSwapFeeBelowMinimum), with at most 50% |
| Divergence cap , volatility cap | 0 to 50% each; zero switches the surcharge off |
| Divergence coefficient , volatility coefficient | 0 to 100 |
| Shock cap , accumulator cap | Both zero, or ; needs them set |
| Volatility half-life | One minute to twelve hours |
| Fee asset | Input, base only or quote only |
| Compounding share | 0 to 100% of the LP-owned fee |
| Launch start rate, size premium cap | Above , with the size premium cap at least the start rate; each plus both surcharge caps at most 50% |
The creator sets the whole fee profile at initialize_market. The operator or manager can replace it later as one fee-family update after the full notice, with the launch settings fixed once trading has started. The replacement is checked as a whole (InvalidSwapFeeBps, InvalidMarketConfig, InvalidHalfLife and, on a concentrated curve, ConcentratedSwapFeeBelowMinimum), and executing it drops any stored centre target.
Where the fees go
The protocol takes its share of the base fee first, the global swap share of 20% by default, and takes nothing from the surcharges. The LP-owned rest of the base fee and any distributed surcharge then divide by the market's compounding share: that part enters reserve principal and lifts the value of every srLP, and the remainder is claimable yield, held in custody outside the executable reserves and paid out through growth indexes. Realized borrow interest follows its own distribution path.
A swap's divergence and volatility surcharges are retained or distributed together. A market at exact constant product always distributes them. A concentrated market retains them while its centre controller's funding target is stale or short of its requirement, and every swap and reserve change marks that target stale, so a concentrated market's surcharges normally go to the protected bucket . Retained surcharge stays in the reserve vault but outside executable reserves, srLP value and every withdrawal claim, and nobody can claim or trade it until a funded centre move deploys it as principal. Setting the market back to exact constant product releases it to the LPs.
Yield eligibility is measured at the right transition boundary, so a trade cannot assign its fee to shares that did not exist when it began.