Skip to main content

Endpoint

POST /exchange

Description

Supports both single modify ("modify") and batch modify ("batchModify").

Request Body

ParameterTypeDescription
action*objectSee below
action.type*string"modify" or "batchModify"
action.oidstring | numberOrder id for single modify
action.orderobjectNew order fields for single modify
action.modifiesarrayBatch modify list
action.modifies[].oid*string | numberInternal Notional order id
action.modifies[].order*objectNew order fields
action.order.p*stringNew price, or "0" for market
action.order.s*stringNew total order size
action.order.rbooleanOptional reduce-only override
action.order.t*objectOrder type config; must match immutable trigger/TIF properties
nonce*numberReplay-protection nonce
expiresAfternumberOptional expiration timestamp in ms
signature*objectEIP-712 signature

Response

The server echoes the incoming action type:
{
  "status": "ok",
  "response": {
    "type": "batchModify",
    "data": {
      "statuses": [
        { "resting": { "oid": "0x1a2b3c..." } },
        { "pending": { "cloid": "0x4d5e6f..." } }
      ]
    }
  },
  "metadata": {
    "results": [
      {
        "oid": "0x1a2b3c...",
        "status": "confirmed",
        "orderId": "0x1a2b3c...",
        "venueOid": 12345
      },
      {
        "oid": "0x4d5e6f...",
        "status": "pending",
        "orderId": "0x4d5e6f..."
      }
    ]
  }
}

Status Variants

Response statusMeaning
resting.oidVenue confirmed the modify
pending.cloidModify was submitted but venue confirmation timed out
errorValidation, reducer, or venue failure

Example Request

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 batch size is 20 modifies. - s is the total desired order size, not remaining size. - Asset, side, trigger kind, and TIF are immutable and must stay compatible with the original order.