agent_quick_trade
When a user says 'buy 0.1 BTC', this tool handles the entire order process in one call: checks balance, calculates max open, verifies price limits, places the order, and returns a structured confirmation.
Instructions
[L:WRITE] CAT:[系统] | ## 功能:一步完成交易全流程——自动查余额、算最大可开、检查限价、下单,返回结构化交易确认
场景:Agent 收到用户"买入0.1 BTC"时直接调用,无需分别调余额/可开/限价/下单
关键词:一键交易, quick trade, 下单全流程, 自动检查, 一步到位
参数:
- instId: 产品ID,如 BTC-USDT-SWAP
- side: buy=买入, sell=卖出
- sz: 下单数量(币数或张数)
- tdMode: cash=现货, cross=全仓, isolated=逐仓
- px: 限价(选填,不填市价单)
- ordType: 订单类型,默认limit
鉴权:⚠️ 需要 API Key(交易权限)
风险:WRITE — 真实下单,Agent 需用户确认后调用
返回量:微小 ~1KB — 含预检结果+订单确认+风控提醒
关联:agent_risk_overview 看风险 → 本工具下单 → okx_get_order 确认 → agent_pnl_report 复盘
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| px | No | 限价(选填,不填则市价) | |
| sz | Yes | 下单数量(币数或张数) | |
| side | Yes | 买卖方向 | |
| instId | Yes | 产品ID,如 BTC-USDT-SWAP | |
| tdMode | Yes | 交易模式 | |
| ordType | No | 订单类型,默认limit |