htx/spot-trading
HTX spot trading — limit / market orders / cancel / modify / order query / margin lending.
What this skill does
# Spot Trading
Place and cancel spot orders, modify and query orders, and use margin lending.
> WARNING: **High-risk write skill**. Before every order / cancel / borrow, the AI Agent must show the user the full parameters (symbol, side, type, price, amount) and obtain explicit manual confirmation.
## Authentication and permissions
- API Key needs **trade** permission
- Some query endpoints only need **read** permission
- API Key is used locally only and never uploaded
## Endpoint catalog (11)
### Place / cancel orders (core write operations)
| # | Method | Endpoint | Description |
|---|--------|----------|-------------|
| 1 | POST | `/v1/order/orders/place` | Place a single order (limit / market / TP-SL / IOC / FOK) |
| 2 | POST | `/v1/order/batch-orders` | Batch place orders (max 10) |
| 3 | POST | `/v1/order/orders/{order-id}/submitcancel` | Cancel by order ID |
| 4 | POST | `/v1/order/orders/submitCancelClientOrder` | Cancel by client-order-id |
| 5 | POST | `/v1/order/orders/batchcancel` | Batch cancel (by order ID list) |
| 6 | POST | `/v1/order/orders/batchCancelOpenOrders` | Cancel all open orders (by symbol) |
### Order query (read)
| # | Method | Endpoint | Description |
|---|--------|----------|-------------|
| 7 | GET | `/v1/order/openOrders` | Current open orders |
| 8 | GET | `/v1/order/orders/{order-id}` | Single-order detail |
| 9 | GET | `/v1/order/orders` | Historical orders (by time window) |
| 10 | GET | `/v1/order/matchresults` | Historical trade detail |
### Margin lending
| # | Method | Endpoint | Description |
|---|--------|----------|-------------|
| 11 | POST | `/v1/margin/orders` | Borrow margin funds (write) |
## Order parameters (core)
```json
{
"account-id": "<spot-account-id>",
"symbol": "btcusdt",
"type": "buy-limit | sell-limit | buy-market | sell-market | buy-ioc | sell-ioc | buy-limit-fok | sell-limit-fok",
"amount": "0.001",
"price": "65000.00",
"client-order-id": "<optional 32 chars>",
"source": "spot-api"
}
```
- `buy-limit` / `sell-limit`: limit order, must include `price`
- `buy-market` / `sell-market`: market order. **Buy** `amount` = USDT amount; **sell** `amount` = base currency quantity
- `buy-ioc` / `sell-ioc`: immediate-or-cancel; cancels the remainder
- `buy-limit-fok` / `sell-limit-fok`: fill-or-kill
## Workflow patterns
### Limit buy order
```bash
htx-cli spot trading place \
--account-id <id> \
--symbol btcusdt --type buy-limit \
--price 65000 --amount 0.001 \
--json
```
### Market buy 100 USDT of BTC
```bash
# market buy: amount = quote currency (USDT) amount
htx-cli spot trading place \
--account-id <id> \
--symbol btcusdt --type buy-market \
--amount 100 \
--json
```
### Cancel order
```bash
htx-cli spot trading cancel <order-id> --json
```
### Cancel all BTC/USDT open orders
```bash
htx-cli spot call /v1/order/orders/batchCancelOpenOrders \
--method POST --auth \
--body '{"account-id":"<id>","symbol":"btcusdt"}' --json
```
### Query current open orders
```bash
htx-cli spot trading open-orders --symbol btcusdt --json
```
## Safety constraints (must read)
Before every order, the AI Agent **MUST**:
1. Display the full order: symbol, side (buy/sell), type (limit/market), amount, limit price, estimated trade value, current order book price (reference)
2. Wait for explicit manual confirmation ("confirm / yes / place order" etc.)
3. Only call the API after confirmation is received
For every cancel:
- Single cancel: show order ID + remaining amount + price
- Batch cancel: show number of affected orders + symbols involved
For every borrow:
- Show currency, amount, current rate, potential risks
- Strongly recommend first checking spot account balance to confirm whether borrowing is necessary
## Error handling
- `account-frozen` — account frozen, halt operation
- `order-amountmin-error` — amount below minimum order size; check `min-order-amt` via `htx-cli spot-market symbols`
- `order-pricemin-error` — price precision error; check `price-precision`
- Some errors are due to rate limiting: max ~10 orders/s; on failure, back off 1s and retry
## Installation
```bash
curl -fsSL https://github.com/htx-exchange/htx-skills-hub/releases/latest/download/install.sh | bash -s -- spot-trading
```
## Related docs
- HTX spot trading API: https://huobiapi.github.io/docs/spot/v1/cn/#orders
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.