Install
openclaw skills install aster-spotAster Spot request using the Aster API. Authentication requires API key and secret key (HMAC SHA256). Supports mainnet.
openclaw skills install aster-spotSpot request on Aster using authenticated API endpoints. Requires API key and secret key for certain endpoints. Return the result in JSON format.
NEVER truncate JSON responses with head -c, head -n, or similar — truncated JSON is corrupted and will produce wrong results.
symbol parameter when querying a specific trading pair. Many endpoints return ALL symbols when symbol is omitted, producing responses of 100KB+.limit parameter to constrain result size. Use the smallest limit that satisfies the request (e.g., limit=5 instead of default 500).jq to extract fields — never parse raw mega-JSON visually. Pipe through jq to select only needed data.When the user asks a broad question (e.g., "what spot pairs are available?"), use a layered approach:
Step 1 — Get lightweight summary first:
# Get just the symbol list, not full exchangeInfo
curl -s "https://sapi.asterdex.com/api/v1/exchangeInfo" | jq '[.symbols[].symbol]'
Step 2 — Confirm scope with user before fetching detailed data for many symbols.
Step 3 — Fetch details for specific symbols only:
# Get price for ONE symbol, not all
curl -s "https://sapi.asterdex.com/api/v1/ticker/price?symbol=BTCUSDT"
| Endpoint | Without symbol | With symbol |
|---|---|---|
/api/v1/exchangeInfo | ALL symbols + filters (100KB+) | N/A — use jq to filter |
/api/v1/ticker/24hr | ALL symbols (50KB+) | Single object (~500B) |
/api/v1/ticker/price | ALL symbols (10KB+) | Single object (~80B) |
/api/v1/ticker/bookTicker | ALL symbols (20KB+) | Single object (~150B) |
/api/v1/depth | N/A (symbol required) | Varies by limit: use limit=5 for overview |
/api/v1/klines | N/A (symbol required) | Default 500 candles — always set limit |
/api/v1/trades | N/A (symbol required) | Default 500 trades — always set limit |
# BAD — returns ALL symbols, then truncates = corrupted JSON
curl -s ".../api/v1/ticker/price" | head -c 5000
# GOOD — returns single symbol, complete JSON
curl -s ".../api/v1/ticker/price?symbol=BTCUSDT"
# BAD — 500 candles by default
curl -s ".../api/v1/klines?symbol=BTCUSDT&interval=1h"
# GOOD — only 5 candles
curl -s ".../api/v1/klines?symbol=BTCUSDT&interval=1h&limit=5"
# GOOD — extract just symbol names from exchangeInfo
curl -s ".../api/v1/exchangeInfo" | jq '[.symbols[] | {symbol, status}]'
| Endpoint | Description | Required | Optional | Authentication |
|---|---|---|---|---|
/api/v1/ping (GET) | Test server connectivity | None | None | No |
/api/v1/time (GET) | Get server time | None | None | No |
/api/v1/exchangeInfo (GET) | Trading specification information | None | None | No |
/api/v1/depth (GET) | Order book depth | symbol | limit | No |
/api/v1/trades (GET) | Recent trades list | symbol | limit | No |
/api/v1/historicalTrades (GET) | Query historical trades | symbol | limit, fromId | Yes |
/api/v1/aggTrades (GET) | Compressed/Aggregate trades list | symbol | fromId, startTime, endTime, limit | No |
/api/v1/klines (GET) | K-line/Candlestick data | symbol, interval | startTime, endTime, limit | No |
/api/v1/ticker/24hr (GET) | 24-hour price change statistics | None | symbol | No |
/api/v1/ticker/price (GET) | Latest price ticker | None | symbol | No |
/api/v1/ticker/bookTicker (GET) | Best bid/ask price ticker | None | symbol | No |
/api/v1/commissionRate (GET) | Get symbol commission rate | symbol, timestamp | recvWindow | Yes |
/api/v1/order (POST) | Place new order | symbol, side, type, timestamp | timeInForce, quantity, quoteOrderQty, price, newClientOrderId, stopPrice, recvWindow | Yes |
/api/v1/order (DELETE) | Cancel order | symbol, timestamp | orderId, origClientOrderId, recvWindow | Yes |
/api/v1/order (GET) | Query order | symbol, timestamp | orderId, origClientOrderId, recvWindow | Yes |
/api/v1/allOpenOrders (DELETE) | Cancel all open orders on a symbol | symbol, timestamp | orderIdList, origClientOrderIdList, recvWindow | Yes |
/api/v1/openOrders (GET) | Current open orders | timestamp | symbol, recvWindow | Yes |
/api/v1/allOrders (GET) | Query all orders | symbol, timestamp | orderId, startTime, endTime, limit, recvWindow | Yes |
/api/v1/account (GET) | Account information | timestamp | recvWindow | Yes |
/api/v1/userTrades (GET) | Account trade history | timestamp | symbol, orderId, startTime, endTime, fromId, limit, recvWindow | Yes |
/api/v1/asset/wallet/transfer (POST) | Perp-Spot transfer | amount, asset, clientTranId, kindType, timestamp | None | Yes |
/api/v1/asset/sendToAddress (POST) | Transfer asset to other address | amount, asset, toAddress, timestamp | clientTranId, recvWindow | Yes |
/api/v1/aster/withdraw/estimateFee (GET) | Get withdrawal fee estimate | chainId, asset | None | No |
/api/v1/aster/user-withdraw (POST) | Withdraw funds | chainId, asset, amount, fee, receiver, nonce, userSignature, timestamp | recvWindow | Yes |
/api/v1/getNonce (POST) | Get nonce for API key creation | address, userOperationType | network | No |
/api/v1/createApiKey (POST) | Create API key | address, userOperationType, userSignature, desc, timestamp | network, apikeyIP, recvWindow | No |
/api/v1/listenKey (POST) | Generate user data stream listen key | None | None | Yes (API key only) |
/api/v1/listenKey (PUT) | Extend listen key validity | listenKey | None | Yes (API key only) |
/api/v1/listenKey (DELETE) | Close user data stream | listenKey | None | Yes (API key only) |
60000. Default 5000. (e.g., 5000)For endpoints that require authentication, you will need to provide Aster API credentials. Required credentials:
Base URL:
WebSocket:
See references/authentication.md for implementation details.
Users can provide Aster API credentials by sending a file where the content is in the following format:
abc123...xyz
secret123...key
When showing credentials to users:
bb3b2...02ae***...ae1cExample response when asked for credentials: Account: main API Key: bb3b2...02ae Secret: ***...ae1c Environment: Mainnet
When listing accounts, show names and environment only — never keys: Aster Accounts:
When performing transactions in mainnet, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.
## Aster Accounts
### main
- API Key: abc123...xyz
- Secret: secret123...key
- Testnet: false
- Description: Primary trading account
### trading
- API Key: trade456...abc
- Secret: tradesecret...xyz
- Testnet: false
- Description: Secondary trading account
When user provides new credentials:
TOOLS.md with masked display confirmationAll trading endpoints require HMAC SHA256 signature:
X-MBX-APIKEY headerSee references/authentication.md for implementation details.