BigShort Docs

Precision and Mathematical Conventions

Token, BNB, and WBNB units, integer rounding, market cap, and executable-quote conventions on BSC.

Amounts, integers, and asset boundaries

Notation Units Purpose
T, a, b Token18 Project Token reserves, inventory, borrowing, and tax amounts
Q, N, C BNB wei (18 decimals) Actual/virtual curve quote reserves, notional, and collateral
W WBNB wei (18 decimals) External Pair reserves and Router inputs/outputs
BPS 10,000 100 bps = 1%
PPM 1,000,000 10 ppm = 0.001%

The project Token also has 18 decimals. Solidity’s ether is only 10^18 as a quantity suffix; this version’s native asset is BNB, not ETH.

Integer arithmetic and rounding

Operation Typical use
floor(x) Allocated shares, proportional progress, cumulative indices, and feasible sale amounts
ceil(x) Purchase cost for an exact Token amount and the safety funds required for the remaining position
sqrtFloor(x) / sqrtCeil(x) Conservative risk-model capacity calculation

Three prices and two supply measures

  • Curve price: Factory’s virtual Token/BNB reserves determine curve quotes; actual sale Token and actual BNB are accounted for separately.
  • External spot price: current Token/WBNB reserves set the marginal spot price. Large trades require the full AMM formula for executable quotes.
  • TWAP: Oracle confirms capacity through mature cumulative-price observations, not an automatically rolling five-minute sample. The current window is 300 seconds; current spot can still contract capacity immediately.

Protocol market cap Multiply the external Token/BNB price by 10,000,000,000 Token of curve supply instead of initial minted supply of 11,997,367,528 Token. External tax burns do not automatically shrink this basis. Initial mint and live Total supply must be shown separately.

Theoretical, remaining, and executable capacities are also independently constrained by existing positions, lending inventory, TWAP, actual Pair depth, integer rounding, permissions, and slippage. Risk Curve provides the specific model.

Position timing conditions

openedBlockNumber Records the latest successful opening/increase block. Full/partial closing and liquidation require block.number > openedBlockNumber. For example, a position opened in block N can first exit in N+1. Adding collateral and partially closing do not reset this value. This check is separate from Funding and TWAP windows measured in seconds.

BigShort Protocol · BSCIssue · Trade · Short