Set a take-profit / stop-loss alert on a position
const url = 'https://api.getchord.xyz/v1/lp/watch/mark';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"chain":4663,"wallet":"0xb145400da27a2497d9fc2cd5621f2bfd37617af4","manager":"0x58daec3116aae6d93017baaea7749052e8a04fa7","tokenId":"2990642","tpPct":20,"slPct":-15}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Request Bodyrequired
Section titled “Request Bodyrequired”object
EVM address, hex, case-insensitive.
EVM address, hex, case-insensitive.
The position’s id on its manager, decimal.
Above 0, at most 10000.
Between -100 and 0.
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.
Example
{ "chain": 4663, "wallet": "0xb145400da27a2497d9fc2cd5621f2bfd37617af4", "manager": "0x58daec3116aae6d93017baaea7749052e8a04fa7", "tokenId": "2990642", "tpPct": 20, "slPct": -15}Responses
Section titled “ Responses ”object
EVM address, hex, case-insensitive.
object
object
Take-profit: PnL in percent of the dollars that went in, above 0.
Stop-loss: the same, between -100 and 0.
Unix time, seconds, UTC.
Present, and native, when the percent is counted in the chain’s own coin; absent = in dollars.
Example
{ "marks": { "additionalProperty": { "unit": "native" } }}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"}