revolut-trading
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRevolut Trading Skill
Revolut交易技能指南
This skill provides tools and documentation for interacting with the Revolut X Crypto Exchange API.
本技能提供了与Revolut X加密货币交易所API交互的工具及文档。
Capabilities
功能特性
- Authentication: Securely authenticate using Ed25519 key pairs.
- Market Data: Fetch real-time market data including order books, trades, and candles.
- Trading: Place, cancel, and manage orders.
- Account Management: Retrieve account balances and transaction history.
- 身份验证:使用Ed25519密钥对进行安全身份验证。
- 市场数据:获取实时市场数据,包括订单簿、交易记录及K线数据。
- 交易操作:下单、撤单及管理订单。
- 账户管理:查询账户余额及交易历史。
Quick Start
快速开始
1. Authentication
1. 身份验证
To use the API, you need an API Key and a private key.
See 00_api_overview_and_authentication.md for details on generating keys.
使用API前,你需要API密钥和私钥。有关密钥生成的详细信息,请参阅00_api_overview_and_authentication.md。
2. Using the Python Client
2. 使用Python客户端
A Python client wrapper is provided in . This script handles authentication and request signing for you.
scripts/revolut_client.pyExample Usage:
python
from scripts.revolut_client import RevolutClientscripts/revolut_client.py使用示例:
python
from scripts.revolut_client import RevolutClientInitialize the client
初始化客户端
client = RevolutClient(
private_key_path="path/to/private_key.pem",
api_key="your_api_key"
)
client = RevolutClient(
private_key_path="path/to/private_key.pem",
api_key="your_api_key"
)
Get all currencies
获取所有币种
currencies = client.get_currencies()
print(currencies)
currencies = client.get_currencies()
print(currencies)
Get account balances
获取账户余额
balances = client.get_balances()
print(balances)
balances = client.get_balances()
print(balances)
Place a limit order
下限价单
order = client.place_order(
client_order_id="unique_id_123",
symbol="BTC-USD",
side="buy",
order_configuration={
"limit": {
"price": "50000",
"base_size": "0.001"
}
}
)
print(order)
undefinedorder = client.place_order(
client_order_id="unique_id_123",
symbol="BTC-USD",
side="buy",
order_configuration={
"limit": {
"price": "50000",
"base_size": "0.001"
}
}
)
print(order)
undefinedAPI Reference
API参考文档
For detailed API documentation, refer to the following files:
有关详细的API文档,请参阅以下文件:
General
通用类
- Overview & Authentication
- 概述与身份验证
Market Data
市场数据类
- Get All Currencies
- Get All Currency Pairs
- Get Order Book
- Get Last Trades
- Get Historical OHLCV Candles
- Get All Tickers
- Get All Public Trades
- 获取所有币种
- 获取所有交易对
- 获取订单簿
- 获取最新交易记录
- 获取历史OHLCV K线数据
- 获取所有行情报价
- 获取所有公开交易记录
Account & Trading
账户与交易类
- Get All Balances
- Place Order
- Get Active Orders
- Get Historical Orders
- Get Order By ID
- Cancel Order By ID
- Get Fills of Order By ID
- Get Client Trades
- 获取所有账户余额
- 下单
- 获取活跃订单
- 获取历史订单
- 按ID查询订单
- 按ID撤单
- 按ID查询订单成交明细
- 获取客户交易记录
Common Workflows
常见工作流
Fetching Market Data
获取市场数据
To analyze the market before trading, use the Market Data endpoints.
- Use for a quick overview of prices.
Get All Tickers - Use to see depth and liquidity.
Get Order Book - Use for technical analysis.
Get Historical OHLCV Candles
交易前分析市场可使用市场数据相关端点:
- 使用快速查看价格概况。
获取所有行情报价 - 使用查看市场深度及流动性。
获取订单簿 - 使用进行技术分析。
获取历史OHLCV K线数据
Placing an Order
下单流程
- Check Balance: Ensure you have sufficient funds using .
Get All Balances - Determine Price: Use Market Data endpoints to decide on a price.
- Place Order: Use with a unique
Place Order.client_order_id - Monitor Order: Use or
Get Order By IDto track status.Get Active Orders
- 检查余额:使用确保有足够资金。
获取所有账户余额 - 确定价格:通过市场数据端点确定交易价格。
- 提交订单:使用接口并传入唯一的
下单。client_order_id - 监控订单:使用或
按ID查询订单跟踪订单状态。获取活跃订单
Error Handling
错误处理
The API returns standard HTTP status codes.
- : Check your parameters.
400 Bad Request - : Check your API key and signature.
401 Unauthorized - : You are being rate-limited. Back off and retry.
429 Too Many Requests
API返回标准HTTP状态码:
- :检查请求参数是否正确。
400 Bad Request - :检查API密钥和签名是否有效。
401 Unauthorized - :请求过于频繁,需暂停并重试。
429 Too Many Requests