FUNDING, FEES, AND RISK CARRY
| Component | How the engine treats it |
|---|---|
| Maker and taker fees | Applied as trades execute and recorded in ledger/accounting state |
| Skew-based fee adjustments | Increase or relax taker cost when one-sided pressure grows |
| Funding accrual | Carries directional imbalance through the funding index and fundingAccrued state |
| Liquidation fees | Attach explicit cost to forced reduction paths |
| Withdrawal or treasury-side fees | Live in the settlement/accounting path rather than in matching itself |
#How funding enters the ledger
Dexter's funding model is part of its market-balance system.
The engine tracks per-market carry and records fundingAccrued as state advances. Funding intervals, clamps, and skew-sensitive adjustments are therefore part of the same runtime that manages market posture.
That matters because crowding and carry should be measured inside the live exchange loop, not reconstructed later from exports.
#How fees become protocol-owned value
Trade fees are created at execution time.
The engine records them in ledger and accounting state as fills occur. A later reconciliation path converts those totals into on-chain fee and insurance movements so protocol-owned balances stay aligned with what the venue actually charged.
That means the market engine and the finance layer are connected, but not collapsed into one step.
The engine decides how carry and fees arise.
The accounting and treasury path decides how those protocol-owned balances are later reflected on-chain.
trade executes
-> maker/taker fee is recorded
-> skew and funding state are updated
-> fundingAccrued and fee totals advance with the ledger
-> reconciler later converts protocol deltas into vault-side fee or reserve movements
#Why carry belongs in the engine
If funding, skew fees, and liquidation costs were treated as reporting artifacts, the venue could look healthy while its risk carry was already drifting.
Dexter keeps those components inside the engine so the market's visible posture, user balances, and protocol-owned value all derive from the same ordered state transition.