Protocol architecture
Last modified:
In CenturionDEX v2, each swap charges a fee on the input token, and that fee remains inside the pool. Consequently, the pool invariant increases over time, and liquidity providers realize their share of the accumulated fees when they withdraw liquidity.
In CenturionDEX v3, the accounting mechanism is fundamentally different. Trading fees are still charged on the incoming token, but they are not automatically reinvested into liquidity. Instead, they are tracked separately and accrue only to those positions that are active at the time of the trade, that is, to positions whose price interval contains the current market price.
This architecture is covered in two child sections:
- State variables: how price, active liquidity, tick liquidity, and outside-fee accumulators are stored.
- Fee accounting: how global and tick-scoped fee growth are combined to compute per-position fee accrual.