Skip to content

Backtest one range

GET
/lp/simulate
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.

chain
required
integer
Allowed values: 5042 4663 143

Chain id: 5042 Arc · 4663 Robinhood Chain · 143 Monad.

token
required

EVM address, hex, case-insensitive.

string
/^0x[a-fA-F0-9]{40}$/
lower
required
number
> 0

Lower price, USD.

upper
required
number

Upper price, USD (> lower).

amountUsd
number
default: 1000 >= 1
days
integer
default: 7 >= 1 <= 30
pool

A pool: a 20-byte contract address (V2 / V3) or a 32-byte Uniswap V4 pool id.

string
/^0x([a-fA-F0-9]{40}|[a-fA-F0-9]{64})$/
Media typeapplication/json
object
chain
integer
token

EVM address, hex, case-insensitive.

string
/^0x[a-fA-F0-9]{40}$/
updatedAt

Unix time, milliseconds — when the server built this answer.

integer
pool

A pool: a 20-byte contract address (V2 / V3) or a 32-byte Uniswap V4 pool id.

string
/^0x([a-fA-F0-9]{40}|[a-fA-F0-9]{64})$/
dex
string
feeBps
number | null
tvlUsd
number | null
days
integer
hours

Candles replayed.

integer
hoursInRange
integer
inRangePct
number
exits

Times the price left the range.

integer
lower
number
upper
number
unreliable

Why the number should not be trusted, when it should not.

string | null
entryPrice
number
exitPrice
number
priceChangePct
number
feesUsd
number
lpValueEndUsd
number
holdValueEndUsd
number
ilUsd

Impermanent loss (negative = loss).

number
netVsHoldUsd
number
totalReturnUsd
number
totalReturnPct
number
feeAprPct
number
capitalEfficiency

Versus full range.

number
shareOfPoolPct
number
note
string
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, …).

Media typeapplication/json

Every non-2xx body.

object
error
required

Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.

string
message

For humans.

string
statusCode

HTTP status, when included.

integer
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).

Media typeapplication/json

Every non-2xx body.

object
error
required

Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.

string
message

For humans.

string
statusCode

HTTP status, when included.

integer
Example
{
"error": "INVALID_PARAMS",
"message": "amount must be an integer string in the token's smallest unit"
}