PearPear

Create a new schedule

Create a new schedule to execute against a position over time

POST
/schedules
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/schedules" \  -H "X-Trade-Account-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6" \  -H "Content-Type: application/json" \  -d '{    "startAt": "string",    "endAt": "string",    "strategy": "TWAP",    "intent": "OPEN",    "executionType": "MARKET",    "legs": [      {        "symbol": "BTC",        "side": "BUY",        "weight": 1      }    ],    "targetNotional": "5000",    "sliceIntervalSec": 15  }'
{  "schedule": {    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",    "connector": "hyperliquid",    "strategy": "TWAP",    "status": "ACTIVE",    "intent": "OPEN",    "positionKey": "string",    "executionType": "MARKET",    "lastSliceAt": "string",    "startAt": "string",    "endAt": "string",    "cancelledAt": "string",    "cancelledReason": "POSITION_CLOSED",    "createdAt": "string",    "updatedAt": "string",    "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"        }      }    ],    "sliceIntervalSec": 0,    "sliceCount": 1,    "randomization": {      "timingJitterBps": 0,      "sizeJitterBps": 0    },    "legs": [      {        "symbol": "BTC",        "side": "BUY",        "weight": 1      }    ],    "targetNotional": "1250.75",    "remainingNotional": "1250.75"  }}