Skip to main content
This page helps you review the expected output of a trade before you submit it, in the Shield Swap app or with the TypeScript SDK, Python SDK, or CLI.

How quotes work

A quote estimates your output for a chosen pair and input amount. Shield Swap finds a route through the available pools, which can include an intermediate asset when the trade needs more than one pool. You can review the estimate without spending funds. A quote does not reserve liquidity, so the output can change before you submit the swap. Every quote includes a slippage setting. Slippage is how much the price can move between your quote and your trade. In practice, it is the gap between the amount you expect to receive and the least you will accept. If slippage is set too low, the swap can fail when the price moves. If it is set too high, you can receive less than you expected. At 1% slippage, a quote for 100 USDCx can settle for as little as 99.

Discover pools

Pool discovery helps you find markets for the asset you want to trade. A listed pool may have no active liquidity or have trading disabled; requesting a quote checks whether a route is available for your amount.Prerequisites: Your authenticated mainnet clients from Setup: client for TypeScript, dex for Python, or a configured CLI profile. You do not need a funded account to discover pools.These examples find pools containing USDCx:
pools contains the matching entries, each with a pool key and the token IDs token0 and token1.This request inspects up to 50 pools, starting at offset 0. Check page.pagination and increase offset to read subsequent pages if you need a complete list.

Look up token details

Token metadata lets you display a symbol and format amounts with the correct decimal precision. This example looks up both tokens in the first matching pool:
Each result includes symbol and decimals, such as token0.symbol and token0.decimals.

Check pool availability

A pool needs active liquidity and permission to trade. Continue with selectedPool from the token lookup to check both on chain:
hasLiquidity checks liquidity at the current price. controls.tradeable checks whether the pool is enabled and whether global, token, or pair pauses block trading. canTrade is true only when both checks pass.
These checks help you exclude unavailable pools. API data can lag behind the chain, and liquidity or trading controls can change before your swap executes.

Request a quote

You choose the asset to sell, the asset to receive, and the input amount. The SDK finds the route for you, so you do not need to select a pool from the discovery results.Prerequisites: Your authenticated mainnet client, dex, or CLI profile from Setup. The SDKs can quote an unfunded account. The CLI checks your holdings while preparing the trade, so fund your account before using its example.These examples quote 1 USDCx for ETH on mainnet. The slippage setting is 50 basis points (0.5%), which determines the minimum output you’ll accept if the price changes before execution.
expectedOutput and minimumOutput are decimal strings in ETH units. Use them to compare the estimate with the least you’re willing to receive. The quote retains the amounts as base-unit bigint values and lists its route in quote.hops.quote.expiresAt gives the expiry time in Unix milliseconds. Request a new quote if it expires before you submit the swap.

Next Steps

Submit a swap

Once you’re ready to trade, follow Swap to submit the quote and claim the output.

Run packaged examples

The TypeScript examples and Python examples take you through account setup, funding, and a complete swap. Follow the Quickstart commands to run them. Both examples submit and claim a 1.5 USDCx swap on testnet.