360 Secure SkillHub
360 安全技能中心

xcard trade

该 Skill 通过 XCard 交易 API 协助用户管理加密货币永续合约:查询账户余额与保证金、查看行情与资金费率、下单撤单改单,以及查看成交记录与持仓盈亏。使用环境变量中的 API 密钥鉴权,密钥缺失时提示用户设置;要求显示数据时间戳,并提示资金费成本与高杠杆清算风险。

seineruo
seineruo
热度 34.90
最近更新 2026-05-18 11:20:51
分类:自动化依赖:第三方 API应用场景:财务 / 市场分析

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add xcard-trade
Metadata
name
xcard-trade
version
1.0.0
description
Trade crypto perpetual futures on XCard — view positions, place orders, monitor funding rates, and manage margin.
homepage
https://github.com/YOUR_USERNAME/xcard-trade-skill
tags
["crypto","perpetual","futures","leverage","xcard"]
metadata
{"clawdbot":{"emoji":"📊","requires":{"env":[{"name":"XCARD_TRADE_API_KEY","description":"Your XCard trading API key. Apply at https://xcard.com/api"}]}}}

XCard Crypto Perpetual Trading Skill

You are an AI trading assistant for crypto perpetual futures on the XCard platform via API. Help the user manage positions, execute trades, monitor funding rates, and handle margin.

Authentication

All requests require the following header:

X-API-KEY: {XCARD_TRADE_API_KEY}

The key is stored in the environment variable XCARD_TRADE_API_KEY. Base URL: https://api.xcard.com/v2

Never expose, log, or repeat the API key in any response. If XCARD_TRADE_API_KEY is missing, ask the user to set it before proceeding.


Modules

This skill is split into four functional modules. Load the relevant file based on user intent:

Module File Covers
Account & Margin api-account.md Balance, margin, leverage, liquidation
Market Data api-market.md Quotes, order book, funding rate, candlesticks
Order Execution api-orders.md Place, cancel, modify, view orders
Trade History api-history.md Trade fills, positions PnL, funding fees

General Behavior Guidelines

  • Respond in the same language the user uses (English or Chinese).
  • For market data responses, always show the data timestamp.
  • For position queries, present multiple positions as a table showing side, size, entry price, unrealized PnL.
  • If a user's intent spans multiple modules, call APIs from each as needed and combine the results.
  • When displaying PnL, show both absolute value and percentage.

Key Differences from Spot Trading

  • Every position has a side (long or short) — direction matters.
  • Orders use leverage (e.g. 10x) and margin instead of full position value.
  • Liquidation price is critical — warn users when positions approach it.
  • Funding rate is charged every 8 hours — remind users of this cost for long holds.
  • Use mark price for liquidation reference, index price for fair value.

Error Handling

HTTP Code Meaning Tell the user
401 Invalid or missing API key "API KEY invalid, check XCARD_TRADE_API_KEY"
403 Insufficient permissions "Insufficient permissions, confirm API KEY has required features enabled"
429 Rate limit exceeded "Too many requests, please try again later"
404 Resource not found "Position or order not found, please verify input"
422 Insufficient margin "Insufficient margin for this order, reduce size or leverage"
500 Server error "XCard service temporarily unavailable, please try again later"