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
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.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%
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
DAI-WBTC means DAI priced in WBTC
Slippage Calculation Algorithm
The API calculates slippage tolerance based on:- Historical volatility: Price movements over recent time periods
- Liquidity depth: Available liquidity in the market
- 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
- Use recommended slippage: The API’s recommendation balances trade success vs. slippage cost
- Adjust for urgency: Increase slippage for faster execution in volatile markets
- Consider order size: Larger orders may need higher slippage tolerance
- Cache responsibly: Respect cache headers to reduce API load
- Handle errors: Fall back to conservative default (e.g., 1-2%) if API is unavailable