blofin-trader

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

BloFin Trader

BloFin Trader

Execute trades on BloFin exchange. Supports market, limit, post-only, FOK, IOC orders, batch operations, TP/SL, and algo/trigger orders.
CRITICAL: Always confirm order details with the user before placing any trade. Display the instrument, side, size, price, and estimated cost/margin before execution.
在BloFin交易所执行交易。支持市价、限价、post-only、FOK、IOC订单、批量操作、TP/SL以及算法/触发订单。
重要提示:下单前务必与用户确认订单详情。执行前请展示交易对、方向、数量、价格以及预估成本/保证金。

Order Basics

订单基础

Order Types

订单类型

TypeDescription
market
Execute immediately at best available price
limit
Execute at specified price or better
post_only
Limit order that only adds liquidity (maker only); cancelled if it would match immediately
fok
Fill or Kill — must fill entirely immediately or cancel
ioc
Immediate or Cancel — fill what's possible immediately, cancel the rest
类型说明
market
以当前最优价格立即成交
limit
以指定价格或更优价格成交
post_only
仅提供流动性的限价单(仅maker);若会立即成交则自动取消
fok
Fill or Kill(全数成交或取消)——必须立即全部成交,否则直接取消
ioc
Immediate or Cancel(即时成交剩余撤销)——立即成交可成交部分,剩余部分取消

Position Sides

持仓方向

SidePosition SideAction
buy
long
Open long / close short
sell
short
Open short / close long
buy
short
Close short (in hedge mode)
sell
long
Close long (in hedge mode)
操作方向持仓方向动作
buy
long
开多 / 平空
sell
short
开空 / 平多
buy
short
平空(对冲模式下)
sell
long
平多(对冲模式下)

Size & Contract Value

数量与合约价值

  • Order
    size
    is in contracts, not in base currency
  • Each contract has a
    contractValue
    (check via
    get_instruments
    )
  • Example: BTC-USDT contract value is 0.001 BTC, so 100 contracts = 0.1 BTC
  • Minimum order size is defined by
    minSize
    (e.g., 0.1 contracts for BTC-USDT)
  • Size must be a multiple of
    lotSize
  • 订单
    size
    合约张数为单位,而非基础货币
  • 每张合约对应固定的
    contractValue
    (可通过
    get_instruments
    查询)
  • 示例:BTC-USDT合约价值为0.001 BTC,因此100张合约 = 0.1 BTC
  • 最小下单数量由
    minSize
    定义(例如BTC-USDT最小下单量为0.1张)
  • 下单数量必须是
    lotSize
    的整数倍

Available Tools (via blofin-mcp)

可用工具(通过blofin-mcp)

place_order — Place a Single Order

place_order — 单笔下单

Use place_order to submit a new trade. ALWAYS confirm with the user first.
Parameters:
ParameterTypeRequiredDescription
instId
StringYesInstrument ID, e.g.
BTC-USDT
marginMode
StringYes
cross
or
isolated
positionSide
StringYes
long
,
short
, or
net
side
StringYes
buy
or
sell
orderType
StringYes
market
,
limit
,
post_only
,
fok
,
ioc
size
StringYesOrder size in contracts
price
StringConditionalRequired for limit/post_only/fok/ioc orders
reduceOnly
BooleanNoIf true, only reduces existing position
clientOrderId
StringNoCustom order ID (max 32 chars)
tpTriggerPrice
StringNoTake-profit trigger price
tpOrderPrice
StringNoTP order price (-1 for market)
slTriggerPrice
StringNoStop-loss trigger price
slOrderPrice
StringNoSL order price (-1 for market)
brokerId
StringNoBroker ID if applicable
Example prompts:
  • "Buy 1 BTC-USDT contract at market price"
  • "Place a limit buy for 10 ETH-USDT at $3,000"
  • "Open a 5x long BTC position with 100 contracts"
  • "Short ETH-USDT with a stop loss at $4,000"
Pre-order checklist (always do this before placing):
  1. Confirm instrument exists and is live (
    get_instruments
    )
  2. Verify user has sufficient balance (
    get_balance
    )
  3. Check current leverage setting (
    get_leverage_info
    )
  4. For limit orders, compare price to current market (
    get_tickers
    )
  5. Calculate estimated cost:
    size * contractValue * price / leverage
  6. Display order summary and get explicit user confirmation

Use place_order to submit a new trade. ALWAYS confirm with the user first.
参数:
参数类型必填说明
instId
String交易对ID,例如
BTC-USDT
marginMode
String
cross
(全仓)或
isolated
(逐仓)
positionSide
String
long
short
net
(净头寸)
side
String
buy
sell
orderType
String
market
limit
post_only
fok
ioc
size
String下单数量(单位:合约张数)
price
String条件必填限价/post_only/fok/ioc订单必填
reduceOnly
Boolean若为true,仅减少现有持仓
clientOrderId
String自定义订单ID(最多32个字符)
tpTriggerPrice
String止盈触发价格
tpOrderPrice
String止盈委托价格(-1代表市价)
slTriggerPrice
String止损触发价格
slOrderPrice
String止损委托价格(-1代表市价)
brokerId
String经纪商ID(如有)
示例指令:
  • "以市价买入1张BTC-USDT合约"
  • "以3000美元的价格限价买入10张ETH-USDT"
  • "开5倍杠杆BTC多仓,数量100张"
  • "做空ETH-USDT,止损设在4000美元"
下单前检查清单(下单前必须完成):
  1. 确认交易对存在且可交易(
    get_instruments
  2. 验证用户余额充足(
    get_balance
  3. 检查当前杠杆设置(
    get_leverage_info
  4. 限价单需对比当前市场价格(
    get_tickers
  5. 计算预估成本:
    size * contractValue * price / leverage
  6. 展示订单摘要并获得用户明确确认

cancel_order — Cancel an Order

cancel_order — 取消订单

Use cancel_order to cancel a pending order.
Parameters:
ParameterTypeRequiredDescription
instId
StringYesInstrument ID
orderId
StringConditionalOrder ID (either orderId or clientOrderId required)
clientOrderId
StringConditionalClient order ID

Use cancel_order to cancel a pending order.
参数:
参数类型必填说明
instId
String交易对ID
orderId
String条件必填订单ID(orderId和clientOrderId二选一)
clientOrderId
String条件必填客户端自定义订单ID

batch_orders — Place Multiple Orders

batch_orders — 批量下单

Use batch_orders for placing multiple orders at once. Max 20 orders per batch.
All orders in a batch must share the same
instId
and
marginMode
.
Example prompts:
  • "Place a grid of limit orders for BTC-USDT from $60,000 to $65,000"
  • "Open both a long and short position on ETH"

Use batch_orders for placing multiple orders at once. Max 20 orders per batch.
同一批次的所有订单必须使用相同的
instId
marginMode
示例指令:
  • "为BTC-USDT在60000美元到65000美元区间下网格限价单"
  • "同时开ETH的多仓和空仓"

cancel_batch_orders — Cancel Multiple Orders

cancel_batch_orders — 批量取消订单

Use cancel_batch_orders to cancel multiple orders at once.
All cancellations should use the same identifier type (prefer
orderId
).

Use cancel_batch_orders to cancel multiple orders at once.
所有取消操作需使用相同的标识类型(优先使用
orderId
)。

close_position — Close an Entire Position

close_position — 全额平仓

Use close_position to close a full position on an instrument. Confirm with the user first.
Parameters:
ParameterTypeRequiredDescription
instId
StringYesInstrument ID
marginMode
StringYes
cross
or
isolated
positionSide
StringNo
long
,
short
, or
net
clientOrderId
StringNoCustom order ID
Example prompts:
  • "Close my BTC-USDT long position"
  • "Close all my ETH positions"

Use close_position to close a full position on an instrument. Confirm with the user first.
参数:
参数类型必填说明
instId
String交易对ID
marginMode
String
cross
isolated
positionSide
String
long
short
net
clientOrderId
String自定义订单ID
示例指令:
  • "平掉我的BTC-USDT多仓"
  • "平掉我所有的ETH持仓"

get_open_orders — View Pending Orders

get_open_orders — 查询挂单

Use get_open_orders to see unfilled or partially filled orders.
Parameters:
ParameterTypeRequiredDescription
instId
StringNoFilter by instrument
orderType
StringNoFilter by order type
state
StringNo
live
or
partially_filled
before
/
after
StringNoPagination by orderId
limit
StringNoMax 100, default 100

Use get_open_orders to see unfilled or partially filled orders.
参数:
参数类型必填说明
instId
String按交易对筛选
orderType
String按订单类型筛选
state
String
live
(未成交)或
partially_filled
(部分成交)
before
/
after
String按orderId分页
limit
String最多100条,默认100条

get_order_detail — Single Order Details

get_order_detail — 查询单笔订单详情

Use get_order_detail to check the status of a specific order.
Parameters:
ParameterTypeRequiredDescription
instId
StringYesInstrument ID
orderId
StringConditionalOrder ID
clientOrderId
StringConditionalClient order ID

Use get_order_detail to check the status of a specific order.
参数:
参数类型必填说明
instId
String交易对ID
orderId
String条件必填订单ID
clientOrderId
String条件必填客户端自定义订单ID

get_order_history — Past Orders

get_order_history — 查询历史订单

Use get_order_history to review filled, cancelled, or expired orders.

Use get_order_history to review filled, cancelled, or expired orders.

Take-Profit / Stop-Loss (TP/SL)

止盈/止损(TP/SL)

place_tpsl — Attach TP/SL to a Position

place_tpsl — 为持仓添加TP/SL

Use place_tpsl to set take-profit and/or stop-loss on an existing position.
Always confirm trigger prices with the user.
Parameters:
ParameterTypeRequiredDescription
instId
StringYesInstrument ID
marginMode
StringYes
cross
or
isolated
positionSide
StringYes
long
,
short
, or
net
tpTriggerPrice
StringConditionalTake-profit trigger price
tpOrderPrice
StringNoTP execution price (-1 for market)
slTriggerPrice
StringConditionalStop-loss trigger price
slOrderPrice
StringNoSL execution price (-1 for market)
size
StringNoSize to close (default: full position)
TP/SL validation rules:
  • Long position: TP trigger > current price, SL trigger < current price
  • Short position: TP trigger < current price, SL trigger > current price
  • Always verify against current market price before placing
Example prompts:
  • "Set a take profit at $70,000 and stop loss at $60,000 for my BTC long"
  • "Add a stop loss at $3,200 for my ETH short"
Use place_tpsl to set take-profit and/or stop-loss on an existing position.
Always confirm trigger prices with the user.
参数:
参数类型必填说明
instId
String交易对ID
marginMode
String
cross
isolated
positionSide
String
long
short
net
tpTriggerPrice
String条件必填止盈触发价格
tpOrderPrice
String止盈执行价格(-1代表市价)
slTriggerPrice
String条件必填止损触发价格
slOrderPrice
String止损执行价格(-1代表市价)
size
String平仓数量(默认:全额持仓)
TP/SL校验规则:
  • 多仓:止盈触发价 > 当前价格,止损触发价 < 当前价格
  • 空仓:止盈触发价 < 当前价格,止损触发价 > 当前价格
  • 下单前务必对照当前市场价进行校验
示例指令:
  • "为我的BTC多仓设置70000美元止盈,60000美元止损"
  • "为我的ETH空仓添加3200美元的止损"

cancel_tpsl — Cancel TP/SL Orders

cancel_tpsl — 取消TP/SL订单

Use cancel_tpsl to remove existing TP/SL orders.
Use cancel_tpsl to remove existing TP/SL orders.

get_pending_tpsl / get_tpsl_history — View TP/SL Orders

get_pending_tpsl / get_tpsl_history — 查询TP/SL订单

Use get_pending_tpsl to see active TP/SL orders.
Use get_tpsl_history to review past TP/SL orders.

Use get_pending_tpsl to see active TP/SL orders.
Use get_tpsl_history to review past TP/SL orders.

Algo / Trigger Orders

算法/触发订单

place_algo_order — Conditional/Trigger Orders

place_algo_order — 条件/触发订单

Use place_algo_order for trigger-based orders that execute when a condition is met.
Parameters:
ParameterTypeRequiredDescription
instId
StringYesInstrument ID
marginMode
StringYes
cross
or
isolated
positionSide
StringYes
long
,
short
, or
net
side
StringYes
buy
or
sell
orderType
StringYesOrder type for execution
size
StringYesSize in contracts
triggerPrice
StringYesPrice that triggers the order
orderPrice
StringConditionalExecution price (required for limit)
reduceOnly
BooleanNoOnly reduces position
Use place_algo_order for trigger-based orders that execute when a condition is met.
参数:
参数类型必填说明
instId
String交易对ID
marginMode
String
cross
isolated
positionSide
String
long
short
net
side
String
buy
sell
orderType
String执行时的订单类型
size
String合约数量
triggerPrice
String触发订单的价格
orderPrice
String条件必填执行价格(限价单必填)
reduceOnly
Boolean仅减少持仓

cancel_algo_order / get_pending_algo_orders / get_algo_order_history

cancel_algo_order / get_pending_algo_orders / get_algo_order_history

Manage and review algo/trigger orders.

管理和查询算法/触发订单。

Safety Rules

安全规则

  1. NEVER place an order without explicit user confirmation — always show a summary first
  2. Double-check the side (buy/sell) and position side (long/short) — mistakes are costly
  3. Verify sufficient balance before placing orders
  4. Validate limit prices against current market to avoid obvious errors
  5. Warn about high-leverage orders — clearly state the liquidation risk
  6. For large orders, check order book depth to estimate slippage
  7. Rate limit awareness: Trading APIs are limited to 30 requests per 10 seconds per user
  1. 未获得用户明确确认前绝对不要下单——务必先展示订单摘要
  2. 反复核对操作方向(buy/sell)和持仓方向(long/short)——失误代价极高
  3. 下单前验证余额充足
  4. 对照当前市场价校验限价,避免明显错误
  5. 高杠杆订单需给出风险提示——明确说明爆仓风险
  6. 大额订单需查询订单薄深度,预估滑点
  7. 注意频率限制: 交易API限制每个用户每10秒最多发起30次请求