createMonster
lotusx
Rust

๐Ÿชท LotusX - Multi-Exchange Crypto Connectors Gateway: A secure, high-performance Rust library for cryptocurrency exchange APIs with unified interfaces across multiple platforms.

Last updated Jun 16, 2026
15
Stars
3
Forks
0
Issues
0
Stars/day
Attention Score
51
Language breakdown
No language data available.
โ–ธ Files click to expand
README

LotusX

LotusX is an async Rust library for cryptocurrency exchange connectors. It provides a shared core for configuration, typed financial data, REST/WebSocket transport, signing, and exchange-specific connector modules.

The current repository is a library crate with a small binary demo in src/main.rs. The demo fetches Binance perpetual markets.

Supported Modules

| Module | Market data | Trading | Account | Funding rates | | --- | --- | --- | --- | --- | | binance | yes | yes | yes | no | | binance_perp | yes | yes | yes | yes | | bybit | yes | yes | yes | no | | bybit_perp | yes | yes | yes | yes | | backpack | yes | yes | yes | no | | hyperliquid | yes | yes | yes | no | | okx | yes | yes | yes | no | | paradex | yes | yes | yes | yes |

Each active exchange module follows the same shape:

src/exchanges/<exchange>/
โ”œโ”€โ”€ builder.rs
โ”œโ”€โ”€ codec.rs
โ”œโ”€โ”€ connector/
โ”‚   โ”œโ”€โ”€ account.rs
โ”‚   โ”œโ”€โ”€ market_data.rs
โ”‚   โ”œโ”€โ”€ mod.rs
โ”‚   โ””โ”€โ”€ trading.rs
โ”œโ”€โ”€ conversions.rs
โ”œโ”€โ”€ mod.rs
โ”œโ”€โ”€ rest.rs
โ”œโ”€โ”€ signer.rs
โ””โ”€โ”€ types.rs

Quick Start

cargo check --all-targets --all-features
cargo test --all-features
cargo run

cargo run uses public Binance perpetual market data and requires network access.

Use the crate from another project:

[dependencies]
lotusx = { path = ".", features = ["env-file"] }
tokio = { version = "1.0", features = ["full"] }

Basic market-data usage:

use lotusx::core::config::ExchangeConfig;
use lotusx::core::traits::MarketDataSource;
use lotusx::exchanges::binance::build_connector;

#[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let config = ExchangeConfig::read_only().testnet(true); let binance = build_connector(config)?;

let markets = binance.get_markets().await?; println!("Found {} markets", markets.len());

Ok(()) }

Typed order request shape:

use lotusx::core::types::{
    conversion, OrderRequest, OrderSide, OrderType, TimeInForce,
};

let order = OrderRequest { symbol: conversion::stringtosymbol("BTCUSDT"), side: OrderSide::Buy, order_type: OrderType::Limit, quantity: conversion::stringtoquantity("0.001"), price: Some(conversion::stringtoprice("30000")), timeinforce: Some(TimeInForce::GTC), stop_price: None, };

Environment

Configuration is read with {EXCHANGE}APIKEY, {EXCHANGE}SECRETKEY, optional {EXCHANGE}TESTNET, and optional {EXCHANGE}BASE_URL.

BINANCEAPIKEY=...
BINANCESECRETKEY=...
BINANCE_TESTNET=true

BYBITAPIKEY=... BYBITSECRETKEY=... BYBIT_TESTNET=true

BACKPACKAPIKEY=... BACKPACKSECRETKEY=...

HYPERLIQUIDAPIKEY=... HYPERLIQUIDSECRETKEY=... HYPERLIQUID_TESTNET=true

OKXAPIKEY=... OKXSECRETKEY=... OKX_PASSPHRASE=... OKX_TESTNET=true

PARADEXAPIKEY=... PARADEXSECRETKEY=... PARADEX_TESTNET=true

Keep real credentials in .env; the file is ignored by git.

Examples

cargo run --example basic_usage
cargo run --example bybit_example
cargo run --example hyperliquid_example
cargo run --example okx_example
cargo run --example backpack_example
cargo run --example paradex_example
cargo run --example connection_test
cargo run --example latency_test -- --quick
cargo run --example customlatencytest

Documentation

Historical plans, migrations, reports, and older analysis notes are under docs/archive.

Safety

Use testnet first, keep API keys out of commits, and leave order-placement examples commented until the target account, symbol, size, and price are intentional.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท createMonster/lotusx ยท Updated daily from GitHub