WalkerLiuFei / bybit-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributor Covenant

Bybit-rs

Unofficial API connector for the Bybit API.

Disclaimer

This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.

Installation

Add the following dependency to your Cargo.toml

[dependencies.bybit]
git = "https://github.com/wassup-/bybit-rs.git"

Usage

use bybit::{
    http::{self, Client, Result},
    rest::{self, *},
    Order, OrderType, Side, TimeInForce,
};

async fn create_order() -> Result<Order> {
    // safe to unwrap because we know the url is valid
    let client = Client::new(http::MAINNET_BYBIT, "api key", "api secret").unwrap();
    let data = rest::PlaceActiveOrderData {
        symbol: "BTCUSD".to_string(),
        side: Side::Sell,
        qty: 10.0,
        order_type: OrderType::Limit,
        price: Some(45420.0),
        time_in_force: TimeInForce::PostOnly,
        ..Default::default()
    };
    client.place_active_order(data).await
}

Status

bybit-rs is still under active development. This means that until this library reaches version 1.0.0, things are prone to break and/or change. We're doing our best to quickly implement most of the API functionality provided by Bybit, however not all of the functionality may have been properly tested yet. Please do not hesitate to open an issue if you run into any problems, errors, ... (see Contributing).

Endpoints / Features

HTTP

Market Data Endpoints
  • order book
  • query kline
  • latest information for symbol (tickers)
  • public trading records
  • query symbol
  • query mark price kline
  • query index price kline
  • query premium index kline
  • advanced data
Account Data Endpoints
  • place active order
  • place active linear order
  • get active order
  • cancel active order
  • cancel all active orders
  • replace active order (incomplete)
  • query active order (real-time)
  • place conditional order
  • place conditional linear order
  • position
  • risk limit
  • funding
  • API key info
  • LCP info
Wallet Data Endpoints
  • get wallet balance
  • wallet fund records
  • withdraw records
  • asset exchange records
API Data Endpoints
  • server time
  • announcement

WebSocket

Public Topics
  • orderbook snapshot
  • orderbook delta
  • trade
  • insurance
  • instrument info snapshot
  • instrument info delta
  • kline v2
  • liquidation
Private Topics
  • position
  • execution
  • order
  • stop order

Contributing

To get involved, take a look at CONTRIBUTING.

License

This library is provided under the MIT license. See LICENSE.

Support the author of this library.

If bybit-rs made your life easier, please consider making a donation.

  • BTC 1NCLMTd4Zh6hcWxnVk9emfgyyRabEACy1m
  • ETH 0xab3e024d41b6e9eb6b03bd56de9fdf077c904ef9
  • EOS bybitdeposit tag/memo: 3493784
  • XRP rJn2zAPdFA193sixJwuFixRkYDUtx3apQh tag/memo: 3493784

About

License:MIT License


Languages

Language:Rust 100.0%