Skip to main content

Market Endpoints

Endpoints for retrieving market data and slippage tolerance recommendations for trading pairs.

Get Slippage Tolerance

Retrieves the recommended slippage tolerance for a trading pair based on market volatility. Endpoint: GET /{chainId}/markets/{baseTokenAddress}-{quoteTokenAddress}/slippageTolerance

Path Parameters

  • chainId (string, required): The blockchain network ID (e.g., 1, 100, 11155111)
  • baseTokenAddress (string, required): Currency that is being bought or sold (the token you’re trading)
  • quoteTokenAddress (string, required): Currency in which the price of the base token is quoted (the token you’re trading for)

Query Parameters (Optional)

Response

Code Examples

Response Example

This response indicates a recommended slippage tolerance of 0.5% (50 basis points).

Get Volatility Details (Internal)

Endpoint: GET /{chainId}/markets/{baseTokenAddress}-{quoteTokenAddress}/volatilityDetails
This endpoint is marked as hide: true in the API schema and is intended for internal debugging purposes. It may not be available in production environments.
Retrieves detailed volatility information for both tokens in a trading pair.

Notes

Understanding Basis Points

Basis points (bps) are a unit of measure used in finance to describe percentages:
  • 1 basis point = 0.01%
  • 100 basis points = 1%
  • 10,000 basis points = 100%
Common slippage values:

Market Notation

The market is specified as {base}-{quote} where:
  • Base token: The asset you’re trading (buying or selling)
  • Quote token: The asset used to price the base token
Example: DAI-WBTC means DAI priced in WBTC

Slippage Calculation Algorithm

The API calculates slippage tolerance based on:
  1. Historical volatility: Price movements over recent time periods
  2. Liquidity depth: Available liquidity in the market
  3. Market conditions: Current market volatility metrics

Caching

Slippage tolerance responses are cached for 120 seconds (2 minutes):

Order-Specific Slippage

For more accurate slippage recommendations, include optional query parameters:

Error Handling

Best Practices

  1. Use recommended slippage: The API’s recommendation balances trade success vs. slippage cost
  2. Adjust for urgency: Increase slippage for faster execution in volatile markets
  3. Consider order size: Larger orders may need higher slippage tolerance
  4. Cache responsibly: Respect cache headers to reduce API load
  5. Handle errors: Fall back to conservative default (e.g., 1-2%) if API is unavailable
Last modified on March 4, 2026