Skip to content
Solana
ADVISORYIn the programBit 16

Managed fee

A surcharge reel's keeper moves as price moves, inside a cap you fix at launch.

Where it runs

Advisory

The pool's single add-on slot: one per pool.

Status on reel

In the program

In the reel program: bit 16 of PoolParams.blocks, frozen at PoolInit (PROGRAM.md §5).

Set by

You, at launch

Frozen in PoolParams at PoolInit; nobody can change it after.

What it does

An extra LP fee on buys and sells that a keeper raises when price moves fast and lowers when it calms, inside bounds frozen at launch: a cap, a largest step, a least interval and a longest setting. A setting that isn't renewed lapses back to the start. Optional premiums add extra on buys or on sells.

How it works on reel

Config.fee_keeper calls ManagedSet(pips, ttl): pips ≤ cap, a change of at most managed_max_step, at least managed_min_interval apart, ttl ≤ managed_max_ttl (ManagedStep otherwise). It lapses to managed_start_pips. The charge is the current setting plus premium[side], all to LPs.

Settings · 7

SettingMinDefaultMaxWhat it does
Surcharge cap
managed_cap_pips
0.0001%1%5%The keeper can never set more than this.
Starting surcharge
managed_start_pips
0%0.05%See ruleWhere the surcharge starts, and where an unrenewed setting lapses back to.At most the cap.
Premium on buys
managed_premium[0]
0%0%See ruleExtra on every buy, on top of the current surcharge.At most the cap.
Premium on sells
managed_premium[1]
0%0%See ruleExtra on every sell, on top of the current surcharge.At most the cap.
Largest change per update
managed_max_step
0.0001%0.1%1677.7215%How far one keeper update may move it. 16,777,215 is no limit.
Least time between updates
managed_min_interval
1 s1 min1 dayThe keeper waits this long.
Longest a setting lasts
managed_max_ttl
1 s1 h3 daysThen it lapses to the start.

Fees and who's paid

Paid to

LPs, 100%.

Protocol share

reel takes no share of it.

Requires and can't be combined with

Worked example

Start 0.05%, step 0.1%: the keeper lifts it to 0.15%, 0.25% then 0.3%, a minute apart at least. On 10,000 USDC of volume LPs earn 30 USDC instead of 5; within the hour it lapses back to 0.05%.

Solana notes

The keeper is Config.fee_keeper, an admin-set key. Traders can pay up to the cap plus a premium.

On hookr: Advisory · Live

Other blocks in Fees