Skip to main content

Endpoint

POST /exchange

Description

Modify an existing open order. Supports single modify (type: "modify") or batch modify (type: "batchModify").

Request Body

ParameterTypeDescription
action*objectSee below
action.type*stringMust be "modify" or "batchModify"
action.oidstring | numberInternal order ID (single modify only)
action.orderobjectModified order fields (single modify only)
action.modifiesarrayBatch modify list (batch modify only)
action.modifies[].oid*string | numberInternal order ID
action.modifies[].order*objectModified order fields
action.order.p*stringNew limit price (use "0" for market orders)
action.order.s*stringNew total order size (not remaining size)
action.order.rbooleanReduce-only flag (optional)
action.order.t*objectOrder type config (must match original TIF/trigger type)
action.order.t.limit.tifstringTime-in-force: "Gtc", "Alo", "Ioc"
action.order.t.trigger.isMarketbooleantrue for stop-market, false for stop-limit
action.order.t.trigger.triggerPxstringTrigger price for stop orders
action.order.t.trigger.tpslstring"tp" (take profit) or "sl" (stop loss)
nonce*numberTimestamp in milliseconds for replay protection
expiresAfternumberOptional expiration timestamp (ms)
signature*objectEIP-712 signature (r, s, v)

Response

{
  "status": "ok",
  "response": {
    "type": "modify",
    "data": {
      "statuses": [
        { "resting": { "oid": "0x1a2b3c..." } }
      ]
    }
  },
  "metadata": {
    "results": [
      { "oid": "0x1a2b3c...", "status": "committed", "orderId": "0x1a2b3c..." }
    ]
  }
}

Example Request (Single)

curl -X POST https://api.notional.xyz/exchange \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "type": "modify",
      "oid": "0x1a2b3c4d5e6f7890...",
      "order": {
        "p": "50500.0",
        "s": "0.2",
        "r": false,
        "t": { "limit": { "tif": "Gtc" } }
      }
    },
    "nonce": 1701234567890,
    "signature": {
      "r": "0x1234...",
      "s": "0x5678...",
      "v": 27
    }
  }'

Notes

  • Maximum 20 modifies per request
  • s represents the total order size, not remaining size
  • Asset, side, and TIF are immutable and must match the original order