Skip to content

Fees & rewards

Fees on the ClearPortX DLMM exchange consist of a base fee plus a dynamic fee that adjusts in real-time based on realized volatility. This page documents the exact computation, the distribution flow, and the claim mechanism.

The total fee rate on any swap is:

ftotal=min ⁣(fbase+fvariable,  10%)f_{total} = \min\!\left(f_{base} + f_{variable},\; 10\%\right)

The hard cap at 10% prevents runaway fees during extreme volatility events.

The base fee is a constant set at pool creation. It does not change between swaps.

fbase=pool.feeRatef_{base} = \texttt{pool.feeRate}

Typical values:

PoolBase feePurpose
CC/cBTC0.30%Standard volatile pair
CC/USDC0.25%Lower friction for CC pricing
Stablecoin pairs0.05%Tight spreads for pegged assets

The variable fee grows with the square of the volatility accumulator — a value that stacks during rapid successive swaps and decays over time:

fvariable=min ⁣(va2s2,  2%)f_{variable} = \min\!\left(v_a^2 \cdot s^2,\; 2\%\right)

where vav_a is the volatility accumulator and ss is the bin step (e.g., 0.01 for a 1% bin width).

The quadratic relationship means that a swap crossing one bin adds a negligible variable fee, while a trade that pushes through many bins or arrives during a burst of rapid trading pays a meaningful premium:

Bins crossedvav_aVariable feeTotal (0.30% base)
1 (calm)1.00.01%0.31%
3 (moderate)3.00.09%0.39%
5 (volatile)5.00.25%0.55%
10 (turbulent)10.01.00%1.30%

Canton Network structurally prevents MEV — there is no public mempool, and the sequencer cannot see transaction content. So the usual motivation for dynamic fees (penalizing sandwich attacks) does not apply.

ClearPortX uses dynamic fees for a different reason: LP income optimization. During volatile periods, liquidity providers absorb more impermanent loss. A higher fee during those periods compensates them proportionally, which keeps liquidity present when the market needs it most.

See Dynamic fees for the full volatility accumulator decay model.

Every fee collected splits between liquidity providers and the protocol:

DestinationSharePurpose
LPs in the crossed bins90–95%Pro-rata by bin shares, claimable anytime
Protocol treasury5–10%Funds CPX staker revenue, development, security audits

The protocolFee parameter is set per pool and is visible in the pool detail view.

When a swap traverses a bin, the fee for that bin is computed and added to the bin’s feeEarnedBase or feeEarnedQuote accumulator. Each LP in that bin is entitled to a share proportional to their liquidity:

LP fee=bin.feeEarned×lp.sharesbin.totalShares\text{LP fee} = \texttt{bin.feeEarned} \times \frac{\texttt{lp.shares}}{\texttt{bin.totalShares}}

This means:

  • Fees accrue per bin, not per pool — LPs who placed liquidity in the active bin earn more than those in distant bins.
  • The Curve strategy earns more fees per dollar of TVL than Spot (because Curve concentrates capital where swaps happen).
  • Fees accumulate continuously and do not expire.
Terminal window
# View claimable fees
GET /api/pools/:poolId/fees/:partyId
# Claim all earned fees
POST /api/pools/:poolId/fees/claim
Content-Type: application/json
{ "party": "your-party::namespace" }

The claim endpoint:

  1. Reads your LP shares in each bin of the pool.
  2. Computes your pro-rata share of accumulated fees per bin.
  3. Deducts those fees from the bin accumulators.
  4. Credits the claimed amounts to your internal balance (if registered) or returns them for manual collection.

Navigate to the Positions tab, select a pool, and click Claim fees. The dApp calls the same endpoints and shows the fee breakdown per bin before you confirm.

Every swap response from /api/swap includes a feeBreakdown object:

{
"feeBreakdown": {
"baseFee": 0.003,
"variableFee": 0.0001,
"totalFeeRate": 0.0031,
"volatilityAccumulator": 1.5
}
}

This allows frontends and integrators to display the fee composition transparently — showing users exactly how much they pay in base fee versus volatility premium.

The protocol share of all fees flows to the CPX staking module, where it is distributed pro-rata to sCPX holders. See CPX Staking · Overview for the revenue share mechanics.