BigShort Docs

Funding

A quadratic daily Funding curve based on lending utilization, gross-notional accrual, and Q128 time accumulation, with exact rounding examples.

Funding is the BNB fee paid by a Short position for continuously occupying lending capacity. It is neither perpetual-futures funding transferred between longs and shorts nor borrowing interest calculated from the live Token price. In this version, Short positions pay it into the separate fundingNative revenue ledger.

The mechanism has two layers: Token lending utilization determines the rate; gross BNB notional shares determine each position's payment.

Quadratic relationship between lending utilization and the daily Funding rate

The chart uses current BSC group parameters. A daily-rate curve is not an investment return.

1. Parameters and Units

Symbol / parameterValue and unitPurpose
L0L_01,997,367,528 TokenInitial lending principal of the current BSC group
LbadL_{\mathrm{bad}}Token, 18 decimalsConfirmed unrecovered lending principal
BtotalB_{\mathrm{total}}Token, 18 decimalsTotal borrowing by all currently active positions
UUbps, 10,000 = 100%Inventory utilization quantized downward
Start / end1,000 / 9,000 bps10% / 90% utilization
AA99,990 ppm / dayCurve increment coefficient
bb10 ppm / dayMinimum daily fee rate
HiH_iSmallest BNB units, 18 decimalsPosition shortShares, measured by gross notional
QQ21282^{128}Funding fixed-point index precision

1,000,000 ppm = 100%; a day is 86,400 seconds. USDC parameters expressed with ether BNB parameters merely use Solidity’s 101810^{18} scaling syntax.

2. Utilization and the Quadratic Curve

First exclude confirmed bad debt:

Leffective=L0−LbadL_{\mathrm{effective}}=L_0-L_{\mathrm{bad}}
U=⌊Btotal⋅10,000Leffective⌋U=\left\lfloor\frac{B_{\mathrm{total}}\cdot10{,}000}{L_{\mathrm{effective}}}\right\rfloor

If effective principal is zero, the code directly sets U=10,000U=10{,}000. Donating Token directly to the Engine does not increase L0L_0 and cannot bypass the ledger to reduce utilization.

For 1,000<U<9,0001{,}000<U<9{,}000 , the normalized variable is also rounded down as an integer:

x=⌊(U−1,000)⋅10,0008,000⌋x=\left\lfloor\frac{(U-1{,}000)\cdot10{,}000}{8{,}000}\right\rfloor

The daily rate rdr_d is measured in ppm / day:

rd(U)={10,U≤1,00010+⌊99,990⋅x210,0002⌋,1,000<U<9,000100,000,U≥9,000r_d(U)=\begin{cases} 10,&U\le1{,}000\\ 10+\left\lfloor\dfrac{99{,}990\cdot x^2}{10{,}000^2}\right\rfloor,&1{,}000<U<9{,}000\\ 100{,}000,&U\ge9{,}000 \end{cases}

The current implementation is a quadratic curve with a squared term, not a cubic curve. The daily rate is 0.001% below 10% utilization and reaches 10% / day at 90%. Funding costs rise substantially at high utilization; the minimum rate must not be presented as a fixed charge.

Utilization xx Integer daily rate Daily percentage Approximate one-day fee on 1 BNB of shares
≤10% Not applicable 10 ppm 0.001% 0.000010 BNB
30% 2,500 6,259 ppm 0.6259% 0.006259 BNB
50% 5,000 25,007 ppm 2.5007% 0.025007 BNB
70% 7,500 56,254 ppm 5.6254% 0.056254 BNB
≥90% Not applicable 100,000 ppm 10% 0.100000 BNB

The fees in the table are decimal approximations for readability; actual on-chain amounts also go through the Q128 integer calculations below.

3. Accrual by Second and Allocation by Share

Let Δt\Delta t seconds have elapsed since the last update, and let the global Funding index be II. Each interval with a fixed rate adds:

ΔI=⌊rd⋅Δt⋅Q1,000,000⋅86,400⌋\Delta I=\left\lfloor\frac{r_d\cdot\Delta t\cdot Q}{1{,}000{,}000\cdot86{,}400}\right\rfloor
Inew=Iold+ΔII_{\mathrm{new}}=I_{\mathrm{old}}+\Delta I

Position ii records its last settlement snapshot IiI_i. Its unpaid amount is:

Fi=⌊Hi⋅(I−Ii)Q⌋F_i=\left\lfloor\frac{H_i\cdot(I-I_i)}{Q}\right\rfloor

Both steps round down. Across multiple checkpoints, calculate each ΔI\Delta I separately and then add them; do not automatically replace them with one continuous floating-point formula. Tiny integer rounding differences do not imply that an entire extra fee has been added or omitted.

Why Is Past Funding Not Revalued at the Instantaneous Market Price?

  • The daily rate comes from the Token inventory ledger and does not directly depend on the Pair price at that moment.
  • Position shares come from gross notional,not borrowed Token quantity × spot price at the checkpoint.
  • Opening, increasing, partial closing, and liquidation update the index before changing borrowing, fixing the past interval at its previous utilization.
  • Bad-debt recovery is permitted only with no active Token borrowing, preventing the lower utilization after recovery from being applied retroactively to earlier intervals.

Market trades may still change the Token quantities required by future new positions and thus indirectly affect future utilization; not charging at the instantaneous market price does not mean that future fees are entirely unaffected by market activity.

4. How Settlement Deducts Fees

Let current position funds be MM:

Fpaid=min⁡(Fi,M),Funpaid=Fi−FpaidF_{\mathrm{paid}}=\min(F_i,M),\qquad F_{\mathrm{unpaid}}=F_i-F_{\mathrm{paid}}

The paid portion moves from marginNative into fundingNative without reducing the historical collateral ledger value collateralNative ; amounts due but unpaid do not become realized protocol revenue merely by being owed.

Operation Funding treatment
New position Update the global index; new shares accrue from the current snapshot and are not charged for earlier intervals
Increase position Settle the old interval on old shares first; then add new shares and charge the combined shares thereafter
Add collateral Add funds first, then settle fees on all shares; new funds may cover old unpaid fees
Full close Settle all shares first, then perform the respective safety checks
Close partially Settle only closing shares; remaining shares retain their old snapshot and corresponding historical unpaid fees
Liquidate Settle Funding first; if it cannot be fully paid, enter the dedicated Funding-insolvency branch

Closing and liquidation are subject to the latest opening/increase block. If that is N, partial/full closes and single/batch liquidation are allowed no earlier than N+1. Collateral additions and partial closes do not reset the lock. This version has no collateral withdrawal for live positions and no cash payout on partial closes.

Except during liquidation, an operation reverts if any Funding required to be settled by that operation remains unpaid. After a partial close, historical Funding on remaining shares may remain pending. Reducing shares through partial closing cannot erase historical Funding.

5. Exact examples using current BSC group parameters

This is an independent Funding example: gross-notional shares are 1 BNB, borrowed Token is 132,259,540.801155254764734088, and effective principal is 1,997,367,528 Token, with no other positions or bad debt.

U=⌊132,259,540.801155254764734088⋅10,0001,997,367,528⌋=662U=\left\lfloor\frac{132{,}259{,}540.801155254764734088\cdot10{,}000}{1{,}997{,}367{,}528}\right\rfloor=662

Quantized utilization is 6.62%, below 10%, so the daily rate is 10 ppm. Shares H=1018H=10^{18} corresponds to 1 BNB of gross notional. Maintain this utilization for one day and update only once at day-end:

ΔI=⌊10⋅21281,000,000⌋\Delta I=\left\lfloor\frac{10\cdot2^{128}}{1{,}000{,}000}\right\rfloor
F=⌊1018⋅ΔI2128⌋=9,999,999,999,999F=\left\lfloor\frac{10^{18}\cdot\Delta I}{2^{128}}\right\rfloor =9{,}999{,}999{,}999{,}999

This is 0.000009999999999999 BNB which is 1 wei below the decimal ideal of 0.00001 BNB. In a separate scenario with stable 50% utilization, the exact one-day cost for the same 1 BNB shares is 0.025006999999999999 BNB. These are funding-cost examples, not fixed returns, position-size limits, or rate promises.

Separate Intervals before and after Increasing a Position

If a position holds H1H_1 for two days and then adds ΔH\Delta H, those first two days settle using H1H_1 ; only subsequent time uses H1+ΔHH_1+\Delta H. Even if the increase moves the daily rate from a low tier to a high tier, the new rate cannot be applied retroactively to the preceding two days.

BigShort Protocol · BSCIssue · Trade · Short