Skip to Content

Accounting & Settlement

Within Velocity, all token deposits are held in a global collateral vault. This is required for seamless cross-margin and borrow-lend. The only exception to this is the insurance fund vault residing outside.

Ensuring proper accounting across users requires a robust settlement mechanism. The protocol uses intermediate Pool Balances to facilitate transfers and ensure that claimed gains are required to come from settled offsetting losses.

High Level Architecture

Perpetual Market

An individual perpetual market has two pools:

A. P&L Pool: accumulates funds from users with losses for settlement to users with profits. Trade-fee value also lands here first as fills settle, before the fee sweep routes it onward.

B. AMM Fee Pool: holds only the AMM’s own money, its cut of the per-fill fee split plus any spread surplus, taken out of the P&L Pool as fees settle.

The P&L Pool receives the highest priority on claimed funds, in order to give users the best possible experience. Every fill also carves out protocol and insurance-fund cuts from the remaining fee. See Trading Fees for the full split. Those two cuts are swept out of the P&L Pool’s surplus, above what is needed to cover live user claims, into the protocol’s own balance and the quote spot market’s Revenue Pool, respectively. They never pass through the AMM Fee Pool.

Before any fees are swept out, the P&L Pool always keeps enough aside to cover what is owed to users and other claimants: users’ positive unsettled P&L (valued at the fixed expiry price rather than the live oracle while the market is in Settlement), the insurance fund’s floored bankruptcy reserve, and any revenue share already accrued and owed to builders or referrers. Only the surplus above those claims is available to be swept out as fees.

Spot Market

An individual spot market has a Revenue Pool, which stages the insurance fund’s cut of protocol revenue (perp trading fees route to spot market 0 / USDT; spot lending and liquidation revenue stay in their own market) before it settles to the Insurance Fund vault.

The Revenue Pool can collect fees from:

  • Borrow interest

  • Liquidations (the insurance fund’s cut)

  • Perpetual Markets (the insurance-fund cut of the per-fill fee split)

and pays out to:

  • Insurance Fund Stakers (100% of every settle, there are no protocol-owned IF shares)

(see details of these rules in Revenue Pool)

The protocol’s own cut of these same fee sources goes directly to the protocol’s own balance instead. It never routes through the Revenue Pool or the Insurance Fund.

Last updated on