How are fees charged?

Position fees

Concept

  • Fees are charged for short positions, and fees from long positions are used to offset the short fees.

  • The fee rate is based on market conditions and pool utilization, similar to Compound v2's Jump Rate model. With an exception on short fee rate, a minimum rate of 1% is applied to prevent system misuse.

  • Native fetches the latest borrow and supply rates on-chain every hour. Market Makers can check the current rate via the /token-settings endpoint to determine if borrowing from Native Lend remains profitable.

  • Fees are calculated based on on-chain positions and elapsed seconds. Long fees (Market Maker earns) offset short fees (Market Maker pays) in notional values.

Formula

For each token, we have the values below:

  • positioni(t)position_i(t): as the position of the ii-th token at time tt. Positive value means long position, negative means short

  • long_fee_ratei(t)\text{long\_fee\_rate}_i(t) and short_fee_ratei(t)\text{short\_fee\_rate}_i(t): long fee rate for ii-th token at time tt, which is snapshot at the start of each hour and this rate is fixed and used for that hour

  • long_feei\text{long\_fee}_i = t(I{positioni(t)>0}positioni(t)long_fee_ratei(t)Δt)\sum_{t} \left( \mathbb{I}_{\{ \text{position}_i(t) > 0 \}} \cdot \text{position}_i(t) \cdot \text{long\_fee\_rate}_i(t) \cdot \Delta t \right), where I{positioni(t)>0}\mathbb{I}_{\{ \text{position}_i(t) > 0\}}is an indicator function that equals 1 when positioni(t)>0\text{position}_i(t) > 0 (indicating a long position) and 0 otherwise. ,and Δt\Delta t is in each second

  • short_feei\text{short\_fee}_i = t(I{positioni(t)<0}positioni(t)short_fee_ratei(t)Δt)\sum_{t} \left( \mathbb{I}_{\{ \text{position}_i(t) < 0 \}} \cdot \text{position}_i(t) \cdot \text{short\_fee\_rate}_i(t) \cdot \Delta t \right), similar to the long fees

After consolidating the long fees and short fees of all the tokens, long fees (MM earns) will offset the short fees (MM pays), in notional values:

  1. Convert long fee from token amount to USD value and sum togetherlong_fee_USD=it(I{positioni(t)>0}positioni(t)long_fee_ratei(t)Δtpricei(t))\text{long\_fee\_USD} = \sum_{i} \sum_{t} \left( \mathbb{I}_{\{ \text{position}_i(t) > 0 \}} \cdot \text{position}_i(t) \cdot \text{long\_fee\_rate}_i(t) \cdot \Delta t \cdot \text{price}_i(t) \right)

  2. Convert short from token amount to to USD Value for each tokenshort_fee_USDi=t(I{positioni(t)<0}positioni(t)short_fee_ratei(t)Δtpricei(t))\text{short\_fee\_USD}_i = \sum_{t} \left( \mathbb{I}_{\{ \text{position}_i(t) < 0 \}} \cdot \text{position}_i(t) \cdot \text{short\_fee\_rate}_i(t) \cdot \Delta t \cdot \text{price}_i(t) \right)

  3. Distribute Long Fee to Short Fee Proportionally offseti=short_fee_USDiishort_fee_USDilong_fee_USD\text{offset}_i = \frac{\text{short\_fee\_USD}_i}{\sum_{i} \text{short\_fee\_USD}_i} \cdot \text{long\_fee\_USD}

  4. Recalculate the Short Fee in Token Amount final_short_fee_USDi=short_fee_USDioffseti\text{final\_short\_fee\_USD}_i = \text{short\_fee\_USD}_i - \text{offset}_i,final_short_fee_tokeni=final_short_feeipricei(t)\text{final\_short\_fee\_token}_i = \frac{\text{final\_short\_fee}_i}{\text{price}_i(t)}

Example

  • Prices: ETH = $2000, USDT = $1, LINK = $20, USDC = $1

  • Fee rates per time unit:

    • Long: USDT = 0.01%, LINK = 0.002%

    • Short: ETH = 0.02%, USDC = 0.04%

  • At t0, MM1 has position of -1 ETH, +2000 USDT, +100 LINK, -1500 USDC

  • At t5,

    • Short fee = -0.001 ETH, -3 USDC

    • Long fee = + 1 USDT, + 0.01 LINK

  • Short fee USD = -2 USD (from ETH), -3 USD (from USDC)

  • Long fee USD = +1 USD (from USDT), +0.2 USD (from LINK), 1.2 USD in total

  • Long fees offset short fees proportionally

    • Final short fee ETH = -2 + (2 / (2+3) * 1.2) USD = -1.52 USD = -0.00076 ETH

    • Final short fee USDC = -3 + (3/ (2+3) * 1.2) USD = -2.28 USD = -2.28 USDC

Interest fees

The principal position is stored on-chain while the fee is calculated off-chain. Approximately every 8 hours, Native's off-chain engine posts the fee data on-chain, updating the on-chain position data (Epoch Update). This means that the fee merges into the principal, increasing the short position amount by that amount.

Note: If long fees exceed short fees, it will cancel out the short fee without increasing the long position.

Last updated