cdcx-check-balance
Verify credentials and inspect account balance — the first action an agent takes before trading.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-11
- Stars
- ★ 80
- Forks
- 17
01 前言 Front Matter
- name
- cdcx-check-balance
- description
- Verify credentials and inspect account balance — the first action an agent takes before trading.
02 资源文件 2
- 参考文档SOURCE.md362 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
Check Balance
When to Use
- Confirm credentials work before any trading workflow
- Report current wallet balance to the user
- Script gating: "only trade if available USDT > X"
Requires authentication.
Preflight
# Are credentials resolvable?
cdcx account info -o json > /dev/null 2>&1 && echo ok || echo "auth not configured"
If this fails, redirect the user to cdcx setup or the cdcx-auth-setup skill.
Full Balance Snapshot
cdcx account summary -o json
Response shape (trimmed):
{
"data": {
"total_available_balance": "10000.00",
"total_margin_balance": "12500.00",
"position_balances": [
{
"instrument_name": "USD_Stablecoin",
"quantity": "12500.00",
"market_value": "12500.00",
"total_available_balance": "10000.00",
"total_margin_balance": "12500.00",
"total_position_value": "0.00"
}
]
}
}
The top-level total_available_balance and total_margin_balance are account-wide. Per-asset detail lives in position_balances[].
One-Currency Check
cdcx account summary -o json | \
jq -r '.data.position_balances[] | select(.instrument_name=="BTC") | .quantity'
Ergonomic Scripts
Gate a trade on available USDT
available=$(cdcx account summary -o json | \
jq -r '.data.total_available_balance // 0')
if awk -v a="$available" 'BEGIN{exit !(a+0 > 500)}'; then
cdcx trade order BUY BTC_USDT 0.001 --type MARKET -o json
else
echo "Insufficient USDT: $available"
fi
Summary line
cdcx account summary -o json | jq -r '
"Margin: \(.data.total_margin_balance) USD · Available: \(.data.total_available_balance) USD"'
All currencies, one per line
cdcx account summary -o json | \
jq -r '.data.position_balances[] | "\(.instrument_name): \(.quantity)"'
Sub-Account Balances
cdcx account subaccount-balances -o json
Returns balances for every sub-account under the master — useful for multi-account ops.
Notes
total_margin_balanceandtotal_available_balanceare valued in USD;position_balances[].quantityis in the native currency- The API schema uses
position_balancesfor the per-currency breakdown even though the user-facing concept is "balances" — do not confuse this with derivatives positions (that'scdcx account positions) cdcx account summaryis tiersensitive_read— no acknowledgement required in MCP mode
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.