deribit_http/
constants.rs1pub const DEFAULT_TIMEOUT: u64 = 30;
5
6pub const MAX_RETRIES: u32 = 3;
8
9pub const PRODUCTION_BASE_URL: &str = "https://www.deribit.com/api/v2";
11
12pub const TESTNET_BASE_URL: &str = "https://test.deribit.com/api/v2";
14
15pub mod endpoints {
17 pub const AUTH: &str = "/public/auth";
20
21 pub const GET_TICKER: &str = "/public/ticker";
24 pub const GET_INSTRUMENT: &str = "/public/get_instrument";
26 pub const GET_INSTRUMENTS: &str = "/public/get_instruments";
28 pub const GET_ORDER_BOOK: &str = "/public/get_order_book";
30 pub const GET_BOOK_SUMMARY_BY_CURRENCY: &str = "/public/get_book_summary_by_currency";
32 pub const GET_BOOK_SUMMARY_BY_INSTRUMENT: &str = "/public/get_book_summary_by_instrument";
34 pub const GET_CONTRACT_SIZE: &str = "/public/get_contract_size";
36 pub const GET_CURRENCIES: &str = "/public/get_currencies";
38 pub const GET_INDEX: &str = "/public/get_index";
40 pub const GET_INDEX_PRICE: &str = "/public/get_index_price";
42 pub const GET_INDEX_PRICE_NAMES: &str = "/public/get_index_price_names";
44 pub const GET_SERVER_TIME: &str = "/public/get_time";
46 pub const TEST_CONNECTION: &str = "/public/test";
48 pub const GET_STATUS: &str = "/public/status";
50 pub const GET_APR_HISTORY: &str = "/public/get_apr_history";
52 pub const GET_OPTIONS: &str = "/public/get_options";
54 pub const GET_OPTIONS_PAIR: &str = "/public/get_options_pair";
56 pub const GET_LAST_TRADES_BY_INSTRUMENT: &str = "/public/get_last_trades_by_instrument";
58 pub const GET_HISTORICAL_VOLATILITY: &str = "/public/get_historical_volatility";
60 pub const GET_FUNDING_CHART_DATA: &str = "/public/get_funding_chart_data";
62 pub const GET_TRADINGVIEW_CHART_DATA: &str = "/public/get_tradingview_chart_data";
64 pub const GET_DELIVERY_PRICES: &str = "/public/get_delivery_prices";
66 pub const GET_EXPIRATIONS: &str = "/public/get_expirations";
68 pub const GET_FUNDING_RATE_HISTORY: &str = "/public/get_funding_rate_history";
70 pub const GET_FUNDING_RATE_VALUE: &str = "/public/get_funding_rate_value";
72 pub const GET_LAST_SETTLEMENTS_BY_CURRENCY: &str = "/public/get_last_settlements_by_currency";
74 pub const GET_LAST_SETTLEMENTS_BY_INSTRUMENT: &str =
76 "/public/get_last_settlements_by_instrument";
77 pub const GET_LAST_TRADES_BY_CURRENCY: &str = "/public/get_last_trades_by_currency";
79 pub const GET_LAST_TRADES_BY_CURRENCY_AND_TIME: &str =
81 "/public/get_last_trades_by_currency_and_time";
82 pub const GET_LAST_TRADES_BY_INSTRUMENT_AND_TIME: &str =
84 "/public/get_last_trades_by_instrument_and_time";
85 pub const GET_ORDER_BOOK_BY_INSTRUMENT_ID: &str = "/public/get_order_book_by_instrument_id";
87
88 pub const BUY: &str = "/private/buy";
91 pub const SELL: &str = "/private/sell";
93 pub const CANCEL: &str = "/private/cancel";
95 pub const CANCEL_ALL: &str = "/private/cancel_all";
97 pub const CANCEL_ALL_BY_CURRENCY: &str = "/private/cancel_all_by_currency";
99 pub const CANCEL_ALL_BY_CURRENCY_PAIR: &str = "/private/cancel_all_by_currency_pair";
101 pub const CANCEL_ALL_BY_INSTRUMENT: &str = "/private/cancel_all_by_instrument";
103 pub const CANCEL_ALL_BY_KIND_OR_TYPE: &str = "/private/cancel_all_by_kind_or_type";
105 pub const CANCEL_BY_LABEL: &str = "/private/cancel_by_label";
107 pub const EDIT: &str = "/private/edit";
109 pub const CANCEL_QUOTES: &str = "/private/cancel_quotes";
111
112 pub const GET_ACCOUNT_SUMMARY: &str = "/private/get_account_summary";
115 pub const GET_POSITION: &str = "/private/get_position";
117 pub const GET_POSITIONS: &str = "/private/get_positions";
119 pub const GET_SUBACCOUNTS: &str = "/private/get_subaccounts";
121 pub const GET_TRANSACTION_LOG: &str = "/private/get_transaction_log";
123 pub const GET_DEPOSITS: &str = "/private/get_deposits";
125 pub const GET_WITHDRAWALS: &str = "/private/get_withdrawals";
127 pub const SUBMIT_TRANSFER_TO_SUBACCOUNT: &str = "/private/submit_transfer_to_subaccount";
129 pub const SUBMIT_TRANSFER_TO_USER: &str = "/private/submit_transfer_to_user";
131
132 pub const GET_OPEN_ORDERS: &str = "/private/get_open_orders";
135 pub const GET_OPEN_ORDERS_BY_LABEL: &str = "/private/get_open_orders_by_label";
137 pub const GET_ORDER_STATE: &str = "/private/get_order_state";
139 pub const GET_OPEN_ORDERS_BY_CURRENCY: &str = "/private/get_open_orders_by_currency";
141 pub const GET_OPEN_ORDERS_BY_INSTRUMENT: &str = "/private/get_open_orders_by_instrument";
143 pub const GET_ORDER_HISTORY_BY_CURRENCY: &str = "/private/get_order_history_by_currency";
145 pub const GET_ORDER_HISTORY_BY_INSTRUMENT: &str = "/private/get_order_history_by_instrument";
147
148 pub const GET_USER_TRADES_BY_INSTRUMENT: &str = "/private/get_user_trades_by_instrument";
151 pub const GET_USER_TRADES_BY_CURRENCY: &str = "/private/get_user_trades_by_currency";
153 pub const GET_USER_TRADES_BY_CURRENCY_AND_TIME: &str =
155 "/private/get_user_trades_by_currency_and_time";
156 pub const GET_USER_TRADES_BY_INSTRUMENT_AND_TIME: &str =
158 "/private/get_user_trades_by_instrument_and_time";
159 pub const GET_USER_TRADES_BY_ORDER: &str = "/private/get_user_trades_by_order";
161}
162
163pub mod headers {
165 pub const CONTENT_TYPE: &str = "Content-Type";
167 pub const APPLICATION_JSON: &str = "application/json";
169 pub const AUTHORIZATION: &str = "Authorization";
171 pub const USER_AGENT: &str = "User-Agent";
173}