Backtest one range
const url = 'https://api.getchord.xyz/v1/lp/simulate?chain=5042&token=example&lower=1&upper=1&amountUsd=1000&days=7';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.getchord.xyz/v1/lp/simulate?chain=5042&token=example&lower=1&upper=1&amountUsd=1000&days=7'One explicit price range replayed over the last days of candles in the token’s pool: fees earned at the pool’s real tier and the position’s share, impermanent loss, exits, LP value versus hold.
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”Chain id: 5042 Arc · 4663 Robinhood Chain · 143 Monad.
EVM address, hex, case-insensitive.
Lower price, USD.
Upper price, USD (> lower).
A pool: a 20-byte contract address (V2 / V3) or a 32-byte Uniswap V4 pool id.
Responses
Section titled “ Responses ”object
EVM address, hex, case-insensitive.
Unix time, milliseconds — when the server built this answer.
A pool: a 20-byte contract address (V2 / V3) or a 32-byte Uniswap V4 pool id.
Candles replayed.
Times the price left the range.
Why the number should not be trusted, when it should not.
Impermanent loss (negative = loss).
Versus full range.
What that share was measured against: the pool’s in-range liquidity at its price now (V3 / V4 / Raydium CLMM), its active bin (Meteora DLMM), or its TVL counted as if spread over every price when the pool’s depth could not be read (narrow ranges then read high).
Example
{ "shareModel": "liquidity"}Invalid parameters — error names the check that failed (INVALID_PARAMS, BAD_ADDRESS, BAD_LIMIT, BAD_HOURS, …).
Every non-2xx body.
object
Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.
For humans.
HTTP status, when included.
Example
{ "error": "INVALID_PARAMS", "message": "amount must be an integer string in the token's smallest unit"}Nothing at this identity (NOT_FOUND, UNKNOWN_TOKEN, NO_ROUTE).
Every non-2xx body.
object
Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.
For humans.
HTTP status, when included.
Example
{ "error": "INVALID_PARAMS", "message": "amount must be an integer string in the token's smallest unit"}