Skip to content

Set a take-profit / stop-loss alert on a position

POST
/lp/watch/mark
curl --request POST \
--url https://api.getchord.xyz/v1/lp/watch/mark \
--header 'Content-Type: application/json' \
--data '{ "chain": 4663, "wallet": "0xb145400da27a2497d9fc2cd5621f2bfd37617af4", "manager": "0x58daec3116aae6d93017baaea7749052e8a04fa7", "tokenId": "2990642", "tpPct": 20, "slPct": -15 }'

A mark on one open position: when its PnL (percent of the dollars that went in, live value and fees included) crosses the take-profit or the stop-loss, one alert goes to the wallet’s inbox and linked Telegram chats with a link to the position, and the mark is removed. It is an alert, not an order: nothing is signed or closed for the wallet. Both values null removes the mark. The wallet is watched from then on; positions are checked every two minutes. A mark with unit: "native" waits (it never falls back to dollars) while the chain has no figures in its coin.

Media typeapplication/json
object
chain
required
integer
Allowed values: 5042 4663 143
wallet
required

EVM address, hex, case-insensitive.

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

EVM address, hex, case-insensitive.

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

The position’s id on its manager, decimal.

string
tpPct

Above 0, at most 10000.

number | null
slPct

Between -100 and 0.

number | null
unit

native = count the percent in the chain’s own coin: what went in and what the position is worth now, both in ETH / MON (native of GET /lp/position). The coin moving against the dollar then crosses nothing. Default usd.

string
Allowed values: usd native
Example
{
"chain": 4663,
"wallet": "0xb145400da27a2497d9fc2cd5621f2bfd37617af4",
"manager": "0x58daec3116aae6d93017baaea7749052e8a04fa7",
"tokenId": "2990642",
"tpPct": 20,
"slPct": -15
}
Media typeapplication/json
object
chain
integer
wallet

EVM address, hex, case-insensitive.

string
/^0x[a-fA-F0-9]{40}$/
marks
object
key
additional properties
object
tpPct

Take-profit: PnL in percent of the dollars that went in, above 0.

number | null
slPct

Stop-loss: the same, between -100 and 0.

number | null
at

Unix time, seconds, UTC.

integer
unit

Present, and native, when the percent is counted in the chain’s own coin; absent = in dollars.

string
Allowed values: native
Example
{
"marks": {
"additionalProperty": {
"unit": "native"
}
}
}

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"
}