PearPear

Create a new ladder

Create a ladder order as a parent with child trigger rungs.

POST
/ladders
x-api-key<token>

In: header

Header Parameters

X-Trade-Account-Id*string

UUID of the trade account the request acts on. Must belong to the authenticated user.

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/ladders" \  -H "X-Trade-Account-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6" \  -H "Content-Type: application/json" \  -d '{    "type": "MARKET",    "intent": "OPEN",    "condition": {      "type": "ratio",      "data": {        "priceSource": "mid",        "symbol_a": "BTC",        "symbol_b": "BTC",        "track": "PEAK"      }    },    "config": {      "thresholdStart": 1,      "thresholdEnd": 1,      "levels": 2    },    "payload": {      "type": "MARKET",      "legs": [        {          "symbol": "BTC",          "side": "BUY",          "mode": "QUANTITY",          "amount": "1250.75"        }      ]    }  }'
{  "ladder": {    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",    "connector": "hyperliquid",    "positionKey": "string",    "config": {      "thresholdStart": 1,      "thresholdEnd": 1,      "levels": 2,      "weighting": "EQUAL"    },    "status": "ACTIVE",    "attachTriggers": [      {        "intent": "CLOSE",        "type": "MARKET",        "bracketType": "TAKE_PROFIT",        "condition": {          "type": "notional",          "data": {            "priceSource": "mid",            "threshold": 1          }        }      }    ],    "triggers": [      {        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",        "tradeAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",        "connector": "hyperliquid",        "status": "ACTIVE",        "ladderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",        "ladderIndex": -9007199254740991,        "parentTriggerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",        "triggeredAt": "string",        "cancelledAt": "string",        "cancelledReason": "POSITION_CLOSED",        "fills": [          {            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",            "cloid": "string",            "exchangeFillId": "string",            "status": "PROVISIONAL",            "tradeAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",            "symbol": "BTC",            "positionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",            "connector": "hyperliquid",            "side": "BUY",            "reduceOnly": true,            "isExternal": true,            "synthetic": true,            "quantity": "string",            "price": "string",            "usd": "string",            "tradeFee": "string",            "pearFee": "string",            "timestamp": "string",            "original": {              "exchangeFillId": "string",              "quantity": "string"            }          }        ],        "bracketType": "STOP_LOSS",        "semanticBracketType": "STOP_LOSS",        "createdAt": "string",        "updatedAt": "string",        "intent": "OPEN",        "type": "MARKET",        "condition": {          "type": "ratio",          "data": {            "priceSource": "mid",            "symbol_a": "BTC",            "symbol_b": "BTC",            "track": "PEAK",            "threshold": 0          }        },        "context": {          "type": "MARKET",          "legs": [            {              "symbol": "BTC",              "side": "BUY",              "mode": "QUANTITY",              "amount": "1250.75"            }          ],          "attachedTriggers": [            {              "kind": "STATIC",              "bracketType": "TAKE_PROFIT"            }          ]        }      }    ],    "createdAt": "string",    "updatedAt": "string"  }}