Narwhal Finance
WebsiteTwitter
  • 👋Introduction to Narwhal
  • 🫂Referrals
  • 📚Glossary
  • 🦄Using Narwhal
    • Connect Wallet
    • Alternative RPCs
    • Trading
      • Opening trades
      • Managing Trades
      • Closing Trades
    • Staking
      • NLP Pool
      • NAR & esNAR Staking
      • esNAR Vesting
      • Claiming Rewards
    • Brand Assets
    • Risks
  • 🎲Carnival
    • Carnival Games
    • Descriptions
    • Game Responsibly
  • ⚙️Perpetual Trading
    • Overview
      • Lifecycle of a Trade
      • Keepers
    • Risk Management
    • Assets
    • Fees and Spread
  • 🪙Tokenomics
    • Liquidity Pools
  • 👨‍💻Devs
    • Contracts
    • Security
    • Bug Bounty Program
    • Setting up a Keeper
  • 🔗Links
    • Twitter
    • Website
Powered by GitBook
On this page
  • Overview of fees and spread types
  • Spread
  • Price Impact
  • Borrowing Fee
  • Calculation
  • Methodology
  • Funding Rate
  1. Perpetual Trading

Fees and Spread

Fees and spreads charged by the protocol

Overview of fees and spread types

Fee Type

Design and Goal

Definition

Opening Fee and Closing Fee

charged upon the total position size (collateral x leverage)

0.08% of position size

Base Spread

inversely related to the liquidity of the pair

0.025% for crypto and stocks

0% for FX

Price impact

depending on the position size of your trade, and on the liquidity of the pair on spot exchanges

  • used to prevent manipulating the spot price of assets listed on the platform in a profitable manner

price impact (%) = (open interest {long/short} + New trade position size / 2) / 1% depth {above/below}

Borrowing Fee

Allow traders to use lower leverages while maintaining solid risk management for the protocol

Borrowing fee = (current block - trade open block) * rollover fee per block % * trade collateral

Funding Fee

Aims to minimize the gap between long and short open interests to prevent very significant exposure on one side only on any trading pair

Accumulated funding fee per OI (long) += (Long OI - Short OI) * blocks elapsed * funding fee per block % / Long OI

Accumulated funding fee per OI (short) += (Short OI - Long OI) * blocks elapsed * funding fee per block % / Short OI

Spread

A base spread is considered to simulate a bid/ask spread on a CLOB exchange for execution price. Currently, a base spread of 0.025% is applied on the spot price returned from the oracle. Spread only applies when opening a trade

Price Impact

Price impact is implemented to simulate execution price in a CLOB exchange mechanism, protecting NLP holders from directional skew. As such, we take the current aggregate open interest on the platform plus half of the trade position size, divided by 1% of order book depth on a reference exchange. It is calculated as follows:

Price Impact(%)=Open interest long/short+new trade position size21%depth above/belowPrice~Impact(\%) = \frac{Open~interest~{long/short}+\frac{new~trade~position~size}{2}}{1\% depth~above/below}Price Impact(%)=1%depth above/belowOpen interest long/short+2new trade position size​​

Note: Price impact never applies when closing a trade

Methodology:

For crypto, 1% depth is calculated as the 1% depth of Binance multiplied by 2. Our pricing oracle uses the median price of 7 centralized exchanges; hence, multiplying the depth of the most liquid exchange by 2 serves as a conservative measure

For stocks, the 1% depths are set at $10m (tier 1), $5m (tier 2), and $2.5m (tier 3) in both directions (long/short).

There is no price impact for FX.

Example:

Asset: BTC/USD

1% depth above: $20M

Long open interest: $500k

New trade position size: $200k (collateral x leverage)

The price impact (%): 500k + 200k/2 20m = 0.03%

Then add the spread (0.025%) → 0.03% + 0.025% = 0.055%.

Borrowing Fee

Borrowing fees simulate borrowing costs as the Narwhal platform provides synthetic leverage and maintains solid risk management for the protocol.

Calculation

Rollover fees are charged on the initial collateral of the trade and tallied on a per-block basis. The rollover fee rate is annualized and then divided as a per-block fee, assuming the chain processes 28,800 blocks per day or 10,512,000 blocks per year.

Rollover fee=(current block−open trade block)×rollover fee per block%×trade collateralRollover~fee=(current~block-open~trade~block)\times rollover~fee~per~block \%\times trade~ collateralRollover fee=(current block−open trade block)×rollover fee per block%×trade collateral

Methodology

Rollover fees should vary depending on the volatility of the underlying assets being traded, which is measured using the average true range (ATR) indicator, expressed as a percentage over the average closing price (ATRP):

TR=max⁡[(H−L),∣(H−Cp)∣,∣(L−Cp)∣]TR =\max[(H-L), |(H-C_p)|, |(L-C_p)|]TR=max[(H−L),∣(H−Cp​)∣,∣(L−Cp​)∣]
ATR=(1n)∑i=1nTRiATR = (\frac{1}{n})\sum^{n}_{i=1}{TR}_iATR=(n1​)i=1∑n​TRi​
Rollover fee per block=(4weekATR/4 week average price∗100)x×52blocks per year∗y\text{Rollover fee per block} = \frac{(4 week ATR/\text{4 week average price}*100)^x\times 52}{blocks~per~year*y}Rollover fee per block=blocks per year∗y(4weekATR/4 week average price∗100)x×52​

Where:

X = 1.25

Y = 20

Assumed 10,512,000 is the number of blocks per year.

Example:

Current block: 1,010,000

Trade open block: 1,000,000

Rollover fee %: 157% = 0.00001% per block

Collateral: $1,000

Rollover fee = (1,010,000 - 1,000,000) * 0.00001/100 * 1,000 = 1

Funding Rate

To book perpetual exchanges, a funding rate is introduced to incentivize perpetual prices to trade at par to spot prices through a funding rate mechanism, where longs pay shorts if contracts are traded at a premium to spot and vice versa. Narwhal Finance uses oracle-based pricing but includes a funding fee to incentivize neutral long-short skew to better protect NLP holders. Similar to rollover fees, funding fees are charged on a per-block basis. However, fees are charged on the total position size rather than the initial collateral.

Funding fee per block=(ATR%4 week average)x×52blocks per year∗y\text{Funding fee per block} = \frac{(ATR\% 4~ week~average)^x\times 52}{blocks~per~year*y}Funding fee per block=blocks per year∗y(ATR%4 week average)x×52​

Where:

X = 1.25

Y = 60

Blocks per year

ATR: Average True Range; calculated as:

TR=max⁡[(H−L),∣(H−Cp)∣,∣(L−Cp)∣]TR =\max[(H-L), |(H-C_p)|, |(L-C_p)|]TR=max[(H−L),∣(H−Cp​)∣,∣(L−Cp​)∣]
ATR=(1n)∑i=1nTRiATR = (\frac{1}{n})\sum^{n}_{i=1}{TR}_iATR=(n1​)i=1∑n​TRi​
Accumulated funding fee per OI (long)+=(long OI−short OI)×blocks elapsed×funding fee per block%long OIAccumulated~funding~fee~per~OI~(long)\mathrel{+}=\frac{(long~OI-short~OI)\times blocks~elapsed\times funding~fee~per~block\%}{long~OI}Accumulated funding fee per OI (long)+=long OI(long OI−short OI)×blocks elapsed×funding fee per block%​
Accumulated funding fee per OI (long)+=(short OI−long OI)×blocks elapsed×funding fee per block%short OIAccumulated~funding~fee~per~OI~(long)\mathrel{+}=\frac{(short~OI-long~OI)\times blocks~elapsed\times funding~fee~per~block\%}{short~OI}Accumulated funding fee per OI (long)+=short OI(short OI−long OI)×blocks elapsed×funding fee per block%​
Funding fee=(Current accumulated funding fee per OI−Initial accumulated funding fee per OI)×trade collateral×trade leverageFunding~fee=(Current~accumulated~funding~fee~per~OI-Initial~accumulated~funding~fee~per~OI)\times trade~collateral\times trade~leverageFunding fee=(Current accumulated funding fee per OI−Initial accumulated funding fee per OI)×trade collateral×trade leverage

If the negative value is added to the trade value like a positive PnL, and the liquidation price goes further away. If the value is positive, it is removed from the trade value like negative PnL, making the liquidation price closer.

However, if the funding fee rate per block corresponds to 40% per year, it doesn’t mean that 40% will be charged at all times. It will only be the case if there is 0 exposure on the opposite side, as the funding rate is only applied to the pair's net exposure.

For example, if this pair has $1m long exposure and $500k short exposure, the funding fees paid will be ($1m—$500k) * 40 / 100 = $200k per year, which represents a cost of 20% / year for longs and a reward of 40% / year for shorts.

PreviousAssetsNextLiquidity Pools

Last updated 1 month ago

⚙️