Fees
Execution Fee
To eliminate front-running, for all orders (including perpetual, predict, swap, and mint/burn DLP), there are 2 transactions:
User sends transaction to request order
Keeper bots observe and execute the order
The execution fee is collected during the first transaction to pay for the network gas of the second transaction. This cost is paid to the blockchain network.
Read more here about two-step order execution: https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices#latency
Perpetuals Trading
The open/close fee is collected whenever a perpetual trade is executed. The borrow fee is collected when a positions is decreased or closed. The funding fee is collected or distributed when a position is decreased or closed.
Fees settled at opening = open fee
Fees settled at closing = close fee + borrow fee +/- funding
(See funding curve chapter for detailed funding formula.)
Note: 1 basis point (bps) = 0.01%. All percentages are calculated based on the position size.
Open/close fee
7 bps
12 bps
1 bp
Stablecoin/stablecoin: e.g. USDT/USDC, DAI/USDC
Borrow fee (per hour)
Depends on utilization rate, mapped linearly:
0 to 50% utilization rate ↦ 0 to 0.33bps linear
50 to 100% utilization rate ↦ 0.33 to 0.75bps linear
Utilization rate: total tokens borrowed / total tokens in pool
Note: Borrow fee % is charged on position size at entry in quote tokens for long positions, in base tokens for short positions. Funding % is charged on position size at entry in USD.
Liquidation
Positions are automatically closed when equity (collateral - losses - fees) is less than 1% of position size, with remaining collateral returned. Liquidation price is affected by asset prices, borrow fee, and funding fee, which change over time.
Spot swap
Our spot swap uses oracle pricing for zero slippage. The swap fee follows a dynamically adjusted mechanism, aiming to incentivize users to help keep the pool proportion close to the target ratio. Hence, it could be as low as 0 if the relevant coin is undersubscribed. It follows the following formula:
Fee for a particular token T:
Constants:
“base” = base swap fee BPS
“tax” = swap fee adjustment BPS
Inputs:
prevUsd: prev T amount in USD
nextUsd: next T amount in USD (after swap)
targetUsd: target T amount in USD
Formula:
Else: (balance worsened)
Swap fee is sum of the fee for input token and output token.
Deposit and withdrawal is the fee for a single token T.
Base fee (bps)
10
30
2
Tax fee (bps)
60
50
10
Fees are distributed to staked DLP holders. All fees are collected in a day period, and distributed to holders over the next day period. Currently, 10% of fees go to the Treasury used for server, keeper bots, and other upkeep costs. Soon, some portion of fees will be distributed $DRV token stakers.
Last updated