In Bolt, price is an input from the oracle, not an output from a curve. This is the core mathematical difference that enables deterministic settlement.
The Pricing Model
Bolt uses oracle-anchored reference pricing rather than bonding curve mechanics. When you submit a swap:- Oracle publishes a reference price for the asset pair (e.g., 1 token A = X token B)
- Fee rate is applied to the reference price to calculate the execution price
- amountOut is derived directly:
amountOut = amountIn × oraclePrice × (1 - feeRate) - Inventory is validated to ensure sufficient liquidity exists to settle the trade
- Settlement occurs at the calculated amountOut, regardless of pool depth
Simplified Pricing Formula
- amountIn: The quantity of input asset you’re trading
- oraclePrice: The current oracle reference price for the asset pair
- feeRate: The percentage fee applied to all swaps (e.g., 0.25% = 0.0025)
- amountOut: The deterministic output amount
How Pricing Differs
- vs AMM Math
- vs CLOB Math
- Bolt Math
Traditional AMMs (e.g., x*y=k) compute price from pool state using a bonding curve.
- Price depends on pool depth
- Each trade shifts the curve; quotes become stale instantly
- Slippage increases with trade size relative to liquidity
- Example: swapping 1% of pool liquidity causes visible price movement
- Price is independent of pool depth
- Quotes remain valid as long as oracle price and inventory are unchanged
- No slippage regardless of trade size (until inventory is exhausted)
- Example: swapping 50% of pool inventory has zero slippage if inventory is sufficient
Step-by-Step Price Computation
Oracle Publishes Price
The oracle publishes the current reference price for the asset pair, e.g., 1 USDC = 0.001 BTC. This is updated on-chain periodically and signed by the oracle authority.
Fee Rate Applied
The pool’s configured fee rate is applied to the oracle price. For a 0.25% fee rate, the effective price becomes: oraclePrice × (1 - 0.0025) = oraclePrice × 0.9975.
Inventory Check
The contract checks whether available inventory for the output token is sufficient to settle the calculated amountOut. If inventory is insufficient, the trade is rejected.
Settlement Amount Calculated
The final settlement amount is computed as: amountOut = amountIn × oraclePrice × (1 - feeRate).
Fee Structure
Fee Calculation
Fee Calculation
Fees in Bolt are straightforward and transparent:
- Applied at execution time: Fees are deducted from the oracle price before settlement
- Expressed as a rate: Pools define a fee rate (e.g., 0.0025 for 0.25%)
- Applied symmetrically: Both token A to token B and token B to token A swaps use the same fee rate
- Example: With a 0.25% fee and oracle price of 1.0, the execution price is 0.9975
Precision and Rounding
Decimal Handling
Decimal Handling
Bolt contracts use fixed-point arithmetic to avoid floating-point errors:
- Precision: Prices and amounts are represented with high decimal precision (e.g., 18 decimals)
- Rounding: Amounts are rounded down (in favor of the pool) to prevent dust accumulation
- Test vectors: Always validate against test vectors provided by the Bolt team to ensure precision handling is correct in your off-chain implementation
- SDK integration: The Bolt SDK handles precision automatically; use it for off-chain quoting to avoid manual decimal conversion errors
AVO Price Verification Math
Adaptive Velocity Oracle (AVO) verification
Adaptive Velocity Oracle (AVO) verification
The AVO ensures that Bolt prices reflect best-available market rates through a multi-layer pricing pipeline:
- Multi-venue composite: Prices are derived from depth-weighted composite mid-prices across Gate.io, Binance, OKX, Bybit, and Crypto.com, with staleness filtering (2s max) and outlier rejection (0.3% deviation or 5x median spread)
- Adaptive velocity model: A 6-step EMA velocity model computes log returns, adapts its smoothing rate to both spread width and volatility magnitude, and predicts where price is heading rather than chasing it
- A-S reservation pricing: Fair value is adjusted by net inventory using
fair = oracle - net_delta * gamma * sigma_fast^2 * T, where gamma auto-calibrates daily from 30-second taker markouts - Optimal spread sizing: The half-spread
delta = (gamma * sigma^2 * T)/2 + (1/gamma) * ln(1 + gamma/kappa)adapts to volatility regime (Hot/Normal/Cold via dual EWMA) and fill velocity - No arbitrage at execution: The oracle blends its velocity prediction with the composite mid and clamps movement to a maximum of 0.7% per tick
- Validity proof: The contract verifies that the oracle signature is recent and valid before settlement
Important Notes
For the full mathematical specification, precision constants, and comprehensive test vectors, contact the Bolt team. We provide reference implementations and test data to validate your off-chain quoting logic.
Related Documentation
Off-Chain Quoting
How to implement deterministic off-chain quoting using contract math.
Pool State Indexing
How to track inventory and pool parameters for accurate pricing.