Skip to main content
A type-safe CosmWasm client for interacting with Bolt’s zero slippage execution layer on Archway. Query oracle prices, inspect pool state, simulate swaps off-chain, and execute trades programmatically.

Quickstart

1

Prerequisites

Before using the SDK, make sure you have:
  • Node.js 18+ installed
  • An Archway-compatible wallet (Keplr, Leap, etc.) for signing transactions
  • Access to Archway RPC endpoints (the client uses https://rpc.mainnet.archway.io for mainnet and https://rpc.constantine.archway.io for testnet by default)
2

Installation

3

Initialize the Bolt client

The SDK supports different environments:
4

Query all assets

5

Execute a swap


API

Client initialization

Environment configurationOverride chain configurationOverride Outpost contract addressesOverride native token denominationOverride assets configuration
Override clients

Get oracle config

getOracleConfig() retrieves the current configuration settings from the Bolt Oracle smart contract on Archway. This configuration governs how price feeds are managed, including update thresholds, expiration times, and administrative settings.
Usage example

Query prices and assets

getAssets() retrieves all unique assets available in the Bolt execution layer by querying oracle asset pairs and enriching them with additional metadata from the client’s asset configuration.
Usage example

getAllOracleAssetPairs() queries the oracle smart contract to retrieve all supported asset pairs with automatic pagination. Each asset pair represents a base/quote relationship that can be used for price queries and swaps.
Usage example

getAllPrices() queries the oracle smart contract to retrieve all available price feeds with automatic pagination. More efficient than making multiple individual price queries when you need prices for multiple pairs.
Usage example

getPrice() queries the oracle smart contract to retrieve the current price for a specific asset pair. Fetches the latest price feed that is updated by authorized price feeders and validated against configured thresholds.
Usage example

Verify pool liquidity

getPoolBaseLiquidity() queries the router smart contract to retrieve the total base asset liquidity for a specific pool. Fetches current liquidity levels for the base asset in the specified pool.
Usage example

getAllBaseAssetsLiquidity() queries the router smart contract to retrieve the base asset liquidity across all pools. Fetches current liquidity levels for all the base assets in their respective pools.
Usage example

Get Router contract config

getRouterConfig() queries the router smart contract to retrieve its current configuration settings. The Router is the entry-point contract unique to the Archway deployment that governs how swaps are executed, fees are collected, and new pools are deployed.
Usage example

Get liquidity pools information

getAllPools() queries the router smart contract to retrieve information about all deployed pools with automatic pagination. Fetches a comprehensive list of all pools in the Bolt execution layer on Archway.
Usage example

getPoolConfig() retrieves the configuration settings of a liquidity pool contract. Queries the contract to fetch its current configuration parameters, including fees, LP settings, and oracle integration.
Usage example

getPoolByDenom() queries the router smart contract to retrieve pool information for a specific base asset on Archway. Fetches pool details for the pool matching the provided asset denomination.
Usage example

getPoolConfigByDenom() retrieves pool configuration by base asset denomination. This is a convenience function that combines pool lookup and configuration retrieval.
Usage example

Simulate a swap

simulateSwap() simulates a swap operation to calculate the expected output amount without executing the transaction. Performs a dry run that takes into account current pool conditions, oracle prices, and fees. Use this for accurate estimates before executing.
Usage example

Execute a swap

swap() executes a token swap transaction on the Bolt execution layer through the router contract. It performs a “swap exact in” operation where you specify exactly how much of the input asset to swap, and receive a variable amount of the output asset based on current pool conditions.
Usage examples

Best practices


Error handling


Archway Outpost Addresses

Contract addresses for mainnet and testnet.

Contract Math

Understand the pricing formula behind simulateSwap().

Pool State Indexing

Index pool state for real-time integration.

Contact The Team

Questions about routing, integration, or execution strategy? Reach out.