mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 08:18:07 +00:00
- Changed installation command from `npx` to `bunx` for consistency. - Added bilingual configuration guides for Aster and Backpack exchanges. - Updated exchange details in the README to reflect new market types and required settings. - Enhanced clarity in the supported exchanges section with updated variable names and descriptions.
3.0 KiB
3.0 KiB
Ondo Perps 配置教程
English version: Ondo Perps Configuration Guide
适用范围
本教程用于 Ondo Perps 加密资产、股票和商品永续适配器。认证使用 API Key ID 与 API Secret 的 HMAC-SHA256 签名。
1. 创建 API Key
- 在 Ondo Perps 完成账户开通和入金。
- 在账户 API 管理页面创建具备读取和交易权限的 API Key。
- 保存 API Key ID 和 API Secret。
- 关闭提现权限并配置固定 IPv4 白名单。
2. 主网最小配置
EXCHANGE=ondoperps
ONDOPERPS_API_KEY_ID=<your_ondo_key_id>
ONDOPERPS_API_SECRET=<your_ondo_api_secret>
ONDOPERPS_SYMBOL=BTC-USD.P
市场符号使用 {TICKER}-USD.P 格式,例如:
BTC-USD.PETH-USD.PXAU-USD.PNVDA-USD.P
适配器也会把 BTCUSDT、BTC/USD 和 BTC-USD 归一化为 BTC-USD.P。
3. 沙盒配置
EXCHANGE=ondoperps
ONDOPERPS_SANDBOX=true
ONDOPERPS_API_KEY_ID=<your_sandbox_key_id>
ONDOPERPS_API_SECRET=<your_sandbox_api_secret>
ONDOPERPS_SYMBOL=BTC-USD.P
启用沙盒后默认使用:
- REST:
https://api.ondoperps-sandbox.xyz - WebSocket:
wss://api.ondoperps-sandbox.xyz/ws
沙盒需要独立生成的凭证。
4. 可选配置
| 变量 | 默认值 | 说明 |
|---|---|---|
ONDOPERPS_BASE_URL |
https://api.ondoperps.xyz |
REST API 地址 |
ONDOPERPS_WS_URL |
wss://api.ondoperps.xyz/ws |
WebSocket 地址 |
ONDOPERPS_BUILDER_CODE |
空 | Ondo 分配的 Builder Code |
ONDOPERPS_BUILDER_FEE_RATE_BPS |
空 | 正整数 Builder 费率,适配器上限为 10 bps |
兼容别名:
EXCHANGE=ondoperp或EXCHANGE=ondoONDOPERP_*旧变量前缀ONDO_KEY_ID与ONDO_API_SECRET
新部署应统一使用 ondoperps 和 ONDOPERPS_*。
5. 验证配置
bun run index.ts doctor --exchange ondoperps --symbol BTC-USD.P --json
bun run index.ts market ticker --exchange ondoperps --symbol BTC-USD.P --json
行情检查会加载合约精度、连接 WebSocket 并执行只读市场请求,不会创建订单。
常见问题
Missing ONDOPERPS_API_KEY_ID or ONDOPERPS_API_SECRET:填写完整凭证对。401或签名失败:同步系统时间,检查 Key ID、Secret、环境和 IP 白名单。- 市场不存在:使用 Ondo 官方市场列表中的
{TICKER}-USD.P符号。 - Builder 费率异常:使用
1–10的整数 bps 值。 - 沙盒连接生产账户为空:使用沙盒专用账户和凭证。
安全要求
- API Key 仅授予读取和交易权限。
- API Secret 只通过本机运行环境传入。
- 凭证泄露后立即撤销 Key 并创建新凭证。