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
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.
Fetch oracle price
Obtain the current oracle price for the asset pair. This is the authoritative reference for all settlement math.
Apply contract math
Compute
amountOut using the oracle price, fee rate, and inventory constraints. See Contract Math for the full formula.Evaluate inventory
Confirm that available pool inventory is sufficient to settle the requested
amountIn. If insufficient, the quote is not executable.SDK shortcut: simulateSwap()
For integrations that don’t need to implement the full contract math locally, the SDK’ssimulateSwap() method performs a deterministic dry run with no gas cost.
State freshness
When to refresh pool state
When to refresh pool state
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.
Oracle price expiry
Oracle price expiry
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.Re-validating before submission
Re-validating before submission
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
Contract Math
Oracle-anchored pricing formulas and fee calculations.
Pool State Indexing
How to index and subscribe to Outpost state changes.