Struct crypto_rest_client::DeribitRestClient
source · [−]pub struct DeribitRestClient { /* private fields */ }
Expand description
The RESTful client for Deribit.
Deribit has InverseFuture, InverseSwap and Option markets.
- WebSocket API doc: https://docs.deribit.com/?shell#market-data
- Trading at:
- Rate Limits: https://www.deribit.com/pages/information/rate-limits
- Each sub-account has a rate limit of 20 requests per second
Implementations
sourceimpl DeribitRestClient
impl DeribitRestClient
pub fn new(api_key: Option<String>, api_secret: Option<String>) -> Self
sourcepub fn fetch_trades(symbol: &str) -> Result<String, Error>
pub fn fetch_trades(symbol: &str) -> Result<String, Error>
Get most recent trades.
100 trades are returned.
For example: https://www.deribit.com/api/v2/public/get_last_trades_by_instrument?count=100&instrument_name=BTC-PERPETUAL
sourcepub fn fetch_l2_snapshot(symbol: &str) -> Result<String, Error>
pub fn fetch_l2_snapshot(symbol: &str) -> Result<String, Error>
Get the latest Level2 snapshot of orderbook.
Top 2000 bids and asks are returned.
For example: https://www.deribit.com/api/v2/public/get_order_book?depth=2000&instrument_name=BTC-PERPETUAL,
Auto Trait Implementations
impl RefUnwindSafe for DeribitRestClient
impl Send for DeribitRestClient
impl Sync for DeribitRestClient
impl Unpin for DeribitRestClient
impl UnwindSafe for DeribitRestClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more