Skip to main content
Bolt’s pricing and execution logic is fully deterministic given the current pool state and oracle price. This allows integrators to simulate amountIn to amountOut off-chain without issuing repeated on-chain quote calls, and get identical results to what the Outpost would return on-chain.
Bolt quotes are deterministic. Given the same pool state and oracle price, the output is identical on-chain and off-chain. This eliminates quote staleness and enables batch route evaluation at scale.

Why this model is different

Traditional AMMs derive price from a bonding curve where every trade moves the price. A quote becomes stale the moment another trade executes, because the curve has shifted. Bolt’s prop-AMM references an external oracle instead, so trade size does not affect the quoted price and quotes remain stable across consecutive trades. This has three practical consequences for integrators: No gas overhead. Simulate routes without paying transaction costs. The math is reproducible locally. No MEV exposure. Off-chain quotes are not broadcast on-chain, eliminating front-running risk during route evaluation. Batch efficiency. Test hundreds of routes in parallel. Because each quote is a pure function of pool state and oracle price, there is no interaction between simulations.

The quoting flow

1

Index pool state

Cache the current inventory, fee parameters, and pool thresholds for each Bolt pool. Pool state changes infrequently between swaps, so local caching is effective.
2

Fetch oracle price

Obtain the current oracle price for the asset pair. This is the authoritative reference for all settlement math.
3

Apply contract math

Compute amountOut using the oracle price, fee rate, and inventory constraints. See Contract Math for the full formula.
4

Evaluate inventory

Confirm that available pool inventory is sufficient to settle the requested amountIn. If insufficient, the quote is not executable.
5

Return quote

The deterministic amountOut is valid as long as pool state and oracle price remain unchanged.

SDK shortcut: simulateSwap()

For integrations that don’t need to implement the full contract math locally, the SDK’s simulateSwap() method performs a deterministic dry run with no gas cost.
import { BoltSuiClient } from '@bolt-liquidity-hq/sui-client';

const client = new BoltSuiClient();

const simulation = await client.simulateSwap({
  assetIn: '0x2::sui::SUI',
  amountIn: '1000000000', // 1 SUI (9 decimals)
  assetOut: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',
});

console.log(`Expected output: ${simulation.amountOut}`);
console.log(`Protocol fee: ${simulation.protocolFee}`);
console.log(`LP fee: ${simulation.lpFee}`);
console.log(`Total fees: ${simulation.totalFees}`);
Use simulateSwap() for single-pair checks and UI price displays. Reserve the full off-chain math implementation for batch route evaluation across many pools and pairs simultaneously.

State freshness

Pool state changes when swaps execute or when pool parameters are updated. For most integrations, refreshing every 10 to 15 seconds provides a good balance between accuracy and RPC efficiency. For high-frequency applications, use WebSocket subscriptions to the Outpost contract if your RPC provider supports them.
Every oracle price includes an expiryTime field (Unix timestamp in nanoseconds). Always check that the price has not expired before using it in your local math. The SDK’s getOracleConfig() method returns the priceExpireTime setting so you can anticipate refresh intervals.
For high-value trades, re-check pool inventory immediately before on-chain submission. Setting minimumAmountOut on the swap call provides a safety net against state changes between simulation and execution.

Reference materials

The contract math formulas and reference test vectors are distributed directly by the Bolt team to ensure they stay in sync with the live Outpost. Contact the team or book a call to obtain the latest version.

Contract Math

Oracle-anchored pricing formulas and fee calculations.

Pool State Indexing

How to index and subscribe to Outpost state changes.