Install
openclaw skills install yubitClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
Use this skill whenever the user wants to do anything on the Yubit exchange: check prices, query wallet/spot/TradFi/earn/perp balances, transfer funds, inspect positions/orders/history/wallet flow records, place or cancel perp orders, manage leverage or mode, set take-profit / stop-loss, or troubleshoot exchange requests.
openclaw skills install yubitThis is the complete Yubit exchange skill.
Use this skill whenever the user wants to do anything on the Yubit exchange. It keeps the full rule set for market data, wallets, spot, TradFi, earn, perpetual futures trading, and diagnostics in one place.
Use the yubit MCP tools for all exchange operations. Do not guess balances, prices, positions, order state, or write success.
Use the yubit MCP tools for all market-data queries. Never use web search for price or market data.
For ANY price, market, or exchange quote query, use the yubit MCP tools.
Do not guess or fabricate market data. If a tool call fails, report the error.
traceId.Symbol mapping:
BTCUSDTETHUSDTSOLUSDTBTCFreeUETHFreeUFor kline queries:
getKlines for normal last-price candles.getMarkPriceKlines only when the user explicitly asks about mark-price history instead of normal last-price candles.start and end must be passed together.getMarkPriceKlines.limit max is 200.Use getRiskLimits when the user asks about:
Use getInstruments when the user asks about:
Funding-related queries:
getFundingRategetFundingRateHistoryOrderbook / trade-flow queries:
getOrderbookgetRecentTradesTimestamp format:
YYYY-MM-DD HH:MM:SS±HH:MM, not Unix epoch.2026-04-10 17:00:00+08:00If the user asks for "all visible contracts", "all instruments", or "all risk tiers", you may omit symbol.
If the user asks a market question and the current session exposes no relevant tool, call getCapabilities() first and report what this MCP server can do in the current session.
BTCUSDTETHUSDTSOLUSDTBTCFreeUETHFreeUgetTicker(symbol) — price, 24h change, volume, funding rategetOrderbook(symbol) — bid/ask depthgetKlines(symbol, interval, limit?, start?, end?) — last-price candlestick data (OHLCV). start/end are ms timestamps and must come as a pair.getMarkPriceKlines(symbol, interval, limit?, start?, end?) — mark-price candlestick data (OHLC only, no volume/turnover). limit max 200.getFundingRate(symbol) — current funding rategetFundingRateHistory(symbol, limit?, startTime?, endTime?) — historical funding rates, optional ms time rangegetInstruments(symbol?, status?, limit?, cursor?) — contract specs and trading statusgetRiskLimits(symbol?) — risk-limit tiers per contractgetRecentTrades(symbol) — recent public tradesgetCapabilities() — capability snapshot for the current MCP sessionUse the yubit MCP tools for all account and portfolio queries.
Account semantics:
perpGetBalance is CONTRACT account balance (for perpetual futures trading).spotGetBalance is SPOT account asset balances.tradfiGetBalance is TradFi account detail query.earnGetBalance is earn/perfi account balance query.fundGetAssets is FUND account asset balances.getPortfolioNetWorth is total value across fund + contract + spot + tradfi in USDT equivalent.perpGetPositions requires either:
symbol, orsettleCoin
Do NOT call perpGetPositions without any parameter.To see ALL positions across all settle coins, query USDT and FreeU separately.
perpGetOpenOrders requires at least one of:
symbolsettleCoinbaseCoinUse perpGetModeConfigs when the user asks:
Position and margin modes:
tradeMode=0, tradeModeLabel=CrosstradeMode=1, tradeModeLabel=IsolatedisSeparatePz=false, positions in listisSeparatePz=true, positions in separateList, each with unique pzLinkIdContract record queries:
perpGetOrderHistory = historical ordersperpGetExecutions = fills / executionsperpGetClosedPnl = closed-position PnLperpGetWalletFlowRecords = wallet flow / bills such as transfers, realized PnL, funding fees, and trading feesperpGetOrderHistory, perpGetExecutions, perpGetClosedPnl require symbolperpGetWalletFlowRecords does not require symbol; use coin='USDT' when the user is asking about USDT contract wallet billsbaseCoin can broaden some queries, but symbol is still the safest defaultUse perpGetOpenOrders(orderFilter='StopOrder') when the user asks about:
Use perpGetModeConfigs before giving an authoritative answer about:
Timestamp format:
YYYY-MM-DD HH:MM:SS±HH:MMIf an account/order query fails and the user wants exact raw context, use the diagnostics tools in this skill with the returned traceId.
Treat getCapabilities() and the registered tool list as the source of truth for account-query scope in the current session.
Transfer rules:
transfer(coin, amount, fromWallet, toWallet) for wallet-to-wallet transfers.FUNDING = fund wallet (fundGetAssets)TRADING = perp/contract wallet (perpGetBalance)SPOT = spot wallet (spotGetBalance)TRADFI = TradFi wallet (tradfiGetBalance)FUNDING side → read back with fundGetAssets()TRADING side → read back with perpGetBalance(coin='<settle coin>')SPOT side → read back with spotGetBalance()TRADFI side → read back with tradfiGetBalance()traceId.perpGetBalance(coin='FreeU')spotGetBalance()tradfiGetBalance()earnGetBalance()fundGetAssets()getPortfolioNetWorth()transfer(coin='USDT', amount='数量', fromWallet='FUNDING', toWallet='TRADING')transfer(coin='USDT', amount='数量', fromWallet='FUNDING', toWallet='SPOT')transfer(coin='USDT', amount='数量', fromWallet='TRADING', toWallet='SPOT')transfer(coin='USDT', amount='数量', fromWallet='FUNDING', toWallet='TRADFI')transfer(coin='USDT', amount='数量', fromWallet='TRADFI', toWallet='FUNDING')perpGetPositions(settleCoin='FreeU')perpGetOpenOrders(settleCoin='FreeU')perpGetOpenOrders(baseCoin='BTC')perpGetWalletFlowRecords(coin='USDT', limit='20', sort='DESC')perpGetWalletFlowRecords(coin='USDT', fundType='4', limit='20', sort='DESC')perpGetWalletFlowRecords(coin='USDT', fundType='2', limit='20', sort='DESC')These tools need at least a symbol or settleCoin. If the user does not specify, ask before calling:
perpGetFeeRate — requires symbolperpGetOpenOrders — pass symbol or settleCoin or baseCoinperpGetOrderHistory, perpGetExecutions, perpGetClosedPnl — requires symbolperpGetPositions fails with missing parameter context, add symbol or settleCoin and retry.perpGetOpenOrders returns empty under the default filter but the user expects TP/SL or trigger orders, retry with orderFilter='StopOrder'.
traceId.perpGetBalance(coin?) — CONTRACT account balanceperpGetPositions(symbol?, settleCoin?, limit?, cursor?) — open positionsperpGetModeConfigs(symbol?, coin?, category?) — current leverage and mode configsperpGetFeeRate(symbol) — maker/taker fee ratesperpGetOpenOrders(symbol?, settleCoin?, baseCoin?, orderId?, orderLinkId?, orderFilter?, limit?, cursor?) — active ordersperpGetOrderHistory(symbol, ...) — historical ordersperpGetExecutions(symbol, ...) — executions / fillsperpGetClosedPnl(symbol, ...) — closed PnLperpGetWalletFlowRecords(coin?, startTime?, endTime?, limit?, fundType?, cursor?, sort?, includeFreeU?) — perp wallet flow / bill records. startTime / endTime use Unix seconds, not millisecondsspotGetBalance() — SPOT account asset balancestradfiGetBalance() — TradFi account detailsearnGetBalance() — earn/perfi account balancesfundGetAssets() — FUND account asset balancesgetPortfolioNetWorth() — total balance across all walletstransfer(coin, amount, fromWallet, toWallet) — wallet transfer; see Rule 13 for read-back requirementsgetCapabilities() — capability snapshot for the current MCP sessionUse the yubit MCP tools for all spot-account queries.
Account semantics:
spotGetBalance is SPOT account asset list.fundGetAssets) and NOT the perp account (perpGetBalance).spotGetBalance.spotGetBalance currently returns the full spot asset list for the current account.
Do not guess or fabricate spot balances.
traceId.Treat getCapabilities() and the registered tool list as the source of truth for current spot coverage.
Timestamp format:
spotGetBalance()spotGetBalance(),再看 freespotGetBalance(),再看 lockedspotGetBalance(),只保留 total > 0 的币种spotGetBalance() first and then filter locally.spotGetBalance() — SPOT account asset balances (per-coin total, free, locked, valuation fields)getCapabilities() — capability snapshot for the current MCP sessionUse the yubit MCP tools for all TradFi-account queries.
Account semantics:
tradfiGetBalance is the TradFi account detail query.fundGetAssets), NOT the spot account (spotGetBalance), and NOT the perp account (perpGetBalance).tradfiGetBalance.tradfiGetBalance currently returns a single account-detail object for the current account.
balance, equity, margin, margin_free, margin_level, margin_leverage, storage, floating, and login.login is 0, treat it as "account not opened yet" unless the backend says otherwise.Do not guess or fabricate TradFi balances.
traceId.Treat getCapabilities() and the registered tool list as the source of truth for current TradFi coverage.
tradfiGetBalance()tradfiGetBalance(),再看 margin_freetradfiGetBalance(),再看 equitytradfiGetBalance(),再看 floatingtradfiGetBalance() first and inspect login / returned fields before answering.tradfiGetBalance() — TradFi account details (balance, equity, margin, margin free, margin level, leverage, floating PnL, login)getCapabilities() — capability snapshot for the current MCP sessionUse the yubit MCP tools for all earn-account queries.
Account semantics:
earnGetBalance is the earn/perfi account balance query.fundGetAssets), NOT the spot account (spotGetBalance), and NOT the perp account (perpGetBalance).earnGetBalance.earnGetBalance currently returns the current earn account rows for the account.
symbol, balance, equity, total_swap, and yesterday_swap.Do not guess or fabricate earn balances or yields.
traceId.Treat getCapabilities() and the registered tool list as the source of truth for current earn coverage.
earnGetBalance()earnGetBalance(),再看每个币种的 equityearnGetBalance(),再看 total_swapearnGetBalance(),再看 yesterday_swapearnGetBalance() first and then filter locally.earnGetBalance() — earn/perfi account balances and interest fieldsgetCapabilities() — capability snapshot for the current MCP sessionUse this skill for capability discovery and deep troubleshooting.
If you are unsure what tools are currently available, call getCapabilities first.
When the user asks what this MCP can do, what tools are available, or what capabilities are enabled:
getCapabilities() first.tool name + what it does + key boundary if needed.Every MCP tool response includes a traceId.
When the user asks for:
getTrace(traceId) or searchTraces(...).For failed order/trade operations, always surface the traceId.
Do not guess root cause when the trace can answer it directly.
getCapabilities() is the source of truth for the current session:
searchTraces(...) supports:
traceIdorderId / orderNoorderLinkIdsymboltoolNamesuccessfromTs / toTsgetCapabilities() returns a machine-readable snapshot of:
hasAuthcanTradetoolCountmodulesIf the user is troubleshooting a write op:
traceIdgetCapabilitiesgetTracesearchTracesUse the yubit MCP tools for all exchange queries and trading operations. Never use web search for price or market data.
This skill intentionally keeps the original dense trading rules.
For ANY price, market, or exchange query, use the yubit MCP tools.
Place orders directly when the user gives a clear instruction. For market orders, briefly note: "Market orders execute immediately and cannot be cancelled."
Closing positions:
perpClosePosition(symbol, positionIdx) — closes the ENTIRE position, no qty parameter.perpCreateOrder(side=反向, qty=部分数量, reduceOnly=true).
Example: holding 0.3 BTC Long, close 0.12 → perpCreateOrder(symbol=BTCUSDT, side=Sell, orderType=Market, qty=0.12, positionIdx=1, reduceOnly=true).perpGetPositions 获取目标仓位的 pzLinkId,然后 perpCreateOrder 带上 pzLinkId 确保减正确的仓位。perpCreateOrder with reduceOnly=true. Do NOT use perpClosePosition for partial close.3a. 加仓到既有仓位(合仓 / 分仓都适用): 用户说"加仓 BTC 多单 100 U"这类意图时:
perpAddToPosition(symbol, positionIdx, qty, pzLinkId?)。这是专门给“加仓既有仓位”设计的安全路径:
pzLinkIdpzLinkId,同方向会合并到单一仓位perpCreateOrder,先 perpGetPositions(symbol) 找到目标仓位,记下它的 pzLinkId 和 leverageperpCreateOrder(..., pzLinkId=<目标仓位的 pzLinkId>) —— 不传 pzLinkId 会被 runtime 视为开新分仓(每个 pzLinkId 是一个独立子仓位,这是设计而不是 bug)perpSetLeverage:分仓仓位的杠杆和 pzLinkId 是绑定的,中途改杠杆会导致下一单开成一个新的独立分仓(不同 leverage 不会合并)。如果用户确实要改杠杆,应当先平掉该仓位再改杠杆再开新仓位。pzLinkId,必须先把候选仓位列出来让用户选;不要默认挑一个。When querying positions, you MUST pass either symbol or settleCoin:
symbol (e.g. BTCUSDT, ETHFreeU)settleCoin (e.g. USDT, FreeU)perpGetPositions without any parameter — it will return an error.When the account uses separate positions (multiple positions for same direction),
perpClosePosition without pzLinkId will close ALL positions of that direction.
Show the user all positions and let them choose, or pass pzLinkId to target one.
Creating TP/SL requires a strict sequence:
a. Call perpGetPositions first to get the target position.
b. If the position has isSeparatePz=true, you MUST extract its pzLinkId.
c. Call perpCreateTpSl with symbol + positionIdx + tpSlMode + pzLinkId + takeProfit/stopLoss.
d. After perpCreateTpSl returns success, call perpGetPositions again to verify.
e. Only confirm to user when takeProfit/stopLoss in the response are non-zero.
f. If still 0.0, tell user "setting submitted but not confirmed, may need retry".
g. Advanced TP/SL: pass tpOrderType='Limit' + tpLimitPrice for limit-price TP, or slOrderType='Limit' + slLimitPrice for limit-price SL.
h. Partial TP/SL: pass tpSlMode='Partial' + tpSize/slSize.
h1. tpSlMode='Full' means full-position TP/SL scope, not Cross margin mode. Do not describe it as "全仓 Cross".
i. Trailing stop (移动止盈止损 / 追踪止损):
isMovingTpSl=true + tpSlMode='Full' + retracePercentage (backend rejects without it).retracePercentage is DECIMAL form, NOT a percentage number. To express 0.5% retrace pass "0.005". To express 1% pass "0.01". Valid range [0.001, 1.0) meaning 0.1% to just under 100%.movingTriggerBy is optional (gateway defaults to LastPrice if omitted); if you pass it, it must be LastPrice or MarkPrice.movingActivationPrice is optional. If omitted, the sub-order is immediately live at the current market price (status Untriggered). If passed with a future price (above current for long, below for short), the sub-order is Unactivated and only starts trailing once market reaches that price. perpReplaceTpSl only modifies Unactivated orders — if you need to amend the trailing stop after creation, pass an explicit future movingActivationPrice at creation time.retracePercentage drives the dynamic trailing trigger math and is always required. movingTpSlSize lets you set the qty for the trailing stop. retraceDelta is passed through and stored on the sub-order but is not consumed by the current trigger logic — it is not a working substitute for retracePercentage, and when both are passed the runtime computes the trigger purely from retracePercentage (verified by real-MCP experiment: triggerPrice = base × (1 − retracePercentage), retraceDelta ignored). All four are passed through by this skill for forward compatibility.14120005 Invalid Parameter — this is a reliable indirect proof that the first one persisted.position.trailingStop / position.activePrice (those belong to the legacy setTradingStop path and stay zero).Untriggered (created without an activation price → immediately live) and Unactivated (created with a future activation price, waiting to reach it) moving TP/SL sub-orders appear in perpGetOpenOrders under the default filter and under orderFilter='StopOrder', with stopOrderType='MovingTpSl' and orderStatus set to Untriggered / Unactivated respectively. For Untriggered orders the triggerPrice field holds the current dynamic trailing trigger (e.g. base × (1 - retracePercentage) for long); for Unactivated orders triggerPrice is empty string (the activation price is stored elsewhere and is not echoed on this field). Creating a second moving TP/SL on the same position while one exists returns 14120005 Invalid Parameter.
j. Modifying existing TP/SL:orderId via perpGetOpenOrders(symbol, orderFilter='StopOrder'), then call perpReplaceTpSl(symbol, orderId, ...).perpReplaceTpSl only works while the order is Unactivated (created with a future activation price that has not yet been reached). Once the trailing stop is Untriggered / activated, perpReplaceTpSl returns 14120040 moving tp sl order status is not unactivated — cancel and re-create instead.perpReplaceTpSl accepts movingTriggerBy / movingActivationPrice / retracePercentage / retraceDelta / movingTpSlSize (same decimal-form rule for retracePercentage). You cannot convert a regular TP/SL into a trailing stop via replace (isMovingTpSl is not part of the replace request).perpCreateTpSl to modify existing TP/SL — use perpReplaceTpSl.
k. "收益 N%" / "10% 止盈" 这类模糊措辞的默认解释: 当用户说"盈利 10% 止盈" / "亏损 5% 止损" 等百分比但没有明确"相对于什么"时,默认按 margin (positionBalance) 百分比解释(等价于 ROE%,杠杆影响通过 positionBalance 间接进入公式):TP = entry + (positionBalance × pct) / qtySL = entry − (positionBalance × pct) / qtyTP = entry ± amount / qty,和杠杆无关TP = entry × (1 ± pct)6a. 配置型写操作先查当前状态,避免无意义写操作:
perpSetLeverage、perpSwitchMarginMode、perpSwitchPositionMode,先调用 perpGetModeConfigs(symbol)(或按需 perpGetModeConfigs(coin='USDT'))确认当前配置。Write operations must be post-verified, do NOT confirm success on code: 0 alone. Any write op (perpCreateOrder, perpAddToPosition, perpCreateTpSl, perpReplaceTpSl, perpModifyOrder, perpAddMargin, perpClosePosition, perpSetLeverage, perpSwitchMarginMode, perpSwitchPositionMode) returning success: true means "the request was accepted", NOT "the intended state was achieved". Before telling the user "成功", you MUST read back and verify the actual state:
perpCreateOrder: call perpGetOpenOrders (if limit/trigger) or perpGetPositions (if market — check size / direction / pzLinkId / entryPrice match intent).perpAddToPosition: prefer this over raw perpCreateOrder for "加仓已有仓位". It already resolves the target position and performs post-verification; still report the returned targetPzLinkId / afterSize back to the user.orderFilter='StopOrder' with the correct triggerPrice / triggerDirection — if not, the request likely fell back to a non-trigger order type.separateList did NOT grow by a new entry, pzLinkId stayed on the intended target position, and size increased exactly by the requested add-on quantity. If any of those checks fail, stop the flow and report the mismatch; do not continue to TP/SL or close steps.perpGetPositions(symbol) 为空: do NOT jump to "symbol 映射" or "仓位同步延迟" first. You MUST diagnose in this order:
perpGetOrderHistory(symbol, orderId/orderLinkId) — confirm the open order really reached FilledperpGetExecutions(symbol, orderId/orderLinkId) — capture actual fill qty / fill price / execTimeperpGetClosedPnl(symbol, limit='10') — look for a near-immediate opposite-side close with matching closedSize and recent timestampreduceOnly evidence from perpGetOrderHistoryperpGetOrderHistory may show exchange-local symbols such as M1ETHUSDT; treat that as exchange-side history representation, not proof that the position is hidden under another query symbol.perpCreateTpSl (regular TP/SL): call perpGetPositions(symbol) and check takeProfit / stopLoss / tpSlMode actually reflect the new values.perpGetOpenOrders(symbol, orderFilter='StopOrder') and check the sub-order triggerPrice matches your intent.tpSlMode=Full 路径下,如果 position 已有 TP/SL 子单,再次 perpCreateTpSl 会被 runtime 接受(success: true)但不修改已有子单(2026-04-11 实测:updatedTime 移动但 triggerPrice 不变)。要修改已有 Full TP/SL,必须走 perpReplaceTpSl(orderId, ...) 路径(Rule 6j)。tpSlMode=Partial 路径下,再次 perpCreateTpSl 会新增一组子单(不是 no-op),一个 position 可以挂多组 Partial TP/SL。所以 Partial 模式下如果用户意图是"修改"而非"追加",同样应该先找到子单 orderId 再 perpReplaceTpSl。perpReplaceTpSl: after calling, read the sub-order back via perpGetOpenOrders(orderFilter='StopOrder') and confirm the target field (triggerPrice / moving params) actually changed on the same orderId.perpCreateTpSl / perpReplaceTpSl (moving TP/SL): verify via perpGetOpenOrders(symbol, orderFilter='StopOrder') that a sub-order with stopOrderType='MovingTpSl' and matching orderStatus appears.perpModifyOrder: read the order back via perpGetOpenOrders and confirm the modified field (price / qty / triggerPrice / TP / SL) actually changed.perpAddMargin: call perpGetPositions and check positionBalance delta matches the requested margin delta.perpClosePosition: call perpGetPositions and confirm the target pzLinkId / positionIdx no longer appears (or has size 0). Then follow the post-close P&L enrichment flow below.perpCreateOrder(reduceOnly=true) (partial close): call perpGetPositions and confirm position size decreased by the expected qty. Then follow the post-close P&L enrichment flow below.perpGetClosedPnl(symbol, limit='5') and match the most recent record by symbol + close direction + closedSize + recent timestamp.closedPnl (已结盈亏)avgEntryPrice (入场均价)avgExitPrice (出场均价)closedSize (平仓数量)perpGetExecutions(symbol, limit='5') and sum execFee for the matching orderId(s).perpSwitchMarginMode / perpSwitchPositionMode: call perpGetModeConfigs(symbol) (or perpGetPositions if a position exists) and confirm tradeMode / isSeparatePz match the new setting.perpSetLeverage: call perpGetModeConfigs(symbol) and confirm buyLeverage / sellLeverage match the new setting (works even without open positions). For per-position leverage (with pzLinkId), also check perpGetPositions(symbol) to verify the target position's leverage field updated.perpClosePosition, perpCancelOrder, perpSwitchMarginMode) have a short propagation delay — the first read-back may still show the old state. If the first verification does not match, wait ~1 second and retry once before concluding mismatch. Two consecutive mismatches = real failure.traceId and either retry via the correct path (e.g. switch from perpCreateTpSl to perpReplaceTpSl when TP/SL already exists) or tell the user the request didn't take effect.Do not guess or fabricate exchange data. If a tool call fails, report the error.
traceId.getTrace(traceId) or searchTraces(...).traceId in your reply so the user can inspect the exact raw exchange response later.8a. When the user asks to "查合约记录" / "查账单" / "查手续费流水" / "查划转流水", first identify which record class they mean:
perpGetOrderHistoryperpGetExecutionsperpGetClosedPnlperpGetWalletFlowRecords
If the intent is ambiguous, ask which one they want. Do not silently pick the wrong record type.positionIdx=1 for Long, positionIdx=2 for Short. Always pass positionIdx when placing orders or closing positions.
Position and margin modes (from perpGetPositions response):
tradeMode=0, tradeModeLabel=Cross. Shared margin across positions.tradeMode=1, tradeModeLabel=Isolated. Each position has independent margin.isSeparatePz=false. Positions appear in list. Same direction merges into one position. No pzLinkId needed.isSeparatePz=true. Positions appear in separateList. Same direction can have multiple positions, each with unique pzLinkId.isSeparatePz first:
false (合仓): pass positionIdx only, no pzLinkId needed.true (分仓): pass both positionIdx and pzLinkId for perpClosePosition, perpCreateTpSl, and partial close (perpCreateOrder + reduceOnly).Batch operations safety:
perpCancelAllOrders and perpClosePosition with settleCoin affect ALL symbols under that coin.settleCoin without symbol requires confirmBatch=true — the tool will reject without it.symbol for targeted operations.settleCoin + confirmBatch=true when the user explicitly asks to operate on ALL positions/orders under a coin (e.g. "cancel all FreeU orders", "close all FreeU positions").Timestamp format:
YYYY-MM-DD HH:MM:SS±HH:MM with timezone offset, not Unix epoch.2026-04-10 17:00:00+08:00. The offset reflects the MCP Server host's local timezone — the string is self-describing.createdTime, updatedTime, execTime, createdAt, fundingRateTimestamp, nextFundingTime, launchTime, deliveryTime.Conditional / trigger orders (perpCreateOrder with triggerPrice):
triggerPrice + triggerDirection must be set together. Passing triggerPrice without triggerDirection will be rejected locally.
triggerPrice: the price that fires the order.triggerDirection: 1 = fire when market price rises to >= triggerPrice; 2 = fire when market price falls to <= triggerPrice.triggerBy is LastPrice (fire by last trade price) or MarkPrice (fire by mark price). If omitted, the exchange uses its default. Only pass it when the user explicitly asks for a specific trigger price type.closeOnTrigger=true makes the triggered order reduce-only (position-closing). Use this when the user says things like "止盈触发后平仓" or "跌到 60000 自动平掉多单".triggerDirection by comparing triggerPrice with the current market price:
triggerDirection=1triggerDirection=2triggerDirection=2triggerDirection=1perpCreateOrder(symbol='BTCUSDT', side='Buy', positionIdx=1, orderType='Market', qty='0.001', triggerPrice='75000', triggerDirection=1, triggerBy='LastPrice')perpCreateOrder(symbol='BTCUSDT', side='Sell', positionIdx=2, orderType='Market', qty='0.001', triggerPrice='65000', triggerDirection=2, triggerBy='MarkPrice')perpGetOpenOrders(orderFilter='StopOrder'), not in the default Order filter.BTCUSDT, ETH / eth → ETHUSDT, SOL / sol → SOLUSDTBTCFreeU, ETH FreeU / eth freeu → ETHFreeUperpGetBalance(coin='FreeU')fundGetAssets()getPortfolioNetWorth()perpGetWalletFlowRecords(coin='USDT', limit='20', sort='DESC')perpGetWalletFlowRecords(coin='USDT', fundType='4', limit='20', sort='DESC')perpGetWalletFlowRecords(coin='USDT', fundType='2', limit='20', sort='DESC')perpGetPositions(settleCoin='FreeU')perpGetOpenOrders(settleCoin='FreeU')perpGetOpenOrders(baseCoin='BTC')side=Buy, positionIdx=1side=Sell, positionIdx=2perpAddToPosition(symbol, positionIdx, qty, pzLinkId?)perpClosePosition(positionIdx=1);平空 → perpClosePosition(positionIdx=2);同 symbol 多空一起平 → perpClosePosition(positionIdx=-1)(gateway 官方确认 -1 表示关所有同 symbol 仓位)orderType=Market, 限价 → orderType=LimittpOrderType='Limit', tpLimitPrice='价格'slOrderType='Limit', slLimitPrice='价格'tpSlMode='Partial', tpSize='数量', slSize='数量'perpCreateTpSl(symbol, positionIdx, tpSlMode='Full', isMovingTpSl=true, retracePercentage='小数形式回撤', movingTriggerBy?, movingActivationPrice?, retraceDelta?, movingTpSlSize?)。retracePercentage 是小数形式:'0.005' = 0.5% 回撤,'0.01' = 1%,'0.02' = 2%,范围 [0.001, 1.0),必填。movingTriggerBy 可选(网关默认 LastPrice)。movingActivationPrice 可选;传与不传影响状态和可修改性:不传 → 状态 Untriggered(立即生效,不能再 perpReplaceTpSl);传了未来价 → 状态 Unactivated(等待激活,能 perpReplaceTpSl)。两种状态都出现在 perpGetOpenOrders(orderFilter='StopOrder'),stopOrderType='MovingTpSl'。一个仓位只能挂一个。retraceDelta / movingTpSlSize 也都透传到 runtime。perpGetOpenOrders(orderFilter='StopOrder') 找 orderId,再 perpReplaceTpSlperpGetModeConfigs(symbol),返回 buyLeverage / sellLeverage / tradeMode / isSeparatePz。无仓位也可查perpSetLeverage(symbol, buyLeverage)perpSetLeverage(symbol, buyLeverage, positionIdx=1|2, pzLinkId=<目标仓位>)perpSwitchPositionMode(coin, isSeparatePz),isSeparatePz=true 分仓,false 合仓。这是 settle coin 级配置,不是单个 symbol 级配置;切换 coin='USDT' 会影响该结算币下所有 symbol。perpSwitchMarginMode(symbol, tradeMode, buyLeverage, sellLeverage),tradeMode=0 全仓,1 逐仓perpAddMargin(symbol, positionIdx, margin);margin 为正数 = 加保证金(降低强平价),为负数 = 减保证金(提高强平价,受维持保证金率限制),零值被拒。仅对逐仓仓位生效perpCreateOrder(..., triggerPrice='价格', triggerDirection=1|2, triggerBy='LastPrice'),triggerDirection=1 价格上涨触发 / 2 价格下跌触发closeOnTrigger=truetransfer(coin, amount, fromWallet, toWallet),钱包类型:FUNDING / TRADING / SPOT / TRADFI
FUNDING → fundGetAssets()TRADING → perpGetBalance(coin='USDT')SPOT → spotGetBalance()TRADFI → tradfiGetBalance()These tools need at least a symbol or settleCoin. If the user does not specify, ask before calling:
perpGetFeeRate — requires symbolperpGetOpenOrders — pass symbol or settleCoin or baseCoinperpGetOrderHistory, perpGetExecutions, perpGetClosedPnl — requires symbolfundGetAssets)、现货账户(spotGetBalance)、TradFi 账户(tradfiGetBalance)、理财账户(earnGetBalance)和合约账户(perpGetBalance)查询;TapTrading 账户的持仓/余额查询尚未接入。getInstruments for min qty, tell user, then retry.pzLinkId, let user choose.perpCreateTpSl returns success but TP/SL still 0.0: position was not matched (likely missing pzLinkId). Re-query and retry with correct pzLinkId. Do not tell user "success" until confirmed by perpGetPositions.The following MCP tools are registered under "yubit":
getTicker(symbol) — price, 24h change, volume, funding rategetOrderbook(symbol) — bid/ask depthgetKlines(symbol, interval, limit?, start?, end?) — last-price candlestick data (OHLCV). start/end are ms timestamps and must come as a pair.getMarkPriceKlines(symbol, interval, limit?, start?, end?) — mark-price candlestick data (OHLC only, no volume/turnover). Use when the user explicitly asks about mark-price history. limit max 200.getFundingRate(symbol) — current funding rategetFundingRateHistory(symbol, limit?, startTime?, endTime?) — historical funding rates, optional ms time rangegetInstruments(symbol?, status?, limit?, cursor?) — contract specs (min/max qty, tick size, leverage range, trading status). Omit symbol for all; paginate via limit/cursor.getRiskLimits(symbol?) — risk-limit tiers per contract (max notional per tier, maintain/initial margin rate, max leverage). Use when user asks about leverage brackets or liquidation thresholds. Omit symbol for all.getRecentTrades(symbol) — recent public tradesperpGetBalance(coin?) — CONTRACT account balance (for perpetual futures). Returns equity, available, position margin, unrealised PnL. NOT the fund/spot/tradfi wallet. Omit coin for all settle coins.perpGetPositions(symbol?, settleCoin?, limit?, cursor?) — open positions by symbol or settle coin. Must pass at least one of symbol/settleCoin. Supports pagination.perpGetModeConfigs(symbol?, coin?, category?) — per-symbol position/margin mode configs (tradeMode: 0=Cross/1=Isolated, isSeparatePz: true=Separate/false=Merged, buyLeverage, sellLeverage). Works even without open positions — use this to check the user's currently configured leverage and mode. Use before perpSwitchMarginMode / perpSwitchPositionMode / perpSetLeverage. Omit all args to list the whole account.perpGetFeeRate(symbol) — maker/taker fee ratesperpGetOpenOrders(symbol?, settleCoin?, baseCoin?, orderId?, orderLinkId?, orderFilter?, limit?, cursor?) — active orders. At least one of symbol/settleCoin/baseCoin must be provided. Pass orderFilter='StopOrder' for TP/SL sub-orders. baseCoin queries all pairs of a base coin across settle coins (e.g. baseCoin='BTC' → BTCUSDT + BTCFreeU).perpGetOrderHistory(symbol, limit?, orderId?, orderLinkId?, orderStatus?, orderFilter?, cursor?, baseCoin?) — historical orders with full filter setperpGetExecutions(symbol, limit?, orderId?, execType?, startTime?, endTime?, cursor?, baseCoin?, orderLinkId?, orderFilter?) — trade executions with time range / filter / paginationperpGetClosedPnl(symbol, limit?, startTime?, endTime?, cursor?) — closed position PnL with optional time range and paginationperpGetWalletFlowRecords(coin?, startTime?, endTime?, limit?, fundType?, cursor?, sort?, includeFreeU?) — perp wallet flow / bill records such as transfers, realized PnL, funding fees, and trading fees. startTime / endTime use Unix seconds, not millisecondsfundGetAssets() — FUND account asset balances (the central deposit/withdraw/transfer wallet, separate from contract/spot/tradfi accounts). Returns ALL coins with total equity, available balance, frozen amount.getPortfolioNetWorth() — total balance across ALL wallets (fund + contract + spot + tradfi) in USDT equivalent.getCapabilities() — machine-readable capability snapshot for the current session.searchTraces(traceId?, orderId?, orderNo?, orderLinkId?, symbol?, toolName?, success?, fromTs?, toTs?, limit?) — search tracesgetTrace(traceId) — get full trace including raw exchange HTTP request/responseperpCreateOrder(symbol, side, orderType, qty, ...) — place order. Supports conditional/trigger orders via triggerPrice + triggerDirection + triggerBy. mmp is optional and only relevant for market-maker accounts.perpAddToPosition(symbol, positionIdx, qty, pzLinkId?) — safely add to an existing position at market. In separate-position mode it automatically reuses the sole matching pzLinkId or rejects when multiple same-direction sub-positions exist and no pzLinkId is provided. It post-verifies that no unintended new separate position was opened.perpModifyOrder(symbol, orderId|orderLinkId, ...) — amend open limit order. Requires at least one field to modify.perpCancelOrder(symbol, orderId|orderLinkId) — cancel specific orderperpCancelAllOrders(symbol?, settleCoin?, confirmBatch?) — cancel orders. settleCoin requires confirmBatch=true.perpSetLeverage(symbol, buyLeverage, sellLeverage?, positionIdx?, pzLinkId?) — set leverage. Without positionIdx/pzLinkId: sets symbol-wide default. With positionIdx + pzLinkId: adjusts a specific separate position's leverage. Always check perpGetModeConfigs first; if leverage already matches the target, do not submit another write.perpCreateTpSl(symbol, positionIdx, tpSlMode, ...) — create TP/SL on a position. Supports advanced limit-price TP/SL and trailing stop.perpReplaceTpSl(symbol, orderId, ...) — modify existing TP/SL sub-order. Find orderId via perpGetOpenOrders(symbol, orderFilter='StopOrder').perpSwitchPositionMode(coin, isSeparatePz) — switch between merged (合仓) and separate (分仓) position mode for a settle coin. This is coin-level, not symbol-level — changing coin='USDT' affects all symbols under that settle coin. Check current config first and avoid unnecessary writes.perpSwitchMarginMode(symbol, tradeMode, buyLeverage, sellLeverage) — switch between cross (全仓) and isolated (逐仓) margin mode. Check current config first; if it already matches the target state, do not submit another write.perpAddMargin(symbol, positionIdx, margin, pzLinkId?) — adjust margin on an isolated position. Positive adds, negative reduces, zero rejected.perpClosePosition(symbol?, settleCoin?, positionIdx?, confirmBatch?) — close ENTIRE position (no qty, always full close). For partial close, use perpCreateOrder with reduceOnly=true.transfer(coin, amount, fromWallet, toWallet) — transfer funds between wallets. Valid wallet types: FUNDING (fund account), TRADING (contract account), SPOT (spot account), TRADFI (tradfi account). Returns requestId. Follow the transfer notes in Parameter mapping.