Unofficial API connector for the Bybit API.
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.
Add the following dependency to your Cargo.toml
[dependencies.bybit]
git = "https://github.com/wassup-/bybit-rs.git"
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
}
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).
- 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
- 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
- get wallet balance
- wallet fund records
- withdraw records
- asset exchange records
- server time
- announcement
- orderbook snapshot
- orderbook delta
- trade
- insurance
- instrument info snapshot
- instrument info delta
- kline v2
- liquidation
- position
- execution
- order
- stop order
To get involved, take a look at CONTRIBUTING.
This library is provided under the MIT license. See LICENSE.
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