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.
Examplegenerated
{ "chain": 1, "token": "example", "updatedAt": 1, "pool": "example", "dex": "example", "feeBps": 1, "tvlUsd": 1, "days": 1, "hours": 1, "hoursInRange": 1, "inRangePct": 1, "exits": 1, "lower": 1, "upper": 1, "unreliable": "example", "entryPrice": 1, "exitPrice": 1, "priceChangePct": 1, "feesUsd": 1, "lpValueEndUsd": 1, "holdValueEndUsd": 1, "ilUsd": 1, "netVsHoldUsd": 1, "totalReturnUsd": 1, "totalReturnPct": 1, "feeAprPct": 1, "capitalEfficiency": 1, "shareOfPoolPct": 1, "note": "example"}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"}