mcpField
B
blofin-trader

blofin-trader

github.com/blofinOther880 installsUpdated 32w ago
Repository

About blofin-trader

A BloFin trading skill for users who want an agent to place and manage exchange orders. It covers multiple order types, batch operations, TP/SL and trigger orders, with explicit confirmation required before trades.

Key features

  1. 01Market, limit, and conditional orders
  2. 02Batch placement and cancellation
  3. 03Position closing and order status checks
  4. 04Take-profit and stop-loss management
  5. 05Pre-trade checks and confirmation

Use cases

  1. 01Place a limit or market order after confirmation
  2. 02Submit several orders in one batch
  3. 03Attach TP/SL levels to a position
  4. 04Review or cancel pending orders

MCP support

The skill operates through tools exposed by blofin-mcp, including order placement, cancellation, position closing, and order review.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/blofin/blofin-skills-hub --skill blofin-trader

After installing, type/blofin-traderin Claude Code to confirm it loaded.

Details

From the project README

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.

Order Basics

Order Types
TypeDescription
marketExecute immediately at best available price
limitExecute at specified price or better
post_onlyLimit order that only adds liquidity (maker only); cancelled if it would match immediately
fokFill or Kill — must fill entirely immediately or cancel
iocImmediate or Cancel — fill what's possible immediately, cancel the rest
Position Sides
SidePosition SideAction
buylongOpen long / close short
sellshortOpen short / close long
buyshortClose short (in hedge mode)
selllongClose long (in hedge mode)
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

Available Tools (via blofin-mcp)

place_order — Place a Single Order
Use place_order to submit a new trade. ALWAYS confirm with the user first.

Parameters:

ParameterTypeRequiredDescription
instIdStringYesInstrument ID, e.g. BTC-USDT
marginModeStringYescross or isolated
positionSideStringYeslong, short, or net
sideStringYesbuy or sell
orderTypeStringYesmarket, limit, post_only, fok, ioc
sizeStringYesOrder size in contracts
priceStringConditionalRequired for limit/post_only/fok/ioc orders
reduceOnlyBooleanNoIf true, only reduces existing position
clientOrderIdStringNoCustom order ID (max 32 chars)
tpTriggerPriceStringNoTake-profit trigger price
tpOrderPriceStringNoTP order price (-1 for market)
slTriggerPriceStringNoStop-loss trigger price
slOrderPriceStringNoSL order price (-1 for market)
brokerIdStringNoBroker 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

cancel_order — Cancel an Order
Use cancel_order to cancel a pending order.

Parameters:

ParameterTypeRequiredDescription
instIdStringYesInstrument ID
orderIdStringConditionalOrder ID (either orderId or clientOrderId required)
clientOrderIdStringConditionalClient order ID

batch_orders — Place Multiple 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"

cancel_batch_orders — Cancel Multiple Orders
Use cancel_batch_orders to cancel multiple orders at once.

All cancellations should use the same identifier type (prefer orderId).


close_position — Close an Entire Position
Use close_position to close a full position on an instrument. Confirm with the user first.

Parameters:

ParameterTypeRequiredDescription
instIdStringYesInstrument ID
marginModeStringYescross or isolated
positionSideStringNolong, short, or net
clientOrderIdStringNoCustom order ID

Example prompts:

  • "Close my BTC-USDT long position"
  • "Close all my ETH positions"

get_open_orders — View Pending Orders
Use get_open_orders to see unfilled or partially filled orders.

Parameters:

ParameterTypeRequiredDescription
instIdStringNoFilter by instrument
orderTypeStringNoFilter by order type
stateStringNolive or partially_filled
before / afterStringNoPagination by orderId
limitStringNoMax 100, default 100

get_order_detail — Single Order Details
Use get_order_detail to check the status of a specific order.

Parameters:

ParameterTypeRequiredDescription
instIdStringYesInstrument ID
orderIdStringConditionalOrder ID
clientOrderIdStringConditionalClient order ID

get_order_history — Past Orders
Use get_order_history to review filled, cancelled, or expired orders.

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

place_tpsl — Attach TP/SL to a Position
Use place_tpsl to set take-profit and/or stop-loss on an existing position.
Always confirm trigger prices with the user.

Parameters:

ParameterTypeRequiredDescription
instIdStringYesInstrument ID
marginModeStringYescross or isolated
positionSideStringYeslong, short, or net
tpTriggerPriceStringConditionalTake-profit trigger price
tpOrderPriceStringNoTP execution price (-1 for market)
slTriggerPriceStringConditionalStop-loss trigger price
slOrderPriceStringNoSL execution price (-1 for market)
sizeStringNoSize 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"
cancel_tpsl — Cancel TP/SL Orders
Use cancel_tpsl to remove existing TP/SL orders.
get_pending_tpsl / get_tpsl_history — View 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
Use place_algo_order for trigger-based orders that execute when a condition is met.

Parameters:

ParameterTypeRequiredDescription
instIdStringYesInstrument ID
marginModeStringYescross or isolated
positionSideStringYeslong, short, or net
sideStringYesbuy or sell
orderTypeStringYesOrder type for execution
sizeStringYesSize in contracts
triggerPriceStringYesPrice that triggers the order
orderPriceStringConditionalExecution price (required for limit)
reduceOnlyBooleanNoOnly reduces position
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

Comments

Markdown supported