Skip to content
Docs
Open Legend

About

AboutGetting startedWhat is Legend?Why are we building this?Who is this for?

Platform

Web appiOSAndroidTelegram

Trading

TradingOrder typesDeposits and withdrawalsRanks

Capital

Legend CapitalCapital Affiliate Rewards

Autocopy

Copy tradingAutocopyLimits and safeguards

Social

SocialActivityFeedClansChat

Rewards

Referrals and rewards

API reference

Trading APIAuthentication and API keysAPI key actionsOrdersAccount, positions, and fillsLeverage, margin, and TWAPsRate limitsErrors and idempotency

Legend Research

Connect Legend to an AI assistantConnector permissionsMCP tools and order review

Fees

Fees

Support

FAQ
Trade onLEGEND

Trade where legends are made.

Download on theApp StoreGet it onGoogle Play
Product
TradeMobile app
Resources
BlogLearnFAQDocsCareers
© 2026 Legend. All rights reserved.
Privacy policyTerms of service
Ctrl K

Legend documentation

Orders

Request parameters and responses for orders.

View Markdown ↗
API key actionsPreviousAccount, positions, and fillsNext

All paths are relative to the base URL. See authentication and errors and idempotency.

Use status=open to list current exchange orders, including orders placed through the UI. Omitting it lists stored API order history. Open-order cursors are native order IDs; history cursors are Legend UUIDs. Read-only listing does not reconcile every historical order. Retrieve an individual order for reconciliation.

For a price-only modification, the API preserves the order’s current remaining size. Account, market, and side cannot be changed by modification.

Place an order

POST /v1/orders

Requires trading:write and Idempotency-Key.

If the user turned on fat-finger protection in Legend, an order with a value above the limit returns 400 with code fat_finger_limit. The value is size × price. A market trigger uses the trigger price.

Parameters

NameLocationRequiredType
Idempotency-KeyheaderYesstring

Request body

FieldTypeRequiredDetails
accountstringYesFormat: uuid
marketstringYesMax length: 100
sidestringYesbuy, sell
sizestringYesMax length: 40
pricestringYesMax length: 40
time_in_forcestringNogtc, ioc, alo; Default: "gtc"
reduce_onlybooleanNoDefault: false
triggerobjectNo
trigger.pricestringYesMax length: 40
trigger.kindstringYestake_profit, stop_loss
trigger.marketbooleanYes
{
  "account": "00000000-0000-4000-8000-000000000001",
  "market": "BTC",
  "side": "buy",
  "price": "60000",
  "size": "0.001",
  "time_in_force": "gtc",
  "reduce_only": false
}

Example request

curl -X POST "$LEGEND_API_BASE/v1/orders" \
  -H "Authorization: Bearer $LEGEND_API_KEY" \
  -H "Idempotency-Key: UNIQUE_ACTION_KEY" \
  -H "Content-Type: application/json" \
  --data '{"account":"00000000-0000-4000-8000-000000000001","market":"BTC","side":"buy","price":"60000","size":"0.001","time_in_force":"gtc","reduce_only":false}'

Response

FieldTypeRequiredDetails
idstringYesFormat: uuid
objectstringYesorder
accountstringYesFormat: uuid
marketstringYesMax length: 100
sidestringYesbuy, sell
sizestringYesMax length: 40
pricestringYesMax length: 40
time_in_forcestringNogtc, ioc, alo; Default:

See the OpenAPI schema for nested response objects and validation patterns.

Illustrative successful response:

{
  "id": "00000000-0000-4000-8000-000000000002",
  "object": "order",
  "account": "00000000-0000-4000-8000-000000000001",
  "network": "hyperliquid_mainnet",
  "market": "BTC",
  "side": "buy",
  "size": "0.001",
  "price": "60000",
  "time_in_force": "gtc",
  "reduce_only": false,
  "status": "open",
  "exchange_order_id": "123",
  "filled_size": "0",
  "average_price": null,
  "error": null,
  "created_at": "2026-09-19T12:00:00.000Z"
}

List API order history, or current account orders with status=open

GET /v1/orders

Requires trading:read.

Parameters

NameLocationRequiredType
statusqueryNostring
dexqueryNostring; omit for all supported DEXes, xyz for XYZ, or empty for native only
cursorqueryNostring
limitqueryNointeger

Example request

curl "$LEGEND_API_BASE/v1/orders" \
  -H "Authorization: Bearer $LEGEND_API_KEY"

Response

FieldTypeRequiredDetails
objectstringYeslist
dataarrayYes
has_morebooleanYes
next_cursorstring or nullYes

See the OpenAPI schema for nested response objects and validation patterns.

Illustrative successful response:

{
  "object": "list",
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000002",
      "object": "order",
      "account": "00000000-0000-4000-8000-000000000001",
      "network": "hyperliquid_mainnet",
      "market": "BTC",
      "side": "buy",
      "size": "0.001",
      "price": "60000",
      "time_in_force": "gtc",
      "reduce_only": false,
      "status": "open",
      "exchange_order_id": "123",
      "filled_size": "0",
      "average_price": null,
      "error": null,
      "created_at": "2026-09-19T12:00:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Retrieve and reconcile an order

GET /v1/orders/{id}

Requires trading:read.

Parameters

NameLocationRequiredType
idpathYesstring or string

Example request

curl "$LEGEND_API_BASE/v1/orders/ORDER_OR_OPERATION_ID" \
  -H "Authorization: Bearer $LEGEND_API_KEY"

Response

FieldTypeRequiredDetails
idstringYesFormat: uuid
objectstringYesorder
accountstringYesFormat: uuid
marketstringYesMax length: 100
sidestringYesbuy, sell
sizestringYesMax length: 40
pricestringYesMax length: 40
time_in_forcestringNogtc, ioc, alo; Default:

See the OpenAPI schema for nested response objects and validation patterns.

Illustrative successful response:

{
  "id": "00000000-0000-4000-8000-000000000002",
  "object": "order",
  "account": "00000000-0000-4000-8000-000000000001",
  "network": "hyperliquid_mainnet",
  "market": "BTC",
  "side": "buy",
  "size": "0.001",
  "price": "60000",
  "time_in_force": "gtc",
  "reduce_only": false,
  "status": "open",
  "exchange_order_id": "123",
  "filled_size": "0",
  "average_price": null,
  "error": null,
  "created_at": "2026-09-19T12:00:00.000Z"
}

Modify order price, size, or trigger

POST /v1/orders/{id}/modify

Requires trading:write and Idempotency-Key.

Parameters

NameLocationRequiredType
idpathYesstring or string
Idempotency-KeyheaderYesstring

Request body

FieldTypeRequiredDetails
pricestringNoMax length: 40
sizestringNoMax length: 40
triggerobjectNo
trigger.pricestringYesMax length: 40
trigger.kindstringYestake_profit, stop_loss
trigger.marketbooleanYes
{
  "price": "59000"
}

Example request

curl -X POST "$LEGEND_API_BASE/v1/orders/ORDER_OR_OPERATION_ID/modify" \
  -H "Authorization: Bearer $LEGEND_API_KEY" \
  -H "Idempotency-Key: UNIQUE_ACTION_KEY" \
  -H "Content-Type: application/json" \
  --data '{"price":"59000"}'

Response

FieldTypeRequiredDetails
idstringYesFormat: uuid
objectstringYesorder
accountstringYesFormat: uuid
marketstringYesMax length: 100
sidestringYesbuy, sell
sizestringYesMax length: 40
pricestringYesMax length: 40
time_in_forcestringNogtc, ioc, alo; Default:

See the OpenAPI schema for nested response objects and validation patterns.

Illustrative successful response:

{
  "id": "00000000-0000-4000-8000-000000000002",
  "object": "order",
  "account": "00000000-0000-4000-8000-000000000001",
  "network": "hyperliquid_mainnet",
  "market": "BTC",
  "side": "buy",
  "size": "0.001",
  "price": "60000",
  "time_in_force": "gtc",
  "reduce_only": false,
  "status": "open",
  "exchange_order_id": "123",
  "filled_size": "0",
  "average_price": null,
  "error": null,
  "created_at": "2026-09-19T12:00:00.000Z"
}

Cancel an open order

POST /v1/orders/{id}/cancel

Requires trading:write and Idempotency-Key.

Parameters

NameLocationRequiredType
idpathYesstring or string
Idempotency-KeyheaderYesstring

Request body

FieldTypeRequiredDetails
{}

Example request

curl -X POST "$LEGEND_API_BASE/v1/orders/ORDER_OR_OPERATION_ID/cancel" \
  -H "Authorization: Bearer $LEGEND_API_KEY" \
  -H "Idempotency-Key: UNIQUE_ACTION_KEY" \
  -H "Content-Type: application/json" \
  --data '{}'

Response

FieldTypeRequiredDetails
idstringYesFormat: uuid
objectstringYesorder
accountstringYesFormat: uuid
marketstringYesMax length: 100
sidestringYesbuy, sell
sizestringYesMax length: 40
pricestringYesMax length: 40
time_in_forcestringNogtc, ioc, alo; Default:

See the OpenAPI schema for nested response objects and validation patterns.

Illustrative successful response:

{
  "id": "00000000-0000-4000-8000-000000000002",
  "object": "order",
  "account": "00000000-0000-4000-8000-000000000001",
  "network": "hyperliquid_mainnet",
  "market": "BTC",
  "side": "buy",
  "size": "0.001",
  "price": "60000",
  "time_in_force": "gtc",
  "reduce_only": false,
  "status": "canceled",
  "exchange_order_id": "123",
  "filled_size": "0",
  "average_price": null,
  "error": null,
  "created_at": "2026-09-19T12:00:00.000Z"
}

Modification behavior

Hyperliquid’s default modify action requires a non-trigger replacement that does not immediately execute; a GTC replacement is treated as post-only. A rejected replacement can still cancel the original order. Always inspect the returned status and error; the API reconciles the original order rather than assuming it remains open. If that lookup fails, the result is unknown until retrieved and reconciled. Set always_place: true explicitly to permit a trigger or immediately executable replacement. This can place a new order even when cancellation fails; use it only when that behavior is intended. Trigger modifications without this opt-in fail before exchange submission. The default is false; successful default GTC modifications are reported as alo to match Hyperliquid’s effective order type.

Builder fees

Regular perpetual order creation uses Legend’s shared builder-fee configuration (normally 5 bps, subject to existing account overrides). Clients cannot supply their own builder address or fee. Spot uses the same fee rules as the Legend UI; native TWAPs do not support builder fees. Exchange fees are separate from Legend’s builder fee.

The modification body also accepts always_place (boolean, optional, default false). It does not change account, market, side, reduce-only intent, or the server-selected fee configuration.

"gtc"
reduce_onlybooleanNoDefault: false
triggerobjectNo
trigger.pricestringYesMax length: 40
trigger.kindstringYestake_profit, stop_loss
trigger.marketbooleanYes
networkstringYeshyperliquid_mainnet
statusstringYesprocessing, open, filled, canceled, rejected, unknown, waiting_for_trigger
exchange_order_idstring or nullYes
filled_sizestring or nullYes
average_pricestring or nullYes
errorstring or nullYes
created_atstringYes
"gtc"
reduce_onlybooleanNoDefault: false
triggerobjectNo
trigger.pricestringYesMax length: 40
trigger.kindstringYestake_profit, stop_loss
trigger.marketbooleanYes
networkstringYeshyperliquid_mainnet
statusstringYesprocessing, open, filled, canceled, rejected, unknown, waiting_for_trigger
exchange_order_idstring or nullYes
filled_sizestring or nullYes
average_pricestring or nullYes
errorstring or nullYes
created_atstringYes
"gtc"
reduce_onlybooleanNoDefault: false
triggerobjectNo
trigger.pricestringYesMax length: 40
trigger.kindstringYestake_profit, stop_loss
trigger.marketbooleanYes
networkstringYeshyperliquid_mainnet
statusstringYesprocessing, open, filled, canceled, rejected, unknown, waiting_for_trigger
exchange_order_idstring or nullYes
filled_sizestring or nullYes
average_pricestring or nullYes
errorstring or nullYes
created_atstringYes
"gtc"
reduce_onlybooleanNoDefault: false
triggerobjectNo
trigger.pricestringYesMax length: 40
trigger.kindstringYestake_profit, stop_loss
trigger.marketbooleanYes
networkstringYeshyperliquid_mainnet
statusstringYesprocessing, open, filled, canceled, rejected, unknown, waiting_for_trigger
exchange_order_idstring or nullYes
filled_sizestring or nullYes
average_pricestring or nullYes
errorstring or nullYes
created_atstringYes