$npx -y skills add asterdex/aster-skills-hub --skill aster-api-trading-v3Place, cancel, batch, and query orders for Aster Futures API v3 (/fapi/v3/). Use when placing/canceling orders or querying open/historical. Signed; see aster-api-auth-v3.
| 1 | # Aster API Trading |
| 2 | |
| 3 | **Base:** https://fapi.asterdex.com. Signed (TRADE/USER_DATA). POST/DELETE: body application/x-www-form-urlencoded. |
| 4 | |
| 5 | ## New order |
| 6 | |
| 7 | **POST /fapi/v3/order** (Weight: 1) |
| 8 | |
| 9 | | Parameter | Req | Notes | |
| 10 | |-----------|-----|--------| |
| 11 | | symbol, side, type | Y | side: BUY/SELL; type → see below | |
| 12 | | positionSide | N | BOTH or LONG/SHORT (hedge); req. in Hedge Mode | |
| 13 | | timeInForce | N | GTC, IOC, FOK, GTX | |
| 14 | | quantity, reduceOnly | N | Not with closePosition; reduceOnly not in hedge | |
| 15 | | price, stopPrice | N | stopPrice for STOP*/TAKE_PROFIT* | |
| 16 | | closePosition | N | STOP_MARKET/TAKE_PROFIT_MARKET only; no quantity/reduceOnly | |
| 17 | | activationPrice, callbackRate | N | TRAILING_STOP_MARKET; callbackRate 0.1–5 (1=1%) | |
| 18 | | workingType, priceProtect | N | MARK_PRICE/CONTRACT_PRICE; "TRUE"/"FALSE" | |
| 19 | | newClientOrderId | N | Unique; `^[\.A-Z\:/a-z0-9_-]{1,36}$` | |
| 20 | | newOrderRespType | N | ACK (default), RESULT | |
| 21 | |
| 22 | **Type-specific required:** LIMIT → timeInForce, quantity, price. MARKET → quantity. STOP/TAKE_PROFIT → quantity, price, stopPrice. STOP_MARKET/TAKE_PROFIT_MARKET → stopPrice. TRAILING_STOP_MARKET → callbackRate. |
| 23 | |
| 24 | **Trigger rules:** STOP/STOP_MARKET: BUY → latest ≥ stopPrice; SELL → latest ≤ stopPrice. TAKE_PROFIT/TAKE_PROFIT_MARKET: opposite. TRAILING_STOP_MARKET: BUY → low ≤ activationPrice and latest ≥ low×(1+callbackRate); SELL → high ≥ activationPrice and latest ≤ high×(1-callbackRate). activationPrice: BUY < latest, SELL > latest (else -2021). closePosition=true: close all long (SELL) or short (BUY); hedge: no BUY for LONG / SELL for SHORT. |
| 25 | |
| 26 | ## Batch / Cancel / Query |
| 27 | |
| 28 | - **POST /fapi/v3/batchOrders** (W: 5): `batchOrders` max 5; responses match order. |
| 29 | - **DELETE /fapi/v3/order** (W: 1): symbol + orderId or origClientOrderId. |
| 30 | - **DELETE /fapi/v3/allOpenOrders** (W: 1): symbol. |
| 31 | - **DELETE /fapi/v3/batchOrders** (W: 1): symbol + orderIdList or origClientOrderIdList (max 10). |
| 32 | - **GET /fapi/v3/order**, **openOrder** (W: 1): symbol + orderId or origClientOrderId. |
| 33 | - **GET /fapi/v3/openOrders** (W: 1 or 40): symbol optional; no symbol = all (40). |
| 34 | - **GET /fapi/v3/allOrders** (W: 5): symbol req.; orderId, startTime, endTime, limit (500 default, 1000 max). Window < 7 days. CANCELED/EXPIRED >7d no fills may be missing. |
| 35 | |
| 36 | Payload shapes: [reference.md](reference.md). |