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 pub const GET_MARK_PRICE_HISTORY: &str = "/public/get_mark_price_history";
89 pub const GET_SUPPORTED_INDEX_NAMES: &str = "/public/get_supported_index_names";
91 pub const GET_TRADE_VOLUMES: &str = "/public/get_trade_volumes";
93 pub const GET_VOLATILITY_INDEX_DATA: &str = "/public/get_volatility_index_data";
95 pub const GET_INDEX_CHART_DATA: &str = "/public/get_index_chart_data";
97
98 pub const GET_COMBO_DETAILS: &str = "/public/get_combo_details";
101 pub const GET_COMBO_IDS: &str = "/public/get_combo_ids";
103 pub const GET_COMBOS: &str = "/public/get_combos";
105
106 pub const CREATE_COMBO: &str = "/private/create_combo";
109 pub const GET_LEG_PRICES: &str = "/private/get_leg_prices";
111
112 pub const BUY: &str = "/private/buy";
115 pub const SELL: &str = "/private/sell";
117 pub const CANCEL: &str = "/private/cancel";
119 pub const CANCEL_ALL: &str = "/private/cancel_all";
121 pub const CANCEL_ALL_BY_CURRENCY: &str = "/private/cancel_all_by_currency";
123 pub const CANCEL_ALL_BY_CURRENCY_PAIR: &str = "/private/cancel_all_by_currency_pair";
125 pub const CANCEL_ALL_BY_INSTRUMENT: &str = "/private/cancel_all_by_instrument";
127 pub const CANCEL_ALL_BY_KIND_OR_TYPE: &str = "/private/cancel_all_by_kind_or_type";
129 pub const CANCEL_BY_LABEL: &str = "/private/cancel_by_label";
131 pub const EDIT: &str = "/private/edit";
133 pub const EDIT_BY_LABEL: &str = "/private/edit_by_label";
135 pub const CANCEL_QUOTES: &str = "/private/cancel_quotes";
137 pub const CLOSE_POSITION: &str = "/private/close_position";
139 pub const GET_MARGINS: &str = "/private/get_margins";
141 pub const GET_MMP_CONFIG: &str = "/private/get_mmp_config";
143 pub const GET_MMP_STATUS: &str = "/private/get_mmp_status";
145 pub const SET_MMP_CONFIG: &str = "/private/set_mmp_config";
147 pub const RESET_MMP: &str = "/private/reset_mmp";
149 pub const GET_ORDER_MARGIN_BY_IDS: &str = "/private/get_order_margin_by_ids";
151 pub const GET_ORDER_STATE_BY_LABEL: &str = "/private/get_order_state_by_label";
153 pub const GET_SETTLEMENT_HISTORY_BY_CURRENCY: &str =
155 "/private/get_settlement_history_by_currency";
156 pub const GET_SETTLEMENT_HISTORY_BY_INSTRUMENT: &str =
158 "/private/get_settlement_history_by_instrument";
159 pub const GET_TRIGGER_ORDER_HISTORY: &str = "/private/get_trigger_order_history";
161
162 pub const GET_ACCOUNT_SUMMARY: &str = "/private/get_account_summary";
165 pub const GET_ACCOUNT_SUMMARIES: &str = "/private/get_account_summaries";
167 pub const GET_POSITION: &str = "/private/get_position";
169 pub const GET_POSITIONS: &str = "/private/get_positions";
171 pub const GET_SUBACCOUNTS: &str = "/private/get_subaccounts";
173 pub const GET_SUBACCOUNTS_DETAILS: &str = "/private/get_subaccounts_details";
175 pub const CREATE_SUBACCOUNT: &str = "/private/create_subaccount";
177 pub const REMOVE_SUBACCOUNT: &str = "/private/remove_subaccount";
179 pub const CHANGE_SUBACCOUNT_NAME: &str = "/private/change_subaccount_name";
181 pub const TOGGLE_SUBACCOUNT_LOGIN: &str = "/private/toggle_subaccount_login";
183 pub const SET_EMAIL_FOR_SUBACCOUNT: &str = "/private/set_email_for_subaccount";
185 pub const TOGGLE_NOTIFICATIONS_FROM_SUBACCOUNT: &str =
187 "/private/toggle_notifications_from_subaccount";
188 pub const GET_TRANSACTION_LOG: &str = "/private/get_transaction_log";
190 pub const GET_DEPOSITS: &str = "/private/get_deposits";
192 pub const GET_WITHDRAWALS: &str = "/private/get_withdrawals";
194 pub const SUBMIT_TRANSFER_TO_SUBACCOUNT: &str = "/private/submit_transfer_to_subaccount";
196 pub const SUBMIT_TRANSFER_TO_USER: &str = "/private/submit_transfer_to_user";
198 pub const GET_TRANSFERS: &str = "/private/get_transfers";
200 pub const CANCEL_TRANSFER_BY_ID: &str = "/private/cancel_transfer_by_id";
202 pub const SUBMIT_TRANSFER_BETWEEN_SUBACCOUNTS: &str =
204 "/private/submit_transfer_between_subaccounts";
205 pub const MOVE_POSITIONS: &str = "/private/move_positions";
207
208 pub const GET_OPEN_ORDERS: &str = "/private/get_open_orders";
211 pub const GET_OPEN_ORDERS_BY_LABEL: &str = "/private/get_open_orders_by_label";
213 pub const GET_ORDER_STATE: &str = "/private/get_order_state";
215 pub const GET_OPEN_ORDERS_BY_CURRENCY: &str = "/private/get_open_orders_by_currency";
217 pub const GET_OPEN_ORDERS_BY_INSTRUMENT: &str = "/private/get_open_orders_by_instrument";
219 pub const GET_ORDER_HISTORY_BY_CURRENCY: &str = "/private/get_order_history_by_currency";
221 pub const GET_ORDER_HISTORY_BY_INSTRUMENT: &str = "/private/get_order_history_by_instrument";
223
224 pub const GET_USER_TRADES_BY_INSTRUMENT: &str = "/private/get_user_trades_by_instrument";
227 pub const GET_USER_TRADES_BY_CURRENCY: &str = "/private/get_user_trades_by_currency";
229 pub const GET_USER_TRADES_BY_CURRENCY_AND_TIME: &str =
231 "/private/get_user_trades_by_currency_and_time";
232 pub const GET_USER_TRADES_BY_INSTRUMENT_AND_TIME: &str =
234 "/private/get_user_trades_by_instrument_and_time";
235 pub const GET_USER_TRADES_BY_ORDER: &str = "/private/get_user_trades_by_order";
237
238 pub const CREATE_API_KEY: &str = "/private/create_api_key";
241 pub const EDIT_API_KEY: &str = "/private/edit_api_key";
243 pub const DISABLE_API_KEY: &str = "/private/disable_api_key";
245 pub const ENABLE_API_KEY: &str = "/private/enable_api_key";
247 pub const LIST_API_KEYS: &str = "/private/list_api_keys";
249 pub const REMOVE_API_KEY: &str = "/private/remove_api_key";
251 pub const RESET_API_KEY: &str = "/private/reset_api_key";
253 pub const CHANGE_API_KEY_NAME: &str = "/private/change_api_key_name";
255 pub const CHANGE_SCOPE_IN_API_KEY: &str = "/private/change_scope_in_api_key";
257
258 pub const SAVE_ADDRESS_BENEFICIARY: &str = "/private/save_address_beneficiary";
261 pub const DELETE_ADDRESS_BENEFICIARY: &str = "/private/delete_address_beneficiary";
263 pub const GET_ADDRESS_BENEFICIARY: &str = "/private/get_address_beneficiary";
265 pub const LIST_ADDRESS_BENEFICIARIES: &str = "/private/list_address_beneficiaries";
267 pub const SET_CLEARANCE_ORIGINATOR: &str = "/private/set_clearance_originator";
269
270 pub const WITHDRAW: &str = "/private/withdraw";
273 pub const CANCEL_WITHDRAWAL: &str = "/private/cancel_withdrawal";
275 pub const CREATE_DEPOSIT_ADDRESS: &str = "/private/create_deposit_address";
277 pub const GET_CURRENT_DEPOSIT_ADDRESS: &str = "/private/get_current_deposit_address";
279 pub const ADD_TO_ADDRESS_BOOK: &str = "/private/add_to_address_book";
281 pub const REMOVE_FROM_ADDRESS_BOOK: &str = "/private/remove_from_address_book";
283 pub const UPDATE_IN_ADDRESS_BOOK: &str = "/private/update_in_address_book";
285 pub const GET_ADDRESS_BOOK: &str = "/private/get_address_book";
287
288 pub const GET_ACCESS_LOG: &str = "/private/get_access_log";
291 pub const GET_USER_LOCKS: &str = "/private/get_user_locks";
293 pub const LIST_CUSTODY_ACCOUNTS: &str = "/private/list_custody_accounts";
295 pub const SIMULATE_PORTFOLIO: &str = "/private/simulate_portfolio";
297 pub const PME_SIMULATE: &str = "/private/pme/simulate";
299 pub const CHANGE_MARGIN_MODEL: &str = "/private/change_margin_model";
301 pub const SET_SELF_TRADING_CONFIG: &str = "/private/set_self_trading_config";
303 pub const SET_DISABLED_TRADING_PRODUCTS: &str = "/private/set_disabled_trading_products";
305 pub const GET_ANNOUNCEMENTS: &str = "/public/get_announcements";
307 pub const GET_NEW_ANNOUNCEMENTS: &str = "/private/get_new_announcements";
309 pub const SET_ANNOUNCEMENT_AS_READ: &str = "/private/set_announcement_as_read";
311 pub const ENABLE_AFFILIATE_PROGRAM: &str = "/private/enable_affiliate_program";
313 pub const GET_AFFILIATE_PROGRAM_INFO: &str = "/private/get_affiliate_program_info";
315 pub const SET_EMAIL_LANGUAGE: &str = "/private/set_email_language";
317 pub const GET_EMAIL_LANGUAGE: &str = "/private/get_email_language";
319
320 pub const APPROVE_BLOCK_TRADE: &str = "/private/approve_block_trade";
323 pub const EXECUTE_BLOCK_TRADE: &str = "/private/execute_block_trade";
325 pub const GET_BLOCK_TRADE: &str = "/private/get_block_trade";
327 pub const GET_BLOCK_TRADE_REQUESTS: &str = "/private/get_block_trade_requests";
329 pub const GET_BLOCK_TRADES: &str = "/private/get_block_trades";
331 pub const GET_BROKER_TRADE_REQUESTS: &str = "/private/get_broker_trade_requests";
333 pub const GET_BROKER_TRADES: &str = "/private/get_broker_trades";
335 pub const INVALIDATE_BLOCK_TRADE_SIGNATURE: &str = "/private/invalidate_block_trade_signature";
337 pub const REJECT_BLOCK_TRADE: &str = "/private/reject_block_trade";
339 pub const SIMULATE_BLOCK_TRADE: &str = "/private/simulate_block_trade";
341 pub const VERIFY_BLOCK_TRADE: &str = "/private/verify_block_trade";
343
344 pub const GET_BLOCK_RFQ_TRADES: &str = "/public/get_block_rfq_trades";
347 pub const CREATE_BLOCK_RFQ: &str = "/private/create_block_rfq";
349 pub const CANCEL_BLOCK_RFQ: &str = "/private/cancel_block_rfq";
351 pub const ACCEPT_BLOCK_RFQ: &str = "/private/accept_block_rfq";
353 pub const GET_BLOCK_RFQS: &str = "/private/get_block_rfqs";
355 pub const GET_BLOCK_RFQ_QUOTES: &str = "/private/get_block_rfq_quotes";
357 pub const ADD_BLOCK_RFQ_QUOTE: &str = "/private/add_block_rfq_quote";
359 pub const EDIT_BLOCK_RFQ_QUOTE: &str = "/private/edit_block_rfq_quote";
361 pub const CANCEL_BLOCK_RFQ_QUOTE: &str = "/private/cancel_block_rfq_quote";
363 pub const CANCEL_ALL_BLOCK_RFQ_QUOTES: &str = "/private/cancel_all_block_rfq_quotes";
365}
366
367pub mod headers {
369 pub const CONTENT_TYPE: &str = "Content-Type";
371 pub const APPLICATION_JSON: &str = "application/json";
373 pub const AUTHORIZATION: &str = "Authorization";
375 pub const USER_AGENT: &str = "User-Agent";
377}