Fees on Sai
Sai charges some of the lowest trading fees in the perpetual futures market. Most markets charge 0.05% to open and 0.05% to close, and a few markets charge more. Deposits are free, and a withdrawal from your Sai balance pays a small flat fee. When factoring in zero gas costs and available discounts, Sai is one of the most competitive exchanges for active futures traders.
Trading Fee Reference
Section titled “Trading Fee Reference”| Fee Type | Rate | Description |
|---|---|---|
| Trading Fee (open and close) | 0.05% on most markets; 0.08% on some | Charged on the total position size when you open, and again when you close. The rate is set per market. See Trading Fees by Market. |
| Trading Fee with Referral | 15% off by default (0.0425% on a 0.05% market) | The default referral code discount is 15% of trading fees. A code can carry its own discount, and the order form shows your rate. |
| Gas Fees for Trading | 0 (Free) | Always zero on Sai’s L1, Nibiru. |
| Trigger Fee | 0.01% | Charged on orders a keeper executes for you, such as Limit and Stop entries, Stop Loss, and Take Profit, to pay for the execution cost. |
| Deposits | 0 (Free) | Sai charges no deposit fee. You pay gas on the chain you send from. See Deposit and Withdrawal Fees. |
| Withdrawals | 0.01 USDC to Base, 0.10 USDC to Ethereum | Charged on a withdrawal from your Sai balance. The minimum withdrawal is 1 USDC. See Deposit and Withdrawal Fees. |
| Borrowing Fee (Funding Rate) | Variable, based on open-interest skew | A time-based fee on open positions that contribute to a long or short OI imbalance. The market header shows the current hourly rate. See Borrowing Fees. |
| Rapid-Close Fee | Up to 0.4% of position size on most markets, decaying to 0 by ~12 min | Extra closing fee on a profitable close of a position held only briefly; never more than the profit left after other closing costs, and at most 20% of the collateral. Paid to LPs. Some markets use a higher peak rate. See Rapid-Close Fee. |
| Minimum Hold for Discounts | 60 blocks (~2.4 min) | A position closed within 60 blocks of opening pays full closing fees and gives back the discount it got on the opening fee. See Minimum Hold for Discounts. |
| Profit Fee | 10% of profit after costs | Held back from a profitable close and paid to LPs. See Profit Fee. |
| Absolute Exposure Fee | Variable, grows with the market’s open positions | Charged when you open, add to, reduce, or close a position; paid to LPs. See Absolute Exposure Fee. |
Standard trading fees are calculated based on your total position size (leverage × collateral), not just your wallet balance.
Contents
Section titled “Contents”- Fees on Sai
- Trading Fee Reference
- Trading Fees by Market
- Deposit and Withdrawal Fees
- Key Concepts
- Where Fees are Distributed
- Minimum Hold for Discounts
- Fee Lifecycle
- Borrowing Fees (Funding Rate) for Open Interest Skew
- Rapid-Close Fee
- Profit Fee
- Absolute Exposure Fee
- Liquidation Mechanics
- Insufficient Collateral
- Borrowing fee calculation reference
Trading Fees by Market
Section titled “Trading Fees by Market”Each market has its own opening fee, closing fee, and trigger fee. Most markets, including BTC and ETH, charge 0.05% to open and 0.05% to close. Some markets charge more:
| Rate (open and close) | Markets |
|---|---|
| 0.05% | Most markets, such as BTC and ETH |
| 0.08% | Some altcoins, such as NEAR and ZEC |
Market rates can change. To see the rate for a market, open it in the Sai app and enter an amount in the order form. The Est. Taker Fee row shows the fee rate and the amount for that order. Hover over the rate to see the market’s base rate and your rate after any referral or volume discount.
Limit Orders Are Not Maker Orders
Section titled “Limit Orders Are Not Maker Orders”Sai has no maker orders and no maker rebate. Every trade fills against Sai’s liquidity vault at a price taken from the oracle, so there is no order book for an order to rest on. A Limit or Stop order pays the market’s opening fee when it fills, plus the 0.01% trigger fee. On the Limit tab, the Est. Taker Fee row includes the trigger fee.
Deposit and Withdrawal Fees
Section titled “Deposit and Withdrawal Fees”Sai charges no deposit fee. You pay gas on the chain you send from. Withdrawals from your Sai balance pay a small flat fee. For how deposits and withdrawals work, read Deposit and Withdraw with Sai Teller.
| Action | Sai fee | Other costs |
|---|---|---|
| Deposit from Base | None | ETH gas on Base |
| Deposit from Ethereum, fast | None | ETH gas, plus Circle’s fast-transfer fee paid in ETH. The app shows it before you confirm. |
| Deposit from Ethereum, standard | None | ETH gas |
| Withdraw from your Sai balance to Base | 0.01 USDC | None. You do not need NIBI. |
| Withdraw from your Sai balance to Ethereum | 0.10 USDC | None. You do not need NIBI. |
| Bridge Out from your Nibiru wallet | None | A little NIBI for gas |
Every withdrawal must be at least 1 USDC. On a withdrawal from your Sai balance, you receive the full amount you enter, and your Sai balance pays the amount plus the fee. The fee and minimum are set on-chain and can change, so the app always shows them before you confirm.
Key Concepts
Section titled “Key Concepts”- Base Fees: Every market has a base opening fee, closing fee, and trigger fee.
- Fee Multipliers: The base fees are adjusted by two multipliers:
- Tier-based: High-volume traders earn points, which unlock a lower fee multiplier.
- Referral: Referred traders receive a discount multiplier.
- Effective Multiplier: The lowest of the applicable multipliers is used to calculate the final fee.
- Minimum Hold: A close within 60 blocks of opening uses no discount at all (multiplier 1.0). See Minimum Hold for Discounts.
- Liquidation Fees: These are a fixed percentage of the position’s collateral (after opening fees) and are not subject to the multipliers.
Where Fees are Distributed
Section titled “Where Fees are Distributed”- Keepers (Bots): Receive 20% of the Trigger Fee for executing automated orders (Limit, Stop Loss, Take Profit). A keeper that liquidates a position receives nothing.
- The Vault (LPs): Receives 1% of each Closing Fee, the whole Rapid-Close Fee, Profit Fee, and Absolute Exposure Fee, and the closing component of a liquidation penalty.
- The Protocol (Gov): Receives the rest: the Open Fee, the other 99% of the Closing Fee, the Trigger Fee less any keeper share, and the trigger component of a liquidation penalty. Sai currently forwards all of the Protocol’s portion, after referrer shares, to the Vault.
- Referrers: Earn a share of the fees their referees pay, taken from the Protocol’s portion.
The Vault’s 1% share and the forwarding are set on-chain and can change. See Verifying Info Onchain.
Minimum Hold for Discounts
Section titled “Minimum Hold for Discounts”Fee-tier and referral discounts apply only to positions held for more than a minimum time: 60 blocks on mainnet, about 2.4 minutes. When you close a position within 60 blocks of opening it:
- No discount on the close. The closing fee, and the trigger fee for a Take-Profit or Stop-Loss, are charged at the full rate (a fee multiplier of 1.0), whatever your fee tier or referral code.
- The opening discount is taken back. The discount you received on the opening fee is charged again at close, as the opening fee clawback. In effect the trade pays the full standard fee to open and to close.
- No fee-tier points. The close earns none, and the points the trade earned when it opened are taken back.
This applies whether the close is a profit or a loss, and to market closes, Take-Profit and Stop-Loss closes, and partial closes. On a partial close, the closing fee and the opening fee clawback scale with the size closed, but the trade’s fee-tier points from within the 60 blocks are still taken back in full. Positions held past 60 blocks keep their discounts as usual.
Two kinds of close work differently:
- Liquidations pay the liquidation penalty, a fixed share of the collateral that never has a discount, instead of the closing and trigger fees. A position liquidated within 60 blocks also pays the opening fee clawback, and its fee-tier points are taken back as above.
- After-hours risk reductions pay the closing fee at the full rate, with no fee-tier or referral discount, and earn no fee-tier points, at any hold time. They pay no opening fee clawback, trigger fee, Rapid-Close Fee, or absolute exposure fee.
The window is set on-chain and can change; see Verifying Info Onchain. It is separate from the Rapid-Close Fee, which can apply on top of it.
Fee Lifecycle
Section titled “Fee Lifecycle”1. Opening a Trade
Section titled “1. Opening a Trade”When a user opens a trade, the system performs the following steps to calculate and process fees:
- Determine Multiplier: It fetches the trader’s fee tier and checks for a referral discount to find the effective fee multiplier.
- Calculate Fees: The system calculates the adjusted open and trigger fees by applying the effective multiplier to the base fees.
- Deduct and Distribute: The total fee is deducted from the trader’s collateral and distributed. A portion goes to the trigger service provider (if applicable), a cut is allocated to the referrer, and the rest is the Protocol’s portion. Any Absolute Exposure Fee goes to the Vault.
2. Closing a Trade
Section titled “2. Closing a Trade”When a user closes a trade, fees are handled differently depending on whether it’s a normal closure or a liquidation.
- Normal Closure: The system determines the effective multiplier, calculates adjusted close fees, and distributes them. A close within the minimum hold uses a multiplier of 1.0 and adds the opening fee clawback.
- Liquidation: The fee is a fixed percentage of the position’s collateral (after opening fees), bypassing any fee tier or referral discounts. This fee is then split between the Vault and the Protocol. A liquidation within the minimum hold also pays the opening fee clawback, which goes to the Protocol’s portion.
Borrowing Fees (Funding Rate) for Open Interest Skew
Section titled “Borrowing Fees (Funding Rate) for Open Interest Skew”Borrowing fees are a time-based charge on open leveraged positions when long and short open interest (OI) become unbalanced. The Sai market header labels the current hourly borrowing rate as Funding Rate.
If long OI is greater than short OI, long positions can accrue the fee. If short OI is greater, short positions can accrue it. Sai checks the imbalance for both the individual market and its borrowing group. The rate grows as the relevant imbalance takes up more of the available OI limit, and it can fall to zero when long and short OI are balanced.
This is different from a peer-to-peer funding payment. Sai deducts the fee from the position that owes it. Traders on the less crowded side do not receive that fee.
Estimate the cost
Section titled “Estimate the cost”The fee applies to position size, which is collateral multiplied by leverage. To estimate the charge, multiply the position size by the displayed hourly rate and the number of hours held.
For example, $100 of collateral at 10x leverage creates a $1,000 position. At an illustrative rate of 0.01% per hour, holding it for five hours costs about $0.50:
| Input | Value |
|---|---|
| Collateral | $100 |
| Leverage | 10x |
| Position size | $1,000 |
| Hourly rate | 0.01% |
| Holding time | 5 hours |
| Estimated borrowing fee | $0.50 |
The rate is not locked when you open the trade. It changes as OI changes, so this example is an estimate rather than a quote.
When the fee is charged
Section titled “When the fee is charged”Borrowing fees accrue block by block while the position is open. Accrued fees reduce the position’s equity and move its liquidation price closer, even before settlement. Sai deducts the accrued amount when the position closes or changes size or leverage.
For the accumulator logic and contract data structures, read the Perp: Borrowing Fees.
Rapid-Close Fee
Section titled “Rapid-Close Fee”Sai adds an extra fee when a position is closed at a profit very soon after it opens. The fee is largest in the first seconds of a trade and decays smoothly to zero the longer the position is held. It reaches zero after about 12 minutes, so it never touches positions held past that window.
The fee protects Liquidity Providers. Very short holds can capture the brief difference between the on-chain oracle price and the live market price at the Vault’s expense; a higher fee on the fastest profitable closes removes that edge while leaving ordinary trading untouched.
How it is calculated
Section titled “How it is calculated”The fee is a percentage of your position size (leverage × collateral). The rate decays exponentially with the time the position is held:
fee_rate(hold) = F0 × e^(−hold / τ)F0is the peak rate at the moment of opening: 0.4% on the global curve.τ(tau) sets how fast the rate decays: 31 blocks, about 76 seconds.- The rate is forced to zero once a position is held past 300 blocks, or about 12 minutes.
- The charge is capped at 20% of the collateral being closed.
- The charge is also capped at the profit left after the other closing costs: the closing fee, trigger fee, borrowing fee, opening fee clawback, and absolute exposure fee. A losing or break-even close pays no Rapid-Close Fee, and a profitable close is never pushed below break-even by it.
With the global curve the fee is approximately:
| Hold time | Fee (of position size) | Example at 10× | Example at 50× |
|---|---|---|---|
| 0 seconds | 0.4% | 4% of collateral | 20% of collateral (the cap) |
| ~1 minute | ~0.18% | ~1.8% of collateral | ~9.0% of collateral |
| ~2 minutes | ~0.08% | ~0.8% of collateral | ~4.1% of collateral |
| ~3 minutes | ~0.037% | ~0.37% of collateral | ~1.9% of collateral |
| ~5 minutes | ~0.008% | ~0.08% of collateral | ~0.38% of collateral |
| ~7 minutes | ~0.0016% | ~0.016% of collateral | ~0.08% of collateral |
| ~12 minutes or longer | 0 | 0 | 0 |
Each figure is an upper bound: the fee is never more than the profit left after the other closing costs. Because the rate applies to position size, higher leverage makes the same short hold cost a larger share of your collateral. The fee is added to the standard closing fee and is paid entirely to the Vault (LPs). Fee-tier and referral discounts do not reduce it.
When it applies
Section titled “When it applies”The fee applies only to closes that end in a profit, whether voluntary, Take-Profit, or Stop-Loss, including partial closes and leverage reductions. A Stop-Loss that closes at a loss pays none, like any losing or break-even close. Liquidations and after-hours risk reductions are exempt.
Most markets share the global curve. Some markets carry a higher peak rate F0,
because a larger per-update price move gives a larger short-hold edge:
Peak rate F0 | Markets |
|---|---|
| 2.117% | SUI, ADA, DOGE, HYPE, ZEC |
| 2.36% | QBTS |
| 2.42% | KAITO |
| 2.44% | APT |
| 2.45% | GRAM |
| 3.12% | QUBT |
| 4.96% | IP |
They use the same decay speed, 300-block window, 20% collateral cap, and profit cap as the global curve.
This table is a snapshot of the on-chain overrides, and they can change. To
check a market’s current peak rate, query
get_short_lived_penalty_f0_for_market (see
Verifying Info Onchain).
What this means for traders
Section titled “What this means for traders”Holding a position for a few minutes or longer makes this fee negligible or zero. A profitable close within the same minute incurs a meaningful extra fee that is largest in the first seconds and falls quickly as the hold grows, but it can never turn the trade into a loss. In on-chain queries and trade events this fee is labelled the short-lived-trade penalty.
A close within 60 blocks also loses its fee discounts; see Minimum Hold for Discounts.
Profit Fee
Section titled “Profit Fee”Sai charges 10% of your gains after all other fees and costs for this trade. No profit fee applies if you break even or lose money. The fee is held back from your payout and retained by the SLP liquidity pool.
The fee applies to the price profit, up to the 900% profit cap, minus the costs the position paid: opening, closing, and trigger fees, borrowing fees, the rapid-close fee, and the absolute exposure fee. If those costs are as large as the price profit or larger, there is no profit fee. A losing close or a liquidation pays none.
For example, a close with 100 USDC of price profit and 15 USDC of costs has 85 USDC of profit after costs. The profit fee is 8.50 USDC, so your net profit is 76.50 USDC.
A partial close uses the gains and allocated costs of the portion you closed.
Absolute Exposure Fee
Section titled “Absolute Exposure Fee”The exposure fee helps protect the liquidity that backs trading on Sai. In an extreme case, a single oversized position could put that liquidity at risk. The fee scales with trade size and the market’s total open size to compensate SLP liquidity providers for that risk.
This protection helps Sai offer high leverage across markets and grow sustainably. As trading activity expands, the fee adjusts automatically to account for the exposure the exchange supports. Sai’s liquidity backs risk in both directions.
Sai charges an absolute exposure fee when you open, add to, reduce, or close a position. This includes a Limit or Stop order that fills, and a Take Profit or Stop Loss that closes the position. The fee is paid to SLP liquidity providers.
The rate is not fixed. It grows with the size of all open positions in the market, longs plus shorts, so the same order costs more when the market holds more open positions:
fee = order size × k × market open positions / referenceorder sizeis the size you open, add, reduce, or close, in USD.market open positionsis the value of all open long and short positions in the market at the oracle price, averaged before and after your order.kis 0.00145 andreferenceis 22,250 USDC. Both are set on-chain.
For example, if a market holds 20,000 USD of open positions, a 1,000 USD order pays 1,000 × 0.00145 × 20,000 / 22,250, about 1.30 USDC, or 0.13% of the order.
Liquidations and after-hours risk reductions do not pay this fee, and neither does a leverage change. Fee-tier and referral discounts do not reduce it. The Est. Taker Fee row in the order form does not include it.
Liquidation Mechanics
Section titled “Liquidation Mechanics”Liquidation occurs when a position’s losses, plus its liquidation fee and accrued borrowing fees, reach 90% of its collateral. At that point, the protocol force-closes the trade to protect the vault from bad debt. See Leverage and Liquidations for how this sets the liquidation price.
Key Difference: Collateral vs. Position
Section titled “Key Difference: Collateral vs. Position”Standard trading fees are based on position size. Liquidation fees are different: they are calculated from the position’s collateral (after opening fees), not from its equity after losses. Fee-tier and referral discounts do not apply.
The Liquidation Penalty
Section titled “The Liquidation Penalty”When a position is liquidated, a 10% liquidation penalty is applied to the position’s collateral (after opening fees). The penalty is split into two equal components:
-
Closing Component (5% of Collateral):
- Compensates the Vault for the forced close.
- All of it goes to the Vault.
-
Trigger Component (5% of Collateral):
- All of it goes to the Protocol. A referrer’s share, if any, comes out of this component.
- The liquidator or keeper that triggered the liquidation receives nothing.
Priority of Payments (The “Waterfall”)
Section titled “Priority of Payments (The “Waterfall”)”If a user is liquidated and their collateral is nearly empty (insufficient to cover the full fees), the smart contract pays out in a specific priority order to protect the system:
- First Priority → The Vault: The Vault gets its share first to ensure Liquidity Providers are protected.
- Second Priority → The Protocol: The Protocol receives whatever is left.
Liquidation Example
Section titled “Liquidation Example”You are liquidated on a position with $100 of collateral (after opening fees).
- Total Penalty Calculation: $10.00 (10% of $100).
- Distribution:
- $5.00 goes to the Vault (the Closing portion).
- $5.00 goes to the Protocol (the Trigger portion). A referrer’s share, if any, comes out of this $5.00.
- The liquidator receives nothing.
- Outcome: The liquidation fee is paid from the position’s collateral. The rest of the collateral is used to settle the forced closure, and your position collateral is zeroed. You receive nothing back, even if some collateral is left after losses and fees.
Insufficient Collateral
Section titled “Insufficient Collateral”If a position’s collateral cannot cover all of its closing fees, the collateral pays what it can. The Vault’s share is paid first. On a close a keeper executes for you, such as a Stop Loss or Take Profit, the keeper’s share is paid next, but only if the collateral left covers it in full. The Protocol receives whatever is left. A liquidation has no keeper share, so after the Vault is paid, the rest goes to the Protocol. Fees the collateral cannot cover go uncollected, and the trader receives nothing back.
Borrowing fee calculation reference
Section titled “Borrowing fee calculation reference”Sai tracks separate borrowing-fee accumulators for each market and borrowing group. At either level, the accumulator for the side with more OI changes by:
rate_delta = fee_per_block × elapsed_blocks × (abs(long_oi - short_oi) / max_oi) ^ fee_exponentThe formula uses these inputs:
fee_per_blockis the configured base rate for one block.elapsed_blocksis the number of blocks since the accumulator last updated.long_oiandshort_oiare the long and short open interest.max_oiis the OI limit for the market or borrowing group.fee_exponentcontrols how sharply the rate rises as the skew approaches the OI limit.
When long and short OI are equal, rate_delta is zero. Otherwise, only the
accumulator for the side with more OI increases at that level.
For each period in a trade’s lifetime, the contract compares the market-level and borrowing-group fee deltas for the trade’s direction and uses the larger one. If a market changes borrowing groups, the contract keeps each period’s history and adds the applicable deltas together.
The final charge uses the accumulated rate delta and the position size:
borrowing_fee = accumulated_rate_delta × collateral × leverageThe Funding Rate in the market header converts the current per-block rate into an hourly estimate. It does not lock the rate for the life of the trade.
Verifying Info Onchain
Section titled “Verifying Info Onchain”Claim: Trading fees are set per market.
Section titled “Claim: Trading fees are set per market.”Each market points to a fee schedule. Query the market, then its fee schedule:
# Sai Mainnet Perp Smart ContractPERP='nibi1ntmw2dfvd0qnw5fnwdu9pev2hsnqfdj9ny9n0nzh2a5u8v0scflq930mph'NODE='https://rpc.nibiru.fi:443'
nibid query wasm contract-state smart "$PERP" \ '{"get_market":{"index":"MarketIndex(38)"}}' \ --node "$NODE" --output jsonMarket 38 (NEAR) returns "fee_index":"FeeIndex(3)" among its fields. Query
that fee schedule:
nibid query wasm contract-state smart "$PERP" \ '{"get_fees":{"index":"FeeIndex(3)"}}' \ --node "$NODE" --output jsonResult:
{"data":{"open_fee_p":"0.0008","close_fee_p":"0.0008","trigger_order_fee_p":"0.0001","min_position_size_usd":"1"}}open_fee_p and close_fee_p are fractions of position size (0.0008 =
0.08%). Fee schedule FeeIndex(0), used by most markets, returns 0.0005.
The schedule has no maker fee field.
Claim: The minimum hold for discounts is 60 blocks.
Section titled “Claim: The minimum hold for discounts is 60 blocks.”# Sai Mainnet Perp Smart ContractPERP='nibi1ntmw2dfvd0qnw5fnwdu9pev2hsnqfdj9ny9n0nzh2a5u8v0scflq930mph'NODE='https://rpc.nibiru.fi:443'
nibid query wasm contract-state smart "$PERP" \ '{"get_fee_tier_min_hold_blocks":{}}' \ --node "$NODE" --output jsonResult:
{"data":60}A close within this many blocks of the open uses a fee multiplier of 1.0 and
emits an opening_fee_clawback in its process_closing_fees event.
Claim: The profit fee, absolute exposure fee, and fee forwarding are set on-chain.
Section titled “Claim: The profit fee, absolute exposure fee, and fee forwarding are set on-chain.”Query the perp contract’s fee settings:
# Sai Mainnet Perp Smart ContractPERP='nibi1ntmw2dfvd0qnw5fnwdu9pev2hsnqfdj9ny9n0nzh2a5u8v0scflq930mph'NODE='https://rpc.nibiru.fi:443'
nibid query wasm contract-state smart "$PERP" \ '{"get_fee_settings":{}}' \ --node "$NODE" --output jsonResult:
{"data":{"opening_net_gov_fraction":"1","closing_net_gov_fraction":"1","abs_exposure_fee_coef":"0.00145","abs_exposure_fee_reference_usdc":"22250000000","profit_fee_rate":"0.1"}}profit_fee_rateis the profit fee (0.1= 10%).abs_exposure_fee_coefisk, andabs_exposure_fee_reference_usdcis the reference in micro-USDC (22250000000= 22,250 USDC).opening_net_gov_fractionandclosing_net_gov_fractionare the shares of the Protocol’s portion, after referrer shares, forwarded to the Vault (1= 100%).
The Vault’s direct share of each closing fee is the storage item
vault_closing_fee_p:
KEY_HEX="$(printf vault_closing_fee_p | xxd -p -c 256)"
nibid query wasm contract-state raw "$PERP" "$KEY_HEX" \ --node "$NODE" --output jsonResult:
{"data":"IjAuMDEi"}The value decodes to "0.01" (printf 'IjAuMDEi' | base64 -d), a 1% share.
Claim: Withdrawals from the Sai balance pay a flat fee.
Section titled “Claim: Withdrawals from the Sai balance pay a flat fee.”The Sai USDC contract on Nibiru EVM,
0x357c97796aA8e2A6b5A64b1Fc19d5baB9668E190, stores the minimum and the fees.
Read minWithdrawal(), feesEnabled(), and withdrawalFee(uint32 domain) with
any EVM tool against https://evm-rpc.nibiru.fi. The domain is the destination’s
Circle CCTP domain: 6 for Base and 0 for Ethereum. Amounts use 6 decimals:
| Call | Result | Meaning |
|---|---|---|
minWithdrawal() | 1000000 | 1 USDC minimum |
feesEnabled() | true | Fees apply to Sai balance withdrawals |
withdrawalFee(6) | 10000 | 0.01 USDC to Base |
withdrawalFee(0) | 100000 | 0.10 USDC to Ethereum |
Claim: Default referral code discount on trading is 15%.
Section titled “Claim: Default referral code discount on trading is 15%.”Query the perp contract’s raw state for the storage key
referree_base_fee_multiplier:
# Sai Mainnet Perp Smart ContractPERP='nibi1ntmw2dfvd0qnw5fnwdu9pev2hsnqfdj9ny9n0nzh2a5u8v0scflq930mph'NODE='https://rpc.nibiru.fi:443'
KEY_HEX="$(printf referree_base_fee_multiplier | xxd -p -c 256)"
nibid query wasm contract-state raw "$PERP" "$KEY_HEX" \ --node "$NODE" \ --output jsonResult:
{"data":"IjAuMTUi"}Then decode the base64 value:
printf 'IjAuMTUi' | base64 -dOutput:
"0.15"The storage item is the default referral discount. Here “0.15” means a 15%
discount. A code can carry its own discount, stored under the map
referrer_code_fee_discounts. A code without an entry uses the default.
Claim: The rapid-close fee curve is configured on-chain.
Section titled “Claim: The rapid-close fee curve is configured on-chain.”Query the perp contract for the live curve:
# Sai Mainnet Perp Smart ContractPERP='nibi1ntmw2dfvd0qnw5fnwdu9pev2hsnqfdj9ny9n0nzh2a5u8v0scflq930mph'NODE='https://rpc.nibiru.fi:443'
nibid query wasm contract-state smart "$PERP" \ '{"get_short_lived_penalty_curve":{}}' \ --node "$NODE" --output jsonResult:
{"data":{"f0":"0.004","tau_blocks":"31","max_window_blocks":300,"cap_pct":"0.2"}}f0 is the global peak rate (0.004 = 0.4%), tau_blocks the decay
constant in blocks, max_window_blocks the hold past which the fee is zero (300
blocks ≈ 12 minutes at ~2.44s/block), and cap_pct the cap as a fraction of
collateral (0.2 = 20%). On top of the curve, the fee is limited to the profit
left after the other closing costs, so a losing or break-even close pays none. To preview the rate for a specific market and hold
time, query get_short_lived_penalty_rate with a market_index and
hold_blocks.
Protected markets can override the global peak rate. To verify the effective
F0 for a market:
nibid query wasm contract-state smart "$PERP" \ '{"get_short_lived_penalty_f0_for_market":{"market_index":43}}' \ --node "$NODE" --output jsonMarket 43 (HYPE) currently returns:
{"data":"0.02117"}