Skip to main content

Crate adaq_trading_crypto

Crate adaq_trading_crypto 

Source
Expand description

§adaq-trading-crypto

为 AdaQ 量化平台实现的加密货币与预测市场统一交易接口(Rust lib)。

功能基线与 ccxt 对齐;适配器解析逻辑若 参考 ccxt 源码,相应文件保留 MIT 声明(见仓库 NOTICE)。

Re-exports§

pub use decimal::PaddingMode;
pub use decimal::PrecisionMode;
pub use decimal::RoundingMode;
pub use decimal::decimal_to_precision;
pub use error::Error;
pub use error::ErrorContext;
pub use error::ErrorKind;
pub use error::Result;
pub use exchange::Config;
pub use exchange::Exchange;
pub use exchange::Params;
pub use exchange::Realtime;
pub use precise::Precise;
pub use throttle::ThrottleMode;
pub use throttle::Throttler;
pub use transport::Transport;
pub use types::Balance;
pub use types::Balances;
pub use types::Currencies;
pub use types::Currency;
pub use types::Fee;
pub use types::FundingRate;
pub use types::LedgerEntry;
pub use types::Level;
pub use types::Limit;
pub use types::Limits;
pub use types::Market;
pub use types::MarketType;
pub use types::Markets;
pub use types::OHLCV;
pub use types::Order;
pub use types::OrderBook;
pub use types::Position;
pub use types::Precision;
pub use types::Ticker;
pub use types::Tickers;
pub use types::Trade;
pub use types::Transaction;

Modules§

adapters
交易所适配器(ADR-0005):每个交易所一个模块,按 feature 编译。
contract_gen
适配器契约 pairs(ADR-0001):由 build.rs 扫描 src/adapters/*.rs 自动生成。
decimal
decimalToPrecision — ccxt 数字精度格式化(ADR-0004)。
eip712
EIP-712 结构化数据哈希与 ECDSA 签名(polymarket CLOB 下单/认证用)。
error
统一错误体系(ADR-0007)。
exchange
统一接口面(ADR-0002/0003/0006)。
generic
转译生成的通用交易所引擎(ADR-0005 / 0013 / 0016)。
httpcore
HttpCore 深模块(ADR-0013):交易所无关的 HTTP 骨架、市集缓存与 safe 提取。
methods
统一方法面清单(ADR-0001 契约基线)。
precise
精确十进制运算,语义对齐 ccxt Precise(ADR-0004)。
realtime
实时/WebSocket 面(ADR-0009):核心 8 频道 watch_*,realtime feature 门控。
serde_helpers
序列化助手:对 Option<Decimal> 做宽松的字符串/数字/null 解析。
signing
统一签名深模块 —— ADR-0013 sign 接缝的共享实现。
throttle
限速器,对齐 ccxt Throttler(ts/src/base/functions/throttle.ts)语义。
transport
传输层 trait 与实现:reqwest 封装(超时/代理/重试)对齐 ccxt fetch2 语义, 外加 MockTransport 供离线请求/签名测试(候选 6:ADR-0013 第五缝提案)。
types
统一市场数据结构(ADR-0002)。

Macros§

impl_generated_adapter
由 ccxt describe() 生成的 ApiSpec 生成一个交易所适配器新类型。