Crypto.com Exchange Spot Skill
Spot request on Crypto.com Exchange using authenticated API endpoints. Requires API key and secret key for private endpoints. Return the result in JSON format.
Quick Reference
| Endpoint |
Method |
Description |
Required |
Optional |
Authentication |
public/get-instruments (GET) |
GET |
List all supported instruments |
None |
None |
No |
public/get-book (GET) |
GET |
Order book for an instrument |
instrument_name, depth |
None |
No |
public/get-candlestick (GET) |
GET |
Candlestick/OHLCV data |
instrument_name |
timeframe, count, start_ts, end_ts |
No |
public/get-trades (GET) |
GET |
Recent public trades |
instrument_name |
count, start_ts, end_ts |
No |
public/get-tickers (GET) |
GET |
Ticker information |
None |
instrument_name |
No |
public/get-valuations (GET) |
GET |
Valuation data (index/mark price) |
instrument_name, valuation_type |
count, start_ts, end_ts |
No |
public/get-expired-settlement-price (GET) |
GET |
Expired settlement prices |
instrument_type |
page (must be ≥1) |
No |
public/get-insurance (GET) |
GET |
Insurance fund balance |
instrument_name |
count, start_ts, end_ts |
No |
public/get-announcements (GET) |
GET |
Exchange announcements (base: https://api.crypto.com/v1/) |
None |
category, product_type |
No |
public/get-risk-parameters (GET) |
GET |
Risk parameters for margin |
None |
None |
No |
private/create-order (POST) |
POST |
Place a new order |
instrument_name, side, type |
price, quantity, notional, client_oid, exec_inst, time_in_force, spot_margin, stp_scope, stp_inst, stp_id, fee_instrument_name, isolation_id, leverage, isolated_margin_amount |
Yes |
private/create-order-list (POST) |
POST |
Batch order creation (1-10, LIST only) |
contingency_type, order_list |
Per-order params |
Yes |
private/amend-order (POST) |
POST |
Modify an existing order |
new_price, new_quantity |
order_id, orig_client_oid, client_oid |
Yes |
private/cancel-order (POST) |
POST |
Cancel a single order |
order_id or client_oid |
None |
Yes |
private/cancel-order-list (POST) |
POST |
Batch cancel orders |
contingency_type, order_list |
None |
Yes |
private/cancel-all-orders (POST) |
POST |
Cancel all orders |
None |
instrument_name, type |
Yes |
private/close-position (POST) |
POST |
Close an open position |
instrument_name, type |
price, quantity, isolation_id |
Yes |
private/get-open-orders (POST) |
POST |
List ALL active open orders |
None |
instrument_name |
Yes |
private/get-order-detail (POST) |
POST |
Query specific order |
order_id or client_oid |
None |
Yes |
private/get-order-history (POST) |
POST |
Historical orders |
None |
instrument_name, start_time, end_time, limit, isolation_id |
Yes |
private/get-trades (POST) |
POST |
Account trade list |
None |
instrument_name, start_time, end_time, limit, isolation_id |
Yes |
private/get-transactions (POST) |
POST |
Transaction journal (trading, settlement, funding) |
None |
instrument_name, journal_type, start_time, end_time, limit, isolation_id |
Yes |
private/user-balance (POST) |
POST |
Current wallet balances |
None |
None |
Yes |
private/user-balance-history (POST) |
POST |
Historical balance snapshots |
None |
timeframe, end_time, limit |
Yes |
private/get-accounts (POST) |
POST |
Master/sub-account info |
None |
page_size, page |
Yes |
private/get-subaccount-balances (POST) |
POST |
All sub-account balances |
None |
None |
Yes |
private/get-positions (POST) |
POST |
Active positions |
None |
instrument_name |
Yes |
private/create-subaccount-transfer (POST) |
POST |
Transfer between accounts |
from, to, currency, amount |
None |
Yes |
private/get-fee-rate (POST) |
POST |
Trading fee structure |
None |
None |
Yes |
private/get-instrument-fee-rate (POST) |
POST |
Fee rate by instrument |
instrument_name |
None |
Yes |
private/change-account-leverage (POST) |
POST |
Adjust account leverage |
account_id, leverage |
None |
Yes |
private/change-account-settings (POST) |
POST |
Update account settings |
None |
stp_scope, stp_inst, stp_id, leverage |
Yes |
private/get-account-settings (POST) |
POST |
Retrieve account config |
None |
None |
Yes |
private/create-withdrawal (POST) |
POST |
Create a withdrawal |
currency, amount, address |
client_wid, address_tag, network_id |
Yes |
private/get-deposit-address (POST) |
POST |
Get deposit address |
currency |
None |
Yes |
private/get-currency-networks (POST) |
POST |
Get currency network info |
None |
None |
Yes |
private/get-deposit-history (POST) |
POST |
Get deposit history |
None |
currency, start_ts, end_ts, page_size, page, status |
Yes |
private/get-withdrawal-history (POST) |
POST |
Get withdrawal history |
None |
currency, start_ts, end_ts, page_size, page, status |
Yes |
private/advanced/create-order (POST) |
POST |
Create trigger/stop/TP order |
instrument_name, side, type, quantity |
price, ref_price, client_oid, time_in_force, exec_inst, stp_scope, stp_inst, stp_id, fee_instrument_name |
Yes |
private/advanced/create-oco (POST) |
POST |
Create OCO order (2 orders) |
order_list (2 orders) |
Per-order params |
Yes |
private/advanced/cancel-oco (POST) |
POST |
Cancel OCO order |
list_id |
None |
Yes |
private/advanced/create-oto (POST) |
POST |
Create OTO order (2 orders) |
order_list (2 orders) |
Per-order params |
Yes |
private/advanced/cancel-oto (POST) |
POST |
Cancel OTO order |
list_id |
None |
Yes |
private/advanced/create-otoco (POST) |
POST |
Create OTOCO order (3 orders) |
order_list (3 orders) |
Per-order params |
Yes |
private/advanced/cancel-otoco (POST) |
POST |
Cancel OTOCO order |
list_id |
None |
Yes |
private/advanced/cancel-order (POST) |
POST |
Cancel individual OTO/OTOCO leg |
order_id or client_oid |
None |
Yes |
private/advanced/cancel-all-orders (POST) |
POST |
Cancel all advanced orders |
None |
instrument_name, type |
Yes |
private/advanced/get-open-orders (POST) |
POST |
List open advanced orders |
None |
instrument_name |
Yes |
private/advanced/get-order-detail (POST) |
POST |
Query advanced order detail |
order_id or client_oid |
None |
Yes |
private/advanced/get-order-history (POST) |
POST |
Advanced order history |
None |
instrument_name, start_time, end_time, limit |
Yes |
Parameters
Common Parameters
- instrument_name: Instrument name. Spot pairs use underscore format (e.g.,
BTC_USD, ETH_USDT, CRO_USD). Case-sensitive — btc_usd will not work
- side: Order side —
BUY or SELL
- type: Order type —
LIMIT or MARKET
- quantity: Order quantity (string, e.g.,
"0.01")
- notional: Order value in quote currency (for MARKET BUY orders, use instead of quantity)
- price: Limit price (string, required for LIMIT orders, e.g.,
"50000.00")
- client_oid: Optional client-assigned order ID (max 36 characters)
- time_in_force: Order duration policy
- exec_inst: Execution instructions (array)
- stp_scope: Self-trade prevention scope
- stp_inst: Self-trade prevention instruction
- stp_id: Self-trade prevention ID (0 to 32767)
- fee_instrument_name: Instrument to use for fee payment
- spot_margin:
SPOT (default) or MARGIN
- isolation_id: Isolated margin position ID
- leverage: Leverage multiplier
- isolated_margin_amount: Amount for isolated margin
- depth: Order book depth. Must be ≥1 (e.g., 10, 50, 150). No hard upper limit — returns available levels
- timeframe: Candlestick interval
- count: Number of results to return. Max: 300 for candlestick, 150 for public trades. Min: 1 (0 → error 40004)
- start_ts: Start timestamp in Unix ms (used for public endpoints and wallet history)
- end_ts: End timestamp in Unix ms (used for public endpoints and wallet history)
- start_time: Start time in Unix time format, inclusive (used for trading history endpoints —
get-order-history, get-trades, get-transactions). Nanosecond recommended for accurate pagination
- end_time: End time in Unix time format, exclusive (used for trading history endpoints). Nanosecond recommended for accurate pagination
- limit: Maximum number of records. Default: 100. Max: 100 (for trading history endpoints)
- page_size: Results per page. Default: 20. Max: 200. Only works on wallet history endpoints (
get-deposit-history, get-withdrawal-history). Ignored on trading endpoints (get-order-history, get-trades, get-open-orders) — use limit instead
- page: Page number (0-based)
- new_price: New price for amend-order (required, must always be provided even if unchanged)
- new_quantity: New quantity for amend-order (required, must always be provided even if unchanged)
- orig_client_oid: Original client order ID for amend-order (alternative to order_id)
- ref_price: Trigger/reference price for advanced orders (used with STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT)
- ref_price_type: Reference price type — only
MARK_PRICE supported for OCO/OTO/OTOCO trigger legs
- contingency_type:
LIST for batch orders via create-order-list (OCO/OTO/OTOCO are NOT supported on this endpoint — returns 140001 API_DISABLED). Use private/advanced/create-oco, create-oto, create-otoco instead
- order_list: Array of order objects for batch/advanced order creation
- list_id: ID for OCO/OTO/OTOCO order groups (returned on creation, used for cancellation)
- leg_id: Leg identifier within OTO/OTOCO (1, 2, or 3)
Wallet Parameters
- currency: Currency symbol (e.g.,
BTC, CRO, USDT)
- amount: Amount as string (e.g.,
"1")
- address: Withdrawal destination address
- address_tag: Secondary address identifier for coins like XRP, XLM (also known as memo or tag)
- network_id: Desired network for withdrawal. Must be whitelisted first. See
get-currency-networks for values
- client_wid: Optional client withdrawal ID
- status: Filter by status. Deposit:
0 (Not Arrived), 1 (Arrived), 2 (Failed), 3 (Pending). Withdrawal: 0 (Pending), 1 (Processing), 2 (Rejected), 3 (Payment In-progress), 4 (Payment Failed), 5 (Completed), 6 (Cancelled)
- journal_type: Transaction journal type filter. Values:
TRADING, SESSION_SETTLE, FUNDING, etc.
Request Envelope Parameters (all requests)
- id: Request identifier (integer, 0 to 9,223,372,036,854,775,807)
- method: API endpoint name (e.g.,
"private/create-order")
- nonce: Current timestamp in milliseconds
- params: Parameters object (can be empty
{})
- api_key: Your API key (private methods only)
- sig: Digital signature (private methods only)
Enums
- type (order): LIMIT | MARKET
- side: BUY | SELL
- time_in_force: GOOD_TILL_CANCEL | IMMEDIATE_OR_CANCEL | FILL_OR_KILL
- exec_inst: POST_ONLY | SMART_POST_ONLY | ISOLATED_MARGIN (array, POST_ONLY and SMART_POST_ONLY cannot coexist)
- stp_scope: M (master or sub account) | S (sub account only)
- stp_inst: M (cancel maker) | T (cancel taker) | B (cancel both)
- spot_margin: SPOT | MARGIN
- timeframe (candlestick): 1m | 5m | 15m | 30m | 1h | 2h | 4h | 6h | 12h | 1D | 7D | 14D | 1M (legacy formats also accepted: M1, M5, M15, M30, H1, H2, H4, H12, D1, D7, D14)
- instrument_type: PERPETUAL_SWAP | FUTURE
- valuation_type: INDEX_PRICE | MARK_PRICE (context-dependent)
- contingency_type: LIST (batch) | OTO | OTOCO (in responses)
- type (advanced order): STOP_LOSS | STOP_LIMIT | TAKE_PROFIT | TAKE_PROFIT_LIMIT
- ref_price_type: MARK_PRICE
- order status (advanced open): NEW | PENDING | ACTIVE
- order status (advanced history): REJECTED | CANCELED | FILLED | EXPIRED
Important Notes
- Must be strings:
price, quantity, notional, ref_price, amount, new_price, new_quantity — order/amount params must be strings (e.g., "0.01" not 0.01). Sending as number returns errors: price → 308, quantity → 40101, notional → 50001, ref_price → 229
- Must be numbers:
limit, end_time (on user-balance-history) — must be integers. Sending limit as string returns error 40003 on get-order-history, get-trades, get-transactions, user-balance-history, advanced/get-order-history
- Accept both:
page, page_size, count, depth, start_time, end_time (on trading history), start_ts, end_ts
Production Validation Notes
- FAR_AWAY_LIMIT_PRICE (315): Limit orders with prices too far from market are rejected (e.g., BUY BTC @ $1 or SELL BTC @ $999,999). Keep limit prices within a reasonable range of current market price
- Expired settlement page:
public/get-expired-settlement-price requires page >= 1. Sending page=0 returns error 40004. Omitting page entirely works (returns first page)
- Withdrawal whitelist:
private/create-withdrawal requires the destination address to be whitelisted in your Exchange withdrawal settings (not App). Non-whitelisted addresses return error 5000811 (WITHDRAW_ADDRESS_NOT_IN_WHITE_LIST)
- Withdrawal amount is gross:
amount includes the fee. If you send amount: "11" and the network fee is 1, the recipient gets 10. The response shows amount: 10 and fee: 1
- Withdrawal network_id: For multi-chain tokens (USDC, USDT, etc.), always specify
network_id. Without it, the API may reject or pick an unexpected default chain
- MARKET order + price: MARKET orders ignore
price if provided (no error). For MARKET BUY, use notional. For MARKET SELL, use quantity
- POST_ONLY on MARKET: Returns error 43005 (POST_ONLY_REJ). POST_ONLY only works with LIMIT orders
- FOK/IOC on far-from-market LIMIT:
FILL_OR_KILL and IMMEDIATE_OR_CANCEL on limit orders far from market will immediately reject (43003/43004) since they can't fill
- amend-order requires both: Both
new_price AND new_quantity must always be provided (even if one is unchanged). Omitting either returns 40004
- Batch order max:
create-order-list accepts maximum 10 orders. 11+ returns 40004
- HTTP methods are strict: Public endpoints accept GET only (POST → 50001). Private endpoints accept POST only (GET → 40003)
- Amend cancelled/filled order: Returns 212 (INVALID_ORDERID). Can only amend ACTIVE orders
- Unknown params are silently ignored: Extra/unknown keys in
params don't cause errors
- Inverted time range:
start_time > end_time does NOT error — the API appears to ignore ordering and returns data anyway
- cancel-all-orders scopes by instrument: Only cancels orders for the specified
instrument_name. Other instruments' orders are untouched
- Multiple STOP orders on same instrument: Allowed — no limit on concurrent trigger orders per instrument
- OTO second leg must be trigger order: The contingent (second) leg of an OTO must be STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, or TAKE_PROFIT_LIMIT — not a plain LIMIT. Using LIMIT for the second leg returns 40004
- OTOCO structure: Leg 1 = primary LIMIT order, Leg 2 = take-profit trigger, Leg 3 = stop-loss trigger. Legs 2 and 3 must be trigger order types
- MARKET BUY with both notional + quantity:
quantity takes priority over notional. If the quantity is below minimum, you get error 415 even if notional would be valid
- get-open-orders has NO pagination:
page, page_size, count, and limit params are all ignored — returns ALL open orders regardless
- get-order-history/get-trades pagination:
limit works correctly. page/page_size are ignored (always returns up to limit, default 100). Use start_time/end_time for windowed queries
- Nonce accepts int or string — float is rejected (40101).
id must be a number (string → 40001)
- Candlestick count max 300: Requesting more silently caps at 300.
count=0 returns 40004. Min is 1
- Public trades count max 150: Requesting more silently caps at 150
- get-instruments has no server-side filtering:
inst_type, currency, and other filter params are ignored — always returns ALL instruments (852+). Filter client-side
- order_id format: Always a numeric string (e.g.,
"6530219599901000701"). Returned as string, accepted as string or number
- spot_margin values: Only
"SPOT" or "MARGIN" are valid. Invalid values → 50001. "MARGIN" requires margin access (error 416 without it)
- get-valuations requires both params: Must provide
instrument_name AND valuation_type (only mark_price works for spot pairs; index_price → 40004). Without valuation_type → 40003
- get-insurance requires instrument_name: Not optional — omitting returns 40003
- Candlestick valid timeframes:
1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1D, 7D, 14D, 1M. Legacy format also works: M1, M5, M15, M30, H1, H2, H4, H12, D1, D7, D14. Invalid timeframes (e.g., 2m, 8h, 3D) return 40003
- Trading history endpoints (
get-order-history, get-trades, get-transactions) use start_time/end_time with nanosecond precision recommended
- Wallet history endpoints (
get-deposit-history, get-withdrawal-history) use start_ts/end_ts in milliseconds
notional is used instead of quantity for MARKET BUY orders (specifies spend amount in quote currency)
- For MARKET SELL orders, use
quantity (amount of base currency to sell)
- If you omit all parameters, you still need to pass an empty params block
params: {} for API request consistency
Advanced Order Management API
Advanced order types (trigger orders, OCO, OTO, OTOCO) are managed through the private/advanced/* endpoints. These are Spot-only for now.
private/advanced/create-order
Creates a trigger order (STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT).
STOP_LIMIT and TAKE_PROFIT_LIMIT execute a LIMIT order when ref_price is reached
STOP_LOSS and TAKE_PROFIT execute a MARKET order when ref_price is reached
Trigger direction:
ref_price below market: SELL STOP_LOSS/STOP_LIMIT, BUY TAKE_PROFIT/TAKE_PROFIT_LIMIT
ref_price above market: BUY STOP_LOSS/STOP_LIMIT, SELL TAKE_PROFIT/TAKE_PROFIT_LIMIT
| Param |
Type |
Required |
Description |
| instrument_name |
string |
Y |
e.g., BTC_USD |
| side |
string |
Y |
BUY, SELL |
| type |
string |
Y |
STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT |
| price |
string |
Depends |
For STOP_LIMIT and TAKE_PROFIT_LIMIT only: limit price (e.g., "0.12") |
| quantity |
string |
Y |
Order quantity (e.g., "10") |
| ref_price |
string |
N |
Trigger price (e.g., "0.12") |
| client_oid |
string |
N |
Client order ID (max 36 chars) |
| time_in_force |
string |
N |
GOOD_TILL_CANCEL (default), FILL_OR_KILL, IMMEDIATE_OR_CANCEL |
| exec_inst |
array |
N |
POST_ONLY, SMART_POST_ONLY (cannot coexist) |
| stp_scope |
string |
N |
M (master/sub) or S (sub only) |
| stp_inst |
string |
N* |
M (cancel maker), T (cancel taker), B (cancel both). Required if stp_scope is set |
| stp_id |
string |
N |
0 to 32767 |
| fee_instrument_name |
string |
N |
Preferred fee token |
{
"id": 6573,
"method": "private/advanced/create-order",
"params": {
"instrument_name": "CRO_USD",
"side": "SELL",
"type": "STOP_LIMIT",
"quantity": "10",
"price": "0.12",
"ref_price": "0.12",
"client_oid": "c5f682ed-7108-4f1c-b755-972fcdca0f02"
}
}
Response: { "order_id": "5755600460443882762", "client_oid": "..." }
private/advanced/create-oco
Creates a One-Cancels-the-Other order. When one leg is partially/fully executed, the other is automatically canceled. Exactly 2 orders required: one LIMIT + one trigger (STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, or TAKE_PROFIT_LIMIT).
| Param |
Type |
Required |
Description |
| order_list |
array |
Y |
Exactly 2 orders. One must be LIMIT, other must be a trigger type |
Each order in order_list follows private/create-order params. For ref_price_type of the trigger order, only MARK_PRICE is supported.
{
"method": "private/advanced/create-oco",
"id": 123456789,
"nonce": 123456789000,
"params": {
"order_list": [
{
"instrument_name": "BTC_USD",
"quantity": "0.1",
"type": "LIMIT",
"price": "93000",
"side": "SELL"
},
{
"instrument_name": "BTC_USD",
"quantity": "0.1",
"type": "STOP_LOSS",
"ref_price": "80000",
"side": "SELL"
}
]
}
}
Response: { "list_id": 6498090546073120100 }
private/advanced/create-oto
Creates a One-Triggers-the-Other order. When the first order (LIMIT) is fully executed, the second order (trigger) takes effect. Exactly 2 orders required. The trigger order must be on the opposite side of the working LIMIT order (e.g., BUY LIMIT + SELL STOP_LOSS, or SELL LIMIT + BUY STOP_LOSS).
| Param |
Type |
Required |
Description |
| order_list |
array |
Y |
Exactly 2 orders. One LIMIT + one trigger type. Trigger must be opposite side |
{
"method": "private/advanced/create-oto",
"id": 123456789,
"nonce": 123456789000,
"params": {
"order_list": [
{
"instrument_name": "BTC_USD",
"quantity": "0.1",
"type": "LIMIT",
"price": "93000",
"side": "BUY"
},
{
"instrument_name": "BTC_USD",
"quantity": "0.1",
"type": "STOP_LOSS",
"ref_price": "80000",
"side": "SELL"
}
]
}
}
Response: { "list_id": 6498090546073120100 }
private/advanced/create-otoco
Creates a One-Triggers-a-One-Cancels-the-Other order. When the first LIMIT order is fully executed, two trigger orders take effect. When either trigger executes, the other is canceled. Exactly 3 orders required: one LIMIT + one STOP_LOSS/STOP_LIMIT + one TAKE_PROFIT/TAKE_PROFIT_LIMIT. The trigger orders must be on the opposite side of the working LIMIT order.
| Param |
Type |
Required |
Description |
| order_list |
array |
Y |
Exactly 3 orders. One LIMIT + one stop + one take-profit. Triggers must be opposite side |
{
"method": "private/advanced/create-otoco",
"id": 123456789,
"nonce": 123456789000,
"params": {
"order_list": [
{
"instrument_name": "BTC_USD",
"quantity": "0.1",
"type": "LIMIT",
"price": "93000",
"side": "BUY"
},
{
"instrument_name": "BTC_USD",
"quantity": "0.1",
"type": "STOP_LOSS",
"ref_price": "80000",
"side": "SELL"
},
{
"instrument_name": "BTC_USD",
"quantity": "0.1",
"type": "TAKE_PROFIT",
"ref_price": "108000",
"side": "SELL"
}
]
}
}
Response: { "list_id": 6498090546073120100 }
private/advanced/cancel-oco, cancel-oto, cancel-otoco
Cancel an OCO/OTO/OTOCO order group.
| Param |
Type |
Required |
Description |
| list_id |
string |
Y |
List ID returned from create |
{ "method": "private/advanced/cancel-oco", "id": 1234, "nonce": 123456789000, "params": { "list_id": "4421958062479290999" } }
private/advanced/cancel-order
Cancel an individual leg of an OTO/OTOCO order.
| Param |
Type |
Required |
Description |
| order_id |
number or string |
Depends |
Either order_id or client_oid must be present. String format recommended |
| client_oid |
string |
Depends |
Either order_id or client_oid must be present |
private/advanced/cancel-all-orders
Cancel all advanced orders for an instrument.
| Param |
Type |
Required |
Description |
| instrument_name |
string |
N |
e.g., BTC_USD. Omit to cancel ALL instruments |
| type |
string |
N |
LIMIT, TRIGGER, or ALL |
private/advanced/get-open-orders
Get all open advanced orders.
| Param |
Type |
Required |
Description |
| instrument_name |
string |
N |
e.g., BTC_USD. Omit for all |
Response fields per order: account_id, order_id, client_oid, order_type, time_in_force, side, exec_inst, quantity, limit_price, order_value, maker_fee_rate, taker_fee_rate, avg_price, cumulative_quantity, cumulative_value, cumulative_fee, status (NEW/PENDING/ACTIVE), order_date, instrument_name, fee_instrument_name, list_id, contingency_type (OTO/OTOCO), leg_id, create_time, create_time_ns, update_time
private/advanced/get-order-detail
Get details for a specific advanced order.
| Param |
Type |
Required |
Description |
| order_id |
number or string |
Depends |
String format recommended |
| client_oid |
string |
Depends |
Either order_id or client_oid required |
Response fields: Same as get-open-orders, with status including: NEW, PENDING, REJECTED, ACTIVE, CANCELED, FILLED
private/advanced/get-order-history
Get historical advanced orders.
| Param |
Type |
Required |
Description |
| instrument_name |
string |
N |
Omit for all |
| start_time |
number or string |
N |
Unix timestamp (ns recommended). Default: end_time - 1 day |
| end_time |
number or string |
N |
Unix timestamp (ns recommended). Default: current time |
| limit |
int |
N |
Max results. Default: 100, Max: 100 |
Note: If you omit all parameters, you still need to pass params: {} for API request consistency.
Response fields: Same as get-open-orders, with status including: REJECTED, CANCELED, FILLED, EXPIRED
Note: To detect partial fills, check for status ACTIVE with cumulative_quantity > 0.
Wallet API
private/create-withdrawal
Creates a withdrawal request. Withdrawal setting must be enabled for your API Key. Withdrawal addresses must first be whitelisted in your account's Withdrawal Whitelist page.
| Param |
Type |
Required |
Description |
| currency |
string |
Y |
e.g., BTC, CRO, USDT |
| amount |
string |
Y |
Gross amount to withdraw (fee is deducted from this). e.g., "11" with fee=1 sends 10 to destination |
| address |
string |
Y |
Destination address. Must be whitelisted in Exchange withdrawal settings |
| client_wid |
string |
N |
Optional client withdrawal ID (max 36 chars) |
| address_tag |
string |
N |
Secondary identifier for XRP, XLM, etc. (memo/tag) |
| network_id |
string |
N |
Network for multi-chain tokens (e.g., "ARB", "ETH", "SOL"). Strongly recommended for multi-chain currencies — use get-currency-networks to list available networks and fees |
private/get-deposit-address
Get deposit addresses for a currency.
| Param |
Type |
Required |
Description |
| currency |
string |
Y |
e.g., BTC, CRO |
private/get-currency-networks
Get all supported currency networks including withdrawal fees, minimum amounts, and deposit/withdrawal status.
No required parameters (pass empty params: {}).
private/get-deposit-history
| Param |
Type |
Required |
Description |
| currency |
string |
N |
e.g., BTC, CRO |
| start_ts |
long |
N |
Default: 90 days from current timestamp |
| end_ts |
long |
N |
Default: current timestamp |
| page_size |
int |
N |
Page size (Default: 20, Max: 200) |
| page |
int |
N |
Page number (0-based) |
| status |
string |
N |
0 (Not Arrived), 1 (Arrived), 2 (Failed), 3 (Pending) |
Note: Works for master account only, not for sub-accounts.
private/get-withdrawal-history
| Param |
Type |
Required |
Description |
| currency |
string |
N |
e.g., BTC, CRO |
| start_ts |
long |
N |
Default: 90 days from current timestamp |
| end_ts |
long |
N |
Default: current timestamp |
| page_size |
int |
N |
Page size (Default: 20, Max: 200) |
| page |
int |
N |
Page number (0-based) |
| status |
string |
N |
0 (Pending), 1 (Processing), 2 (Rejected), 3 (Payment In-progress), 4 (Payment Failed), 5 (Completed), 6 (Cancelled) |
Note: Works for master account only, not for sub-accounts.
Authentication
For endpoints that require authentication (all private/ methods), you will need to provide Crypto.com Exchange API credentials.
Required credentials:
- apiKey: Your Crypto.com Exchange API key (for request identification and header)
- secretKey: Your Crypto.com Exchange API secret (for HMAC-SHA256 signing)
Base URLs:
| Environment |
REST API |
User WebSocket |
Market WebSocket |
| Production |
https://api.crypto.com/exchange/v1/{method} |
wss://stream.crypto.com/exchange/v1/user |
wss://stream.crypto.com/exchange/v1/market |
| UAT Sandbox |
https://uat-api.3ona.co/exchange/v1/{method} |
wss://uat-stream.3ona.co/exchange/v1/user |
wss://uat-stream.3ona.co/exchange/v1/market |
Rate Limits
| Endpoint Type |
Limit |
private/create-order, private/cancel-order, private/cancel-all-orders |
15 requests per 100ms each |
private/get-order-detail |
30 requests per 100ms |
private/get-trades |
1 request per second |
private/get-order-history |
1 request per second |
| All other private REST |
3 requests per 100ms each |
Public market data (get-book, get-tickers, get-trades, etc.) |
100 requests per second each (per IP) |
| User API WebSocket |
150 requests per second |
| Market Data WebSocket |
100 requests per second |
Open Order Limits
| Condition |
Limit |
| Max open orders per trading pair per account/subaccount |
200 |
| Max open orders across all pairs per account/subaccount |
1000 |
Security
Share Credentials
Users can provide Crypto.com Exchange API credentials by sending a file where the content is in the following format:
abc123...xyz
secret123...key
Never Display Full Secrets
When showing credentials to users:
- API Key: Show first 5 + last 4 characters:
dG9rZ...8akf
- Secret Key: Always mask, show only last 5:
***...ws1eK
Example response when asked for credentials:
Account: main
API Key: dG9rZ...8akf
Secret: ***...ws1eK
Environment: Production
Listing Accounts
When listing accounts, show names and environment only — never keys:
Crypto.com Exchange Accounts:
* main (Production)
* sandbox-dev (UAT Sandbox)
Transactions in Production
When performing transactions in production, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.
Crypto.com Exchange Accounts
main
- API Key: your_production_api_key
- Secret: your_production_secret
- Sandbox: false
sandbox-dev
- API Key: your_sandbox_api_key
- Secret: your_sandbox_secret
- Sandbox: true
TOOLS.md Structure
## Crypto.com Exchange Accounts
### main
- API Key: abc123...xyz
- Secret: secret123...key
- Sandbox: false
- Description: Primary trading account
### sandbox-dev
- API Key: test456...abc
- Secret: testsecret...xyz
- Sandbox: true
- Description: Development/testing
Agent Behavior
- Credentials requested: Mask secrets (show last 5 chars only)
- Listing accounts: Show names and environment, never keys
- Account selection: Ask if ambiguous, default to main
- When doing a transaction in production, confirm with user before by asking to write "CONFIRM" to proceed
- New credentials: Prompt for name, environment
- Order params (
price, quantity, notional, ref_price, amount) must be strings. limit must be a number. page/page_size accept both
- Always include
Content-Type: application/json header
Adding New Accounts
When user provides new credentials:
- Ask for account name
- Ask: Production or UAT Sandbox
- Store in
TOOLS.md with masked display confirmation
Signing Requests
All private endpoints require HMAC-SHA256 signature.
Signature Process
- Sort
params keys in ascending alphabetical order
- Concatenate all param keys and values into a single string (no delimiters):
key1value1key2value2...
- For arrays: the key appears once, then each element's sorted key+value pairs are concatenated directly (no array indices)
- For
None/null values: use the string "null"
- Recursion depth is limited to 3 levels
- Build the signing payload:
{method}{id}{api_key}{param_string}{nonce}
- HMAC-SHA256 hash the payload using your secret key, output as hex string
- Include
sig in the request body
User Agent Header
Include User-Agent header with the following string: crypto-com-exchange/1.0.1 (Skill)
See references/authentication.md for implementation details.
1---2name: crypto-com-exchange3description: Crypto.com Exchange Spot request using the Crypto.com Exchange API. Authentication requires API key and secret key. Supports production and UAT sandbox.4license: MIT5---67# Crypto.com Exchange Spot Skill89Spot request on Crypto.com Exchange using authenticated API endpoints. Requires API key and secret key for private endpoints. Return the result in JSON format.1011## Quick Reference1213| Endpoint | Method | Description | Required | Optional | Authentication |14|----------|--------|-------------|----------|----------|----------------|15| `public/get-instruments` (GET) | GET | List all supported instruments | None | None | No |16| `public/get-book` (GET) | GET | Order book for an instrument | instrument_name, depth | None | No |17| `public/get-candlestick` (GET) | GET | Candlestick/OHLCV data | instrument_name | timeframe, count, start_ts, end_ts | No |18| `public/get-trades` (GET) | GET | Recent public trades | instrument_name | count, start_ts, end_ts | No |19| `public/get-tickers` (GET) | GET | Ticker information | None | instrument_name | No |20| `public/get-valuations` (GET) | GET | Valuation data (index/mark price) | instrument_name, valuation_type | count, start_ts, end_ts | No |21| `public/get-expired-settlement-price` (GET) | GET | Expired settlement prices | instrument_type | page (must be ≥1) | No |22| `public/get-insurance` (GET) | GET | Insurance fund balance | instrument_name | count, start_ts, end_ts | No |23| `public/get-announcements` (GET) | GET | Exchange announcements (base: `https://api.crypto.com/v1/`) | None | category, product_type | No |24| `public/get-risk-parameters` (GET) | GET | Risk parameters for margin | None | None | No |25| `private/create-order` (POST) | POST | Place a new order | instrument_name, side, type | price, quantity, notional, client_oid, exec_inst, time_in_force, spot_margin, stp_scope, stp_inst, stp_id, fee_instrument_name, isolation_id, leverage, isolated_margin_amount | Yes |26| `private/create-order-list` (POST) | POST | Batch order creation (1-10, LIST only) | contingency_type, order_list | Per-order params | Yes |27| `private/amend-order` (POST) | POST | Modify an existing order | new_price, new_quantity | order_id, orig_client_oid, client_oid | Yes |28| `private/cancel-order` (POST) | POST | Cancel a single order | order_id or client_oid | None | Yes |29| `private/cancel-order-list` (POST) | POST | Batch cancel orders | contingency_type, order_list | None | Yes |30| `private/cancel-all-orders` (POST) | POST | Cancel all orders | None | instrument_name, type | Yes |31| `private/close-position` (POST) | POST | Close an open position | instrument_name, type | price, quantity, isolation_id | Yes |32| `private/get-open-orders` (POST) | POST | List ALL active open orders | None | instrument_name | Yes |33| `private/get-order-detail` (POST) | POST | Query specific order | order_id or client_oid | None | Yes |34| `private/get-order-history` (POST) | POST | Historical orders | None | instrument_name, start_time, end_time, limit, isolation_id | Yes |35| `private/get-trades` (POST) | POST | Account trade list | None | instrument_name, start_time, end_time, limit, isolation_id | Yes |36| `private/get-transactions` (POST) | POST | Transaction journal (trading, settlement, funding) | None | instrument_name, journal_type, start_time, end_time, limit, isolation_id | Yes |37| `private/user-balance` (POST) | POST | Current wallet balances | None | None | Yes |38| `private/user-balance-history` (POST) | POST | Historical balance snapshots | None | timeframe, end_time, limit | Yes |39| `private/get-accounts` (POST) | POST | Master/sub-account info | None | page_size, page | Yes |40| `private/get-subaccount-balances` (POST) | POST | All sub-account balances | None | None | Yes |41| `private/get-positions` (POST) | POST | Active positions | None | instrument_name | Yes |42| `private/create-subaccount-transfer` (POST) | POST | Transfer between accounts | from, to, currency, amount | None | Yes |43| `private/get-fee-rate` (POST) | POST | Trading fee structure | None | None | Yes |44| `private/get-instrument-fee-rate` (POST) | POST | Fee rate by instrument | instrument_name | None | Yes |45| `private/change-account-leverage` (POST) | POST | Adjust account leverage | account_id, leverage | None | Yes |46| `private/change-account-settings` (POST) | POST | Update account settings | None | stp_scope, stp_inst, stp_id, leverage | Yes |47| `private/get-account-settings` (POST) | POST | Retrieve account config | None | None | Yes |48| `private/create-withdrawal` (POST) | POST | Create a withdrawal | currency, amount, address | client_wid, address_tag, network_id | Yes |49| `private/get-deposit-address` (POST) | POST | Get deposit address | currency | None | Yes |50| `private/get-currency-networks` (POST) | POST | Get currency network info | None | None | Yes |51| `private/get-deposit-history` (POST) | POST | Get deposit history | None | currency, start_ts, end_ts, page_size, page, status | Yes |52| `private/get-withdrawal-history` (POST) | POST | Get withdrawal history | None | currency, start_ts, end_ts, page_size, page, status | Yes |53| `private/advanced/create-order` (POST) | POST | Create trigger/stop/TP order | instrument_name, side, type, quantity | price, ref_price, client_oid, time_in_force, exec_inst, stp_scope, stp_inst, stp_id, fee_instrument_name | Yes |54| `private/advanced/create-oco` (POST) | POST | Create OCO order (2 orders) | order_list (2 orders) | Per-order params | Yes |55| `private/advanced/cancel-oco` (POST) | POST | Cancel OCO order | list_id | None | Yes |56| `private/advanced/create-oto` (POST) | POST | Create OTO order (2 orders) | order_list (2 orders) | Per-order params | Yes |57| `private/advanced/cancel-oto` (POST) | POST | Cancel OTO order | list_id | None | Yes |58| `private/advanced/create-otoco` (POST) | POST | Create OTOCO order (3 orders) | order_list (3 orders) | Per-order params | Yes |59| `private/advanced/cancel-otoco` (POST) | POST | Cancel OTOCO order | list_id | None | Yes |60| `private/advanced/cancel-order` (POST) | POST | Cancel individual OTO/OTOCO leg | order_id or client_oid | None | Yes |61| `private/advanced/cancel-all-orders` (POST) | POST | Cancel all advanced orders | None | instrument_name, type | Yes |62| `private/advanced/get-open-orders` (POST) | POST | List open advanced orders | None | instrument_name | Yes |63| `private/advanced/get-order-detail` (POST) | POST | Query advanced order detail | order_id or client_oid | None | Yes |64| `private/advanced/get-order-history` (POST) | POST | Advanced order history | None | instrument_name, start_time, end_time, limit | Yes |6566---6768## Parameters6970### Common Parameters7172* **instrument_name**: Instrument name. Spot pairs use underscore format (e.g., `BTC_USD`, `ETH_USDT`, `CRO_USD`). **Case-sensitive** — `btc_usd` will not work73* **side**: Order side — `BUY` or `SELL`74* **type**: Order type — `LIMIT` or `MARKET`75* **quantity**: Order quantity (string, e.g., `"0.01"`)76* **notional**: Order value in quote currency (for MARKET BUY orders, use instead of quantity)77* **price**: Limit price (string, required for LIMIT orders, e.g., `"50000.00"`)78* **client_oid**: Optional client-assigned order ID (max 36 characters)79* **time_in_force**: Order duration policy80* **exec_inst**: Execution instructions (array)81* **stp_scope**: Self-trade prevention scope82* **stp_inst**: Self-trade prevention instruction83* **stp_id**: Self-trade prevention ID (0 to 32767)84* **fee_instrument_name**: Instrument to use for fee payment85* **spot_margin**: `SPOT` (default) or `MARGIN`86* **isolation_id**: Isolated margin position ID87* **leverage**: Leverage multiplier88* **isolated_margin_amount**: Amount for isolated margin89* **depth**: Order book depth. Must be ≥1 (e.g., 10, 50, 150). No hard upper limit — returns available levels90* **timeframe**: Candlestick interval91* **count**: Number of results to return. Max: 300 for candlestick, 150 for public trades. Min: 1 (0 → error 40004)92* **start_ts**: Start timestamp in Unix ms (used for public endpoints and wallet history)93* **end_ts**: End timestamp in Unix ms (used for public endpoints and wallet history)94* **start_time**: Start time in Unix time format, inclusive (used for trading history endpoints — `get-order-history`, `get-trades`, `get-transactions`). Nanosecond recommended for accurate pagination95* **end_time**: End time in Unix time format, exclusive (used for trading history endpoints). Nanosecond recommended for accurate pagination96* **limit**: Maximum number of records. Default: 100. Max: 100 (for trading history endpoints)97* **page_size**: Results per page. Default: 20. Max: 200. **Only works on wallet history endpoints** (`get-deposit-history`, `get-withdrawal-history`). Ignored on trading endpoints (`get-order-history`, `get-trades`, `get-open-orders`) — use `limit` instead98* **page**: Page number (0-based)99* **new_price**: New price for amend-order (required, must always be provided even if unchanged)100* **new_quantity**: New quantity for amend-order (required, must always be provided even if unchanged)101* **orig_client_oid**: Original client order ID for amend-order (alternative to order_id)102* **ref_price**: Trigger/reference price for advanced orders (used with STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT)103* **ref_price_type**: Reference price type — only `MARK_PRICE` supported for OCO/OTO/OTOCO trigger legs104* **contingency_type**: `LIST` for batch orders via `create-order-list` (OCO/OTO/OTOCO are **NOT** supported on this endpoint — returns 140001 API_DISABLED). Use `private/advanced/create-oco`, `create-oto`, `create-otoco` instead105* **order_list**: Array of order objects for batch/advanced order creation106* **list_id**: ID for OCO/OTO/OTOCO order groups (returned on creation, used for cancellation)107* **leg_id**: Leg identifier within OTO/OTOCO (1, 2, or 3)108109### Wallet Parameters110111* **currency**: Currency symbol (e.g., `BTC`, `CRO`, `USDT`)112* **amount**: Amount as string (e.g., `"1"`)113* **address**: Withdrawal destination address114* **address_tag**: Secondary address identifier for coins like XRP, XLM (also known as memo or tag)115* **network_id**: Desired network for withdrawal. Must be whitelisted first. See `get-currency-networks` for values116* **client_wid**: Optional client withdrawal ID117* **status**: Filter by status. Deposit: `0` (Not Arrived), `1` (Arrived), `2` (Failed), `3` (Pending). Withdrawal: `0` (Pending), `1` (Processing), `2` (Rejected), `3` (Payment In-progress), `4` (Payment Failed), `5` (Completed), `6` (Cancelled)118* **journal_type**: Transaction journal type filter. Values: `TRADING`, `SESSION_SETTLE`, `FUNDING`, etc.119120### Request Envelope Parameters (all requests)121122* **id**: Request identifier (integer, 0 to 9,223,372,036,854,775,807)123* **method**: API endpoint name (e.g., `"private/create-order"`)124* **nonce**: Current timestamp in milliseconds125* **params**: Parameters object (can be empty `{}`)126* **api_key**: Your API key (private methods only)127* **sig**: Digital signature (private methods only)128129### Enums130131* **type** (order): LIMIT | MARKET132* **side**: BUY | SELL133* **time_in_force**: GOOD_TILL_CANCEL | IMMEDIATE_OR_CANCEL | FILL_OR_KILL134* **exec_inst**: POST_ONLY | SMART_POST_ONLY | ISOLATED_MARGIN (array, POST_ONLY and SMART_POST_ONLY cannot coexist)135* **stp_scope**: M (master or sub account) | S (sub account only)136* **stp_inst**: M (cancel maker) | T (cancel taker) | B (cancel both)137* **spot_margin**: SPOT | MARGIN138* **timeframe** (candlestick): 1m | 5m | 15m | 30m | 1h | 2h | 4h | 6h | 12h | 1D | 7D | 14D | 1M (legacy formats also accepted: M1, M5, M15, M30, H1, H2, H4, H12, D1, D7, D14)139* **instrument_type**: PERPETUAL_SWAP | FUTURE140* **valuation_type**: INDEX_PRICE | MARK_PRICE (context-dependent)141* **contingency_type**: LIST (batch) | OTO | OTOCO (in responses)142* **type** (advanced order): STOP_LOSS | STOP_LIMIT | TAKE_PROFIT | TAKE_PROFIT_LIMIT143* **ref_price_type**: MARK_PRICE144* **order status** (advanced open): NEW | PENDING | ACTIVE145* **order status** (advanced history): REJECTED | CANCELED | FILLED | EXPIRED146147### Important Notes148149* **Must be strings**: `price`, `quantity`, `notional`, `ref_price`, `amount`, `new_price`, `new_quantity` — order/amount params must be strings (e.g., `"0.01"` not `0.01`). Sending as number returns errors: `price` → 308, `quantity` → 40101, `notional` → 50001, `ref_price` → 229150* **Must be numbers**: `limit`, `end_time` (on `user-balance-history`) — must be integers. Sending `limit` as string returns error 40003 on `get-order-history`, `get-trades`, `get-transactions`, `user-balance-history`, `advanced/get-order-history`151* **Accept both**: `page`, `page_size`, `count`, `depth`, `start_time`, `end_time` (on trading history), `start_ts`, `end_ts`152153### Production Validation Notes154155* **FAR_AWAY_LIMIT_PRICE (315)**: Limit orders with prices too far from market are rejected (e.g., BUY BTC @ $1 or SELL BTC @ $999,999). Keep limit prices within a reasonable range of current market price156* **Expired settlement page**: `public/get-expired-settlement-price` requires `page >= 1`. Sending `page=0` returns error 40004. Omitting `page` entirely works (returns first page)157* **Withdrawal whitelist**: `private/create-withdrawal` requires the destination address to be whitelisted in your **Exchange** withdrawal settings (not App). Non-whitelisted addresses return error 5000811 (WITHDRAW_ADDRESS_NOT_IN_WHITE_LIST)158* **Withdrawal amount is gross**: `amount` includes the fee. If you send `amount: "11"` and the network fee is 1, the recipient gets 10. The response shows `amount: 10` and `fee: 1`159* **Withdrawal network_id**: For multi-chain tokens (USDC, USDT, etc.), always specify `network_id`. Without it, the API may reject or pick an unexpected default chain160* **MARKET order + price**: MARKET orders ignore `price` if provided (no error). For MARKET BUY, use `notional`. For MARKET SELL, use `quantity`161* **POST_ONLY on MARKET**: Returns error 43005 (POST_ONLY_REJ). POST_ONLY only works with LIMIT orders162* **FOK/IOC on far-from-market LIMIT**: `FILL_OR_KILL` and `IMMEDIATE_OR_CANCEL` on limit orders far from market will immediately reject (43003/43004) since they can't fill163* **amend-order requires both**: Both `new_price` AND `new_quantity` must always be provided (even if one is unchanged). Omitting either returns 40004164* **Batch order max**: `create-order-list` accepts maximum 10 orders. 11+ returns 40004165* **HTTP methods are strict**: Public endpoints accept **GET only** (POST → 50001). Private endpoints accept **POST only** (GET → 40003)166* **Amend cancelled/filled order**: Returns 212 (INVALID_ORDERID). Can only amend ACTIVE orders167* **Unknown params are silently ignored**: Extra/unknown keys in `params` don't cause errors168* **Inverted time range**: `start_time` > `end_time` does NOT error — the API appears to ignore ordering and returns data anyway169* **cancel-all-orders scopes by instrument**: Only cancels orders for the specified `instrument_name`. Other instruments' orders are untouched170* **Multiple STOP orders on same instrument**: Allowed — no limit on concurrent trigger orders per instrument171* **OTO second leg must be trigger order**: The contingent (second) leg of an OTO must be STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, or TAKE_PROFIT_LIMIT — not a plain LIMIT. Using LIMIT for the second leg returns 40004172* **OTOCO structure**: Leg 1 = primary LIMIT order, Leg 2 = take-profit trigger, Leg 3 = stop-loss trigger. Legs 2 and 3 must be trigger order types173* **MARKET BUY with both notional + quantity**: `quantity` takes priority over `notional`. If the quantity is below minimum, you get error 415 even if notional would be valid174* **get-open-orders has NO pagination**: `page`, `page_size`, `count`, and `limit` params are all ignored — returns ALL open orders regardless175* **get-order-history/get-trades pagination**: `limit` works correctly. `page`/`page_size` are **ignored** (always returns up to `limit`, default 100). Use `start_time`/`end_time` for windowed queries176* **Nonce accepts int or string** — float is rejected (40101). `id` must be a number (string → 40001)177* **Candlestick count max 300**: Requesting more silently caps at 300. `count=0` returns 40004. Min is 1178* **Public trades count max 150**: Requesting more silently caps at 150179* **get-instruments has no server-side filtering**: `inst_type`, `currency`, and other filter params are ignored — always returns ALL instruments (852+). Filter client-side180* **order_id format**: Always a numeric string (e.g., `"6530219599901000701"`). Returned as string, accepted as string or number181* **spot_margin values**: Only `"SPOT"` or `"MARGIN"` are valid. Invalid values → 50001. `"MARGIN"` requires margin access (error 416 without it)182* **get-valuations requires both params**: Must provide `instrument_name` AND `valuation_type` (only `mark_price` works for spot pairs; `index_price` → 40004). Without `valuation_type` → 40003183* **get-insurance requires instrument_name**: Not optional — omitting returns 40003184* **Candlestick valid timeframes**: `1m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `6h`, `12h`, `1D`, `7D`, `14D`, `1M`. Legacy format also works: `M1`, `M5`, `M15`, `M30`, `H1`, `H2`, `H4`, `H12`, `D1`, `D7`, `D14`. Invalid timeframes (e.g., `2m`, `8h`, `3D`) return 40003185* Trading history endpoints (`get-order-history`, `get-trades`, `get-transactions`) use `start_time`/`end_time` with nanosecond precision recommended186* Wallet history endpoints (`get-deposit-history`, `get-withdrawal-history`) use `start_ts`/`end_ts` in milliseconds187* `notional` is used instead of `quantity` for MARKET BUY orders (specifies spend amount in quote currency)188* For MARKET SELL orders, use `quantity` (amount of base currency to sell)189* If you omit all parameters, you still need to pass an empty params block `params: {}` for API request consistency190191---192193## Advanced Order Management API194195Advanced order types (trigger orders, OCO, OTO, OTOCO) are managed through the `private/advanced/*` endpoints. These are **Spot-only** for now.196197### private/advanced/create-order198199Creates a trigger order (STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT).200201- `STOP_LIMIT` and `TAKE_PROFIT_LIMIT` execute a LIMIT order when `ref_price` is reached202- `STOP_LOSS` and `TAKE_PROFIT` execute a MARKET order when `ref_price` is reached203204**Trigger direction:**205- `ref_price` below market: SELL STOP_LOSS/STOP_LIMIT, BUY TAKE_PROFIT/TAKE_PROFIT_LIMIT206- `ref_price` above market: BUY STOP_LOSS/STOP_LIMIT, SELL TAKE_PROFIT/TAKE_PROFIT_LIMIT207208| Param | Type | Required | Description |209|-------|------|----------|-------------|210| instrument_name | string | Y | e.g., BTC_USD |211| side | string | Y | BUY, SELL |212| type | string | Y | STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT |213| price | string | Depends | For STOP_LIMIT and TAKE_PROFIT_LIMIT only: limit price (e.g., `"0.12"`) |214| quantity | string | Y | Order quantity (e.g., `"10"`) |215| ref_price | string | N | Trigger price (e.g., `"0.12"`) |216| client_oid | string | N | Client order ID (max 36 chars) |217| time_in_force | string | N | GOOD_TILL_CANCEL (default), FILL_OR_KILL, IMMEDIATE_OR_CANCEL |218| exec_inst | array | N | POST_ONLY, SMART_POST_ONLY (cannot coexist) |219| stp_scope | string | N | M (master/sub) or S (sub only) |220| stp_inst | string | N* | M (cancel maker), T (cancel taker), B (cancel both). Required if stp_scope is set |221| stp_id | string | N | 0 to 32767 |222| fee_instrument_name | string | N | Preferred fee token |223224```json225{226 "id": 6573,227 "method": "private/advanced/create-order",228 "params": {229 "instrument_name": "CRO_USD",230 "side": "SELL",231 "type": "STOP_LIMIT",232 "quantity": "10",233 "price": "0.12",234 "ref_price": "0.12",235 "client_oid": "c5f682ed-7108-4f1c-b755-972fcdca0f02"236 }237}238```239240Response: `{ "order_id": "5755600460443882762", "client_oid": "..." }`241242### private/advanced/create-oco243244Creates a One-Cancels-the-Other order. When one leg is partially/fully executed, the other is automatically canceled. Exactly **2 orders** required: one LIMIT + one trigger (STOP_LOSS, STOP_LIMIT, TAKE_PROFIT, or TAKE_PROFIT_LIMIT).245246| Param | Type | Required | Description |247|-------|------|----------|-------------|248| order_list | array | Y | Exactly 2 orders. One must be LIMIT, other must be a trigger type |249250Each order in `order_list` follows `private/create-order` params. For `ref_price_type` of the trigger order, only `MARK_PRICE` is supported.251252```json253{254 "method": "private/advanced/create-oco",255 "id": 123456789,256 "nonce": 123456789000,257 "params": {258 "order_list": [259 {260 "instrument_name": "BTC_USD",261 "quantity": "0.1",262 "type": "LIMIT",263 "price": "93000",264 "side": "SELL"265 },266 {267 "instrument_name": "BTC_USD",268 "quantity": "0.1",269 "type": "STOP_LOSS",270 "ref_price": "80000",271 "side": "SELL"272 }273 ]274 }275}276```277278Response: `{ "list_id": 6498090546073120100 }`279280### private/advanced/create-oto281282Creates a One-Triggers-the-Other order. When the first order (LIMIT) is fully executed, the second order (trigger) takes effect. Exactly **2 orders** required. The trigger order must be on the **opposite side** of the working LIMIT order (e.g., BUY LIMIT + SELL STOP_LOSS, or SELL LIMIT + BUY STOP_LOSS).283284| Param | Type | Required | Description |285|-------|------|----------|-------------|286| order_list | array | Y | Exactly 2 orders. One LIMIT + one trigger type. Trigger must be opposite side |287288```json289{290 "method": "private/advanced/create-oto",291 "id": 123456789,292 "nonce": 123456789000,293 "params": {294 "order_list": [295 {296 "instrument_name": "BTC_USD",297 "quantity": "0.1",298 "type": "LIMIT",299 "price": "93000",300 "side": "BUY"301 },302 {303 "instrument_name": "BTC_USD",304 "quantity": "0.1",305 "type": "STOP_LOSS",306 "ref_price": "80000",307 "side": "SELL"308 }309 ]310 }311}312```313314Response: `{ "list_id": 6498090546073120100 }`315316### private/advanced/create-otoco317318Creates a One-Triggers-a-One-Cancels-the-Other order. When the first LIMIT order is fully executed, two trigger orders take effect. When either trigger executes, the other is canceled. Exactly **3 orders** required: one LIMIT + one STOP_LOSS/STOP_LIMIT + one TAKE_PROFIT/TAKE_PROFIT_LIMIT. The trigger orders must be on the **opposite side** of the working LIMIT order.319320| Param | Type | Required | Description |321|-------|------|----------|-------------|322| order_list | array | Y | Exactly 3 orders. One LIMIT + one stop + one take-profit. Triggers must be opposite side |323324```json325{326 "method": "private/advanced/create-otoco",327 "id": 123456789,328 "nonce": 123456789000,329 "params": {330 "order_list": [331 {332 "instrument_name": "BTC_USD",333 "quantity": "0.1",334 "type": "LIMIT",335 "price": "93000",336 "side": "BUY"337 },338 {339 "instrument_name": "BTC_USD",340 "quantity": "0.1",341 "type": "STOP_LOSS",342 "ref_price": "80000",343 "side": "SELL"344 },345 {346 "instrument_name": "BTC_USD",347 "quantity": "0.1",348 "type": "TAKE_PROFIT",349 "ref_price": "108000",350 "side": "SELL"351 }352 ]353 }354}355```356357Response: `{ "list_id": 6498090546073120100 }`358359### private/advanced/cancel-oco, cancel-oto, cancel-otoco360361Cancel an OCO/OTO/OTOCO order group.362363| Param | Type | Required | Description |364|-------|------|----------|-------------|365| list_id | string | Y | List ID returned from create |366367```json368{ "method": "private/advanced/cancel-oco", "id": 1234, "nonce": 123456789000, "params": { "list_id": "4421958062479290999" } }369```370371### private/advanced/cancel-order372373Cancel an individual leg of an OTO/OTOCO order.374375| Param | Type | Required | Description |376|-------|------|----------|-------------|377| order_id | number or string | Depends | Either order_id or client_oid must be present. String format recommended |378| client_oid | string | Depends | Either order_id or client_oid must be present |379380### private/advanced/cancel-all-orders381382Cancel all advanced orders for an instrument.383384| Param | Type | Required | Description |385|-------|------|----------|-------------|386| instrument_name | string | N | e.g., BTC_USD. Omit to cancel ALL instruments |387| type | string | N | LIMIT, TRIGGER, or ALL |388389### private/advanced/get-open-orders390391Get all open advanced orders.392393| Param | Type | Required | Description |394|-------|------|----------|-------------|395| instrument_name | string | N | e.g., BTC_USD. Omit for all |396397**Response fields per order:** account_id, order_id, client_oid, order_type, time_in_force, side, exec_inst, quantity, limit_price, order_value, maker_fee_rate, taker_fee_rate, avg_price, cumulative_quantity, cumulative_value, cumulative_fee, status (NEW/PENDING/ACTIVE), order_date, instrument_name, fee_instrument_name, list_id, contingency_type (OTO/OTOCO), leg_id, create_time, create_time_ns, update_time398399### private/advanced/get-order-detail400401Get details for a specific advanced order.402403| Param | Type | Required | Description |404|-------|------|----------|-------------|405| order_id | number or string | Depends | String format recommended |406| client_oid | string | Depends | Either order_id or client_oid required |407408**Response fields:** Same as get-open-orders, with status including: NEW, PENDING, REJECTED, ACTIVE, CANCELED, FILLED409410### private/advanced/get-order-history411412Get historical advanced orders.413414| Param | Type | Required | Description |415|-------|------|----------|-------------|416| instrument_name | string | N | Omit for all |417| start_time | number or string | N | Unix timestamp (ns recommended). Default: end_time - 1 day |418| end_time | number or string | N | Unix timestamp (ns recommended). Default: current time |419| limit | int | N | Max results. Default: 100, Max: 100 |420421**Note:** If you omit all parameters, you still need to pass `params: {}` for API request consistency.422423**Response fields:** Same as get-open-orders, with status including: REJECTED, CANCELED, FILLED, EXPIRED424425**Note:** To detect partial fills, check for status `ACTIVE` with `cumulative_quantity > 0`.426427---428429## Wallet API430431### private/create-withdrawal432433Creates a withdrawal request. Withdrawal setting must be enabled for your API Key. Withdrawal addresses must first be whitelisted in your account's Withdrawal Whitelist page.434435| Param | Type | Required | Description |436|-------|------|----------|-------------|437| currency | string | Y | e.g., BTC, CRO, USDT |438| amount | string | Y | **Gross** amount to withdraw (fee is deducted from this). e.g., `"11"` with fee=1 sends 10 to destination |439| address | string | Y | Destination address. Must be whitelisted in Exchange withdrawal settings |440| client_wid | string | N | Optional client withdrawal ID (max 36 chars) |441| address_tag | string | N | Secondary identifier for XRP, XLM, etc. (memo/tag) |442| network_id | string | N | Network for multi-chain tokens (e.g., `"ARB"`, `"ETH"`, `"SOL"`). **Strongly recommended** for multi-chain currencies — use `get-currency-networks` to list available networks and fees |443444### private/get-deposit-address445446Get deposit addresses for a currency.447448| Param | Type | Required | Description |449|-------|------|----------|-------------|450| currency | string | Y | e.g., BTC, CRO |451452### private/get-currency-networks453454Get all supported currency networks including withdrawal fees, minimum amounts, and deposit/withdrawal status.455456No required parameters (pass empty `params: {}`).457458### private/get-deposit-history459460| Param | Type | Required | Description |461|-------|------|----------|-------------|462| currency | string | N | e.g., BTC, CRO |463| start_ts | long | N | Default: 90 days from current timestamp |464| end_ts | long | N | Default: current timestamp |465| page_size | int | N | Page size (Default: 20, Max: 200) |466| page | int | N | Page number (0-based) |467| status | string | N | `0` (Not Arrived), `1` (Arrived), `2` (Failed), `3` (Pending) |468469**Note:** Works for master account only, not for sub-accounts.470471### private/get-withdrawal-history472473| Param | Type | Required | Description |474|-------|------|----------|-------------|475| currency | string | N | e.g., BTC, CRO |476| start_ts | long | N | Default: 90 days from current timestamp |477| end_ts | long | N | Default: current timestamp |478| page_size | int | N | Page size (Default: 20, Max: 200) |479| page | int | N | Page number (0-based) |480| status | string | N | `0` (Pending), `1` (Processing), `2` (Rejected), `3` (Payment In-progress), `4` (Payment Failed), `5` (Completed), `6` (Cancelled) |481482**Note:** Works for master account only, not for sub-accounts.483484---485486## Authentication487488For endpoints that require authentication (all `private/` methods), you will need to provide Crypto.com Exchange API credentials.489490Required credentials:491492* **apiKey**: Your Crypto.com Exchange API key (for request identification and header)493* **secretKey**: Your Crypto.com Exchange API secret (for HMAC-SHA256 signing)494495Base URLs:496497| Environment | REST API | User WebSocket | Market WebSocket |498|-------------|----------|----------------|------------------|499| Production | `https://api.crypto.com/exchange/v1/{method}` | `wss://stream.crypto.com/exchange/v1/user` | `wss://stream.crypto.com/exchange/v1/market` |500| UAT Sandbox | `https://uat-api.3ona.co/exchange/v1/{method}` | `wss://uat-stream.3ona.co/exchange/v1/user` | `wss://uat-stream.3ona.co/exchange/v1/market` |501502### Rate Limits503504| Endpoint Type | Limit |505|---------------|-------|506| `private/create-order`, `private/cancel-order`, `private/cancel-all-orders` | 15 requests per 100ms each |507| `private/get-order-detail` | 30 requests per 100ms |508| `private/get-trades` | 1 request per second |509| `private/get-order-history` | 1 request per second |510| All other private REST | 3 requests per 100ms each |511| Public market data (`get-book`, `get-tickers`, `get-trades`, etc.) | 100 requests per second each (per IP) |512| User API WebSocket | 150 requests per second |513| Market Data WebSocket | 100 requests per second |514515### Open Order Limits516517| Condition | Limit |518|-----------|-------|519| Max open orders per trading pair per account/subaccount | 200 |520| Max open orders across all pairs per account/subaccount | 1000 |521522---523524## Security525526### Share Credentials527528Users can provide Crypto.com Exchange API credentials by sending a file where the content is in the following format:529530```bash531abc123...xyz532secret123...key533```534535### Never Display Full Secrets536537When showing credentials to users:538- **API Key:** Show first 5 + last 4 characters: `dG9rZ...8akf`539- **Secret Key:** Always mask, show only last 5: `***...ws1eK`540541Example response when asked for credentials:542```543Account: main544API Key: dG9rZ...8akf545Secret: ***...ws1eK546Environment: Production547```548549### Listing Accounts550551When listing accounts, show names and environment only — never keys:552```553Crypto.com Exchange Accounts:554* main (Production)555* sandbox-dev (UAT Sandbox)556```557558### Transactions in Production559560When performing transactions in production, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.561562---563564## Crypto.com Exchange Accounts565566### main567- API Key: your_production_api_key568- Secret: your_production_secret569- Sandbox: false570571### sandbox-dev572- API Key: your_sandbox_api_key573- Secret: your_sandbox_secret574- Sandbox: true575576### TOOLS.md Structure577578```bash579## Crypto.com Exchange Accounts580581### main582- API Key: abc123...xyz583- Secret: secret123...key584- Sandbox: false585- Description: Primary trading account586587### sandbox-dev588- API Key: test456...abc589- Secret: testsecret...xyz590- Sandbox: true591- Description: Development/testing592```593594---595596## Agent Behavior5975981. Credentials requested: Mask secrets (show last 5 chars only)5992. Listing accounts: Show names and environment, never keys6003. Account selection: Ask if ambiguous, default to main6014. When doing a transaction in production, confirm with user before by asking to write "CONFIRM" to proceed6025. New credentials: Prompt for name, environment6036. Order params (`price`, `quantity`, `notional`, `ref_price`, `amount`) must be strings. `limit` must be a number. `page`/`page_size` accept both6047. Always include `Content-Type: application/json` header605606## Adding New Accounts607608When user provides new credentials:609610* Ask for account name611* Ask: Production or UAT Sandbox612* Store in `TOOLS.md` with masked display confirmation613614---615616## Signing Requests617618All private endpoints require HMAC-SHA256 signature.619620### Signature Process6216221. Sort `params` keys in ascending alphabetical order6232. Concatenate all param keys and values into a single string (no delimiters): `key1value1key2value2...`624 - For arrays: the key appears once, then each element's sorted key+value pairs are concatenated directly (**no array indices**)625 - For `None`/`null` values: use the string `"null"`626 - Recursion depth is limited to 3 levels6273. Build the signing payload: `{method}{id}{api_key}{param_string}{nonce}`6284. HMAC-SHA256 hash the payload using your secret key, output as hex string6295. Include `sig` in the request body630631### User Agent Header632633Include `User-Agent` header with the following string: `crypto-com-exchange/1.0.1 (Skill)`634635See [`references/authentication.md`](./references/authentication.md) for implementation details.