Skip to main content

BitgetConnector

Struct BitgetConnector 

Source
pub struct BitgetConnector { /* private fields */ }
Expand description

Bitget коннектор

Implementations§

Source§

impl BitgetConnector

Source

pub async fn new( credentials: Option<Credentials>, testnet: bool, ) -> ExchangeResult<Self>

Создать новый коннектор

When testnet is true the connector operates in Bitget Demo Trading (paper trading) mode: WebSocket connects to wspap.bitget.com and the X-CHANNEL-API-CODE: paptrading header is added to every authenticated REST request. The REST base URL remains the same as mainnet.

Source

pub async fn public() -> ExchangeResult<Self>

Создать коннектор только для публичных методов

Examples found in repository?
examples/e2e_metadata.rs (line 450)
446async fn test_bitget_rest() -> RestTally {
447    println!("\n── Bitget REST ──────────────────────────────────────────────");
448    let mut tally = RestTally { exchange: "Bitget".into(), tested: 0, passed: 0, failed: 0 };
449
450    let conn = match BitgetConnector::public().await {
451        Ok(c) => c,
452        Err(e) => {
453            println!("  FAIL: connector init -> {}", e);
454            tally.failed += 1;
455            tally.tested += 1;
456            return tally;
457        }
458    };
459
460    // get_futures_open_interest
461    tally.tested += 1;
462    match conn.get_futures_open_interest("BTCUSDT", "USDT-FUTURES").await {
463        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_open_interest(BTCUSDT, USDT-FUTURES)", v); tally.passed += p as usize; }
464        Err(e) => { fail_rest!("get_futures_open_interest", e); tally.failed += 1; }
465    }
466
467    // NEW: get_futures_market_fills
468    tally.tested += 1;
469    match conn.get_futures_market_fills("BTCUSDT", "USDT-FUTURES", Some(10)).await {
470        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_market_fills(BTCUSDT, USDT-FUTURES)", v); tally.passed += p as usize; }
471        Err(e) => { fail_rest!("get_futures_market_fills", e); tally.failed += 1; }
472    }
473
474    // NEW: get_futures_mark_candles
475    tally.tested += 1;
476    match conn.get_futures_mark_candles("BTCUSDT", "USDT-FUTURES", "1H", None, None, Some(5)).await {
477        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_mark_candles(BTCUSDT, USDT-FUTURES, 1H)", v); tally.passed += p as usize; }
478        Err(e) => { fail_rest!("get_futures_mark_candles", e); tally.failed += 1; }
479    }
480
481    tally
482}
Source

pub async fn get_symbols( &self, account_type: AccountType, ) -> ExchangeResult<Value>

Получить информацию о символах

Source§

impl BitgetConnector

Source

pub async fn get_spot_recent_fills( &self, symbol: &str, limit: Option<u32>, ) -> ExchangeResult<Value>

Get recent public spot fills (market trades).

GET /api/v2/spot/market/fills

§Parameters
  • symbol: Spot symbol e.g. BTCUSDT
  • limit: Number of fills (optional, max 500)
Source

pub async fn get_spot_history_candles( &self, symbol: &str, granularity: &str, end_time: Option<i64>, limit: Option<u32>, ) -> ExchangeResult<Value>

Get historical spot candles beyond the standard window.

GET /api/v2/spot/market/history-candles

§Parameters
  • symbol: Spot symbol e.g. BTCUSDT
  • granularity: Candle interval e.g. 1min, 1h, 1day
  • end_time: End timestamp in ms (optional)
  • limit: Number of candles (optional, max 200)
Source

pub async fn get_futures_fill_history( &self, product_type: &str, symbol: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, id_less_than: Option<&str>, limit: Option<u32>, ) -> ExchangeResult<Value>

Get futures fill/trade history (requires auth).

GET /api/v2/mix/order/fill-history

§Parameters
  • product_type: e.g. USDT-FUTURES, COIN-FUTURES
  • symbol: Futures symbol (optional)
  • start_time: Start timestamp in ms (optional)
  • end_time: End timestamp in ms (optional)
  • id_less_than: Pagination — return records with ID less than this (optional)
  • limit: Number of records (optional, max 100)
Source

pub async fn get_futures_open_interest( &self, symbol: &str, product_type: &str, ) -> ExchangeResult<Value>

Get futures open interest.

GET /api/v2/mix/market/open-interest

§Parameters
  • symbol: Futures symbol e.g. BTCUSDT
  • product_type: e.g. USDT-FUTURES
Examples found in repository?
examples/e2e_metadata.rs (line 462)
446async fn test_bitget_rest() -> RestTally {
447    println!("\n── Bitget REST ──────────────────────────────────────────────");
448    let mut tally = RestTally { exchange: "Bitget".into(), tested: 0, passed: 0, failed: 0 };
449
450    let conn = match BitgetConnector::public().await {
451        Ok(c) => c,
452        Err(e) => {
453            println!("  FAIL: connector init -> {}", e);
454            tally.failed += 1;
455            tally.tested += 1;
456            return tally;
457        }
458    };
459
460    // get_futures_open_interest
461    tally.tested += 1;
462    match conn.get_futures_open_interest("BTCUSDT", "USDT-FUTURES").await {
463        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_open_interest(BTCUSDT, USDT-FUTURES)", v); tally.passed += p as usize; }
464        Err(e) => { fail_rest!("get_futures_open_interest", e); tally.failed += 1; }
465    }
466
467    // NEW: get_futures_market_fills
468    tally.tested += 1;
469    match conn.get_futures_market_fills("BTCUSDT", "USDT-FUTURES", Some(10)).await {
470        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_market_fills(BTCUSDT, USDT-FUTURES)", v); tally.passed += p as usize; }
471        Err(e) => { fail_rest!("get_futures_market_fills", e); tally.failed += 1; }
472    }
473
474    // NEW: get_futures_mark_candles
475    tally.tested += 1;
476    match conn.get_futures_mark_candles("BTCUSDT", "USDT-FUTURES", "1H", None, None, Some(5)).await {
477        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_mark_candles(BTCUSDT, USDT-FUTURES, 1H)", v); tally.passed += p as usize; }
478        Err(e) => { fail_rest!("get_futures_mark_candles", e); tally.failed += 1; }
479    }
480
481    tally
482}
Source

pub async fn get_futures_funding_rate_history( &self, symbol: &str, product_type: &str, page_size: Option<u32>, page_no: Option<u32>, ) -> ExchangeResult<Value>

Get futures historical funding rates.

GET /api/v2/mix/market/history-fund-rate

§Parameters
  • symbol: Futures symbol e.g. BTCUSDT
  • product_type: e.g. USDT-FUTURES
  • page_size: Number of records per page (optional, max 100)
  • page_no: Page number (optional)
Source

pub async fn get_futures_symbol_price( &self, symbol: &str, product_type: &str, ) -> ExchangeResult<Value>

Get futures mark price and index price.

GET /api/v2/mix/market/symbol-price

§Parameters
  • symbol: Futures symbol e.g. BTCUSDT
  • product_type: e.g. USDT-FUTURES
Source§

impl BitgetConnector

Source

pub async fn get_futures_market_fills( &self, symbol: &str, product_type: &str, limit: Option<u32>, ) -> ExchangeResult<Value>

Get recent public futures fills (market trades).

GET /api/v2/mix/market/fills-history

Verified: returns [{tradeId, price, size, side, ts, symbol}] directly as data array.

§Parameters
  • symbol: Futures symbol e.g. BTCUSDT
  • product_type: e.g. USDT-FUTURES
  • limit: Number of fills (optional, max 100)
Examples found in repository?
examples/e2e_metadata.rs (line 469)
446async fn test_bitget_rest() -> RestTally {
447    println!("\n── Bitget REST ──────────────────────────────────────────────");
448    let mut tally = RestTally { exchange: "Bitget".into(), tested: 0, passed: 0, failed: 0 };
449
450    let conn = match BitgetConnector::public().await {
451        Ok(c) => c,
452        Err(e) => {
453            println!("  FAIL: connector init -> {}", e);
454            tally.failed += 1;
455            tally.tested += 1;
456            return tally;
457        }
458    };
459
460    // get_futures_open_interest
461    tally.tested += 1;
462    match conn.get_futures_open_interest("BTCUSDT", "USDT-FUTURES").await {
463        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_open_interest(BTCUSDT, USDT-FUTURES)", v); tally.passed += p as usize; }
464        Err(e) => { fail_rest!("get_futures_open_interest", e); tally.failed += 1; }
465    }
466
467    // NEW: get_futures_market_fills
468    tally.tested += 1;
469    match conn.get_futures_market_fills("BTCUSDT", "USDT-FUTURES", Some(10)).await {
470        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_market_fills(BTCUSDT, USDT-FUTURES)", v); tally.passed += p as usize; }
471        Err(e) => { fail_rest!("get_futures_market_fills", e); tally.failed += 1; }
472    }
473
474    // NEW: get_futures_mark_candles
475    tally.tested += 1;
476    match conn.get_futures_mark_candles("BTCUSDT", "USDT-FUTURES", "1H", None, None, Some(5)).await {
477        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_mark_candles(BTCUSDT, USDT-FUTURES, 1H)", v); tally.passed += p as usize; }
478        Err(e) => { fail_rest!("get_futures_mark_candles", e); tally.failed += 1; }
479    }
480
481    tally
482}
Source

pub async fn get_futures_mark_candles( &self, symbol: &str, product_type: &str, granularity: &str, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, ) -> ExchangeResult<Value>

Get mark price OHLCV history for a futures contract.

GET /api/v2/mix/market/history-mark-candles

Verified: returns array of [ts, open, high, low, close, vol, notional] candles.

§Parameters
  • symbol: Futures symbol e.g. BTCUSDT
  • product_type: e.g. USDT-FUTURES
  • granularity: Candle interval e.g. 1m, 1H, 1D
  • start_time: Start timestamp in ms (optional)
  • end_time: End timestamp in ms (optional)
  • limit: Number of candles (optional, max 200)
Examples found in repository?
examples/e2e_metadata.rs (line 476)
446async fn test_bitget_rest() -> RestTally {
447    println!("\n── Bitget REST ──────────────────────────────────────────────");
448    let mut tally = RestTally { exchange: "Bitget".into(), tested: 0, passed: 0, failed: 0 };
449
450    let conn = match BitgetConnector::public().await {
451        Ok(c) => c,
452        Err(e) => {
453            println!("  FAIL: connector init -> {}", e);
454            tally.failed += 1;
455            tally.tested += 1;
456            return tally;
457        }
458    };
459
460    // get_futures_open_interest
461    tally.tested += 1;
462    match conn.get_futures_open_interest("BTCUSDT", "USDT-FUTURES").await {
463        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_open_interest(BTCUSDT, USDT-FUTURES)", v); tally.passed += p as usize; }
464        Err(e) => { fail_rest!("get_futures_open_interest", e); tally.failed += 1; }
465    }
466
467    // NEW: get_futures_market_fills
468    tally.tested += 1;
469    match conn.get_futures_market_fills("BTCUSDT", "USDT-FUTURES", Some(10)).await {
470        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_market_fills(BTCUSDT, USDT-FUTURES)", v); tally.passed += p as usize; }
471        Err(e) => { fail_rest!("get_futures_market_fills", e); tally.failed += 1; }
472    }
473
474    // NEW: get_futures_mark_candles
475    tally.tested += 1;
476    match conn.get_futures_mark_candles("BTCUSDT", "USDT-FUTURES", "1H", None, None, Some(5)).await {
477        Ok(v) => { let (p, _) = ok_rest_single!("get_futures_mark_candles(BTCUSDT, USDT-FUTURES, 1H)", v); tally.passed += p as usize; }
478        Err(e) => { fail_rest!("get_futures_mark_candles", e); tally.failed += 1; }
479    }
480
481    tally
482}

Trait Implementations§

Source§

impl Account for BitgetConnector

Source§

fn get_balance<'life0, 'async_trait>( &'life0 self, query: BalanceQuery, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Balance>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get asset balances, optionally filtered to a single asset and/or account type. Read more
Source§

fn get_account_info<'life0, 'async_trait>( &'life0 self, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<AccountInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get account metadata — permissions, commission rates, balance summary.
Source§

fn get_fees<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<FeeInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the fee schedule (maker/taker rates) for this account. Read more
Source§

fn account_capabilities(&self, account_type: AccountType) -> AccountCapabilities

Returns the connector’s account capabilities. Read more
Source§

impl AccountLedger for BitgetConnector

Source§

fn get_ledger<'life0, 'async_trait>( &'life0 self, filter: LedgerFilter, _account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<LedgerEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get spot account bill/ledger records from GET /api/v2/spot/account/bills.

Params: coin (optional), groupType, businessType, startTime (ms), endTime (ms), limit (max 500), idLessThan (for pagination).

Source§

impl AccountTransfers for BitgetConnector

Source§

fn transfer<'life0, 'async_trait>( &'life0 self, req: TransferRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<TransferResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Transfer between Spot, Futures, P2P, etc.

POST /api/v2/spot/wallet/transfer Body: { fromType, toType, amount, coin }

Source§

fn get_transfer_history<'life0, 'async_trait>( &'life0 self, filter: TransferHistoryFilter, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<TransferResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get internal transfer history.

GET /api/v2/spot/account/transferRecords

Source§

impl AmendOrder for BitgetConnector

Source§

fn amend_order<'life0, 'async_trait>( &'life0 self, req: AmendRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Order>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Modify a live order’s price, quantity, and/or trigger price. Read more
Source§

impl BatchOrders for BitgetConnector

Source§

fn max_batch_place_size(&self) -> usize

Maximum number of orders allowed in a single batch place request. Read more
Source§

fn max_batch_cancel_size(&self) -> usize

Maximum number of orders allowed in a single batch cancel request.
Source§

fn place_orders_batch<'life0, 'async_trait>( &'life0 self, orders: Vec<OrderRequest>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<OrderResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Place multiple orders in a single native batch request. Read more
Source§

fn cancel_orders_batch<'life0, 'life1, 'async_trait>( &'life0 self, order_ids: Vec<String>, symbol: Option<&'life1 str>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<OrderResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Cancel multiple orders in a single native batch request. Read more
Source§

impl CancelAll for BitgetConnector

Source§

fn cancel_all_orders<'life0, 'async_trait>( &'life0 self, scope: CancelScope, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<CancelAllResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancel orders matching the given scope. Read more
Source§

impl CustodialFunds for BitgetConnector

Source§

fn get_deposit_address<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, asset: &'life1 str, network: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<DepositAddress>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get deposit address for an asset.

GET /api/v2/spot/wallet/deposit-address

Source§

fn withdraw<'life0, 'async_trait>( &'life0 self, req: WithdrawRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<WithdrawResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submit a withdrawal request.

POST /api/v2/spot/wallet/withdrawal

Source§

fn get_funds_history<'life0, 'async_trait>( &'life0 self, filter: FundsHistoryFilter, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<FundsRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get deposit and/or withdrawal history.

GET /api/v2/spot/wallet/deposit-records (deposits) GET /api/v2/spot/wallet/withdrawal-records (withdrawals)

Source§

impl ExchangeIdentity for BitgetConnector

Source§

fn exchange_id(&self) -> ExchangeId

Уникальный идентификатор биржи Read more
Source§

fn metrics(&self) -> ConnectorStats

Runtime metrics snapshot for this connector. Read more
Source§

fn rate_limit_capabilities(&self) -> RateLimitCapabilities

Static rate limit capabilities for this exchange. Read more
Source§

fn is_testnet(&self) -> bool

Работаем ли с тестовой сетью Read more
Source§

fn supported_account_types(&self) -> Vec<AccountType>

Список поддерживаемых типов аккаунтов Read more
Source§

fn exchange_type(&self) -> ExchangeType

Тип биржи (централизованная, децентрализованная, гибрид) Read more
Source§

fn orderbook_capabilities( &self, _account_type: AccountType, ) -> OrderbookCapabilities

Static L2 orderbook capabilities for the given account type. Read more
Source§

fn exchange_name(&self) -> &'static str

Человекочитаемое имя биржи Read more
Source§

impl FundingHistory for BitgetConnector

Source§

fn get_funding_payments<'life0, 'async_trait>( &'life0 self, filter: FundingFilter, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<FundingPayment>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get historical funding payments for the account. Read more
Source§

impl HasCapabilities for BitgetConnector

Source§

fn capabilities(&self) -> ConnectorCapabilities

Return a declarative map of what this connector supports.
Source§

fn validation_status(&self) -> Option<&'static ValidationStamp>

Empirical validation results from the last e2e_smoke harness run. Read more
Source§

impl MarketData for BitgetConnector

Source§

fn get_price<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Price>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Получить текущую цену символа
Source§

fn get_orderbook<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, depth: Option<u16>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<OrderBook>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Получить книгу ордеров
Source§

fn get_klines<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, interval: &'life2 str, limit: Option<u16>, account_type: AccountType, end_time: Option<i64>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Kline>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Получить свечи (klines) Read more
Source§

fn get_ticker<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Ticker>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Получить 24h тикер
Source§

fn ping<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ExchangeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Проверить соединение (ping)
Source§

fn get_exchange_info<'life0, 'async_trait>( &'life0 self, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<SymbolInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Получить информацию о всех торговых символах биржи Read more
Source§

fn market_data_capabilities( &self, account_type: AccountType, ) -> MarketDataCapabilities

Returns the connector’s market data capabilities. Read more
Source§

impl MarketDataPublic for BitgetConnector

Source§

fn get_recent_trades<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<PublicTrade>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Recent public trades for a symbol.
Source§

fn get_liquidation_history<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<SymbolInput<'life1>>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Liquidation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Historical liquidation events, optionally filtered by symbol and time range.
Source§

fn get_open_interest_history<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, period: &'life2 str, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<OpenInterest>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Historical open interest snapshots.
Source§

fn get_premium_index<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<SymbolInput<'life1>>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<MarkPrice>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark price and index price snapshot(s) for a symbol. Read more
Source§

fn get_long_short_ratio_history<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, period: &'life2 str, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<LongShortRatio>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Historical long/short ratio snapshots.
Source§

fn get_mark_price_klines<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, interval: &'life2 str, limit: Option<u32>, account_type: AccountType, end_time: Option<i64>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Kline>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Mark price klines (OHLCV based on mark price).
Source§

fn get_index_price_klines<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, interval: &'life2 str, limit: Option<u32>, account_type: AccountType, end_time: Option<i64>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Kline>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Index price klines (OHLCV based on index/spot price).
Source§

fn get_funding_rate_history<'life0, 'life1, 'async_trait>( &'life0 self, symbol: SymbolInput<'life1>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<FundingRate>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Historical funding rate payments.
Source§

impl Positions for BitgetConnector

Source§

fn get_positions<'life0, 'async_trait>( &'life0 self, query: PositionQuery, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Position>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get open positions, optionally filtered to a single symbol. Read more
Source§

fn get_funding_rate<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<FundingRate>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the current funding rate for a perpetual contract symbol. Read more
Source§

fn get_open_interest<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<OpenInterest>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get open interest for a perpetual/futures symbol. Read more
Source§

fn get_mark_price<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, ) -> Pin<Box<dyn Future<Output = ExchangeResult<MarkPrice>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the current mark price (and optionally index price + funding rate) for a perpetual/futures symbol. Read more
Source§

fn modify_position<'life0, 'async_trait>( &'life0 self, req: PositionModification, ) -> Pin<Box<dyn Future<Output = ExchangeResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Modify a position — leverage, margin mode, add/remove margin, TP/SL, or close. Read more
Source§

fn get_closed_pnl<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<&'life1 str>, start_time: Option<u64>, end_time: Option<u64>, limit: Option<u32>, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<ClosedPnlRecord>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the closed position P&L history. Read more
Source§

fn get_long_short_ratio<'life0, 'life1, 'async_trait>( &'life0 self, symbol: &'life1 str, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<LongShortRatio>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the long/short account ratio for a symbol. Read more
Source§

impl SubAccounts for BitgetConnector

Source§

fn sub_account_operation<'life0, 'async_trait>( &'life0 self, op: SubAccountOperation, ) -> Pin<Box<dyn Future<Output = ExchangeResult<SubAccountResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform sub-account operations: Create, List, Transfer, GetBalance.

Source§

impl Trading for BitgetConnector

Source§

fn place_order<'life0, 'async_trait>( &'life0 self, req: OrderRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<PlaceOrderResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Place an order of any type. Read more
Source§

fn cancel_order<'life0, 'async_trait>( &'life0 self, req: CancelRequest, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Order>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancel one order, a batch, all orders, or all orders for a symbol. Read more
Source§

fn get_order<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, symbol: &'life1 str, order_id: &'life2 str, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Order>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get the current state of a single order by ID. Read more
Source§

fn get_open_orders<'life0, 'life1, 'async_trait>( &'life0 self, symbol: Option<&'life1 str>, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Order>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all currently open orders, optionally filtered to a single symbol. Read more
Source§

fn get_order_history<'life0, 'async_trait>( &'life0 self, filter: OrderHistoryFilter, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<Order>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get closed / filled / cancelled order history with filtering.
Source§

fn get_user_trades<'life0, 'async_trait>( &'life0 self, filter: UserTradeFilter, account_type: AccountType, ) -> Pin<Box<dyn Future<Output = ExchangeResult<Vec<UserTrade>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the user’s own trade fills (executions). Read more
Source§

fn trading_capabilities(&self, account_type: AccountType) -> TradingCapabilities

Returns the connector’s trading capabilities. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CoreConnector for T

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Downcast to a concrete connector for exchange-specific inherent methods. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> AmendConnector for T

Source§

impl<T> BatchConnector for T

Source§

impl<T> CancelAllConnector for T

Source§

impl<T> PositionsConnector for T

Source§

impl<T> TradingWithMarketData for T