From 672048bd9c78067400ab35c85cb0dbc7d355d2dc Mon Sep 17 00:00:00 2001 From: "johnny.wang" Date: Thu, 15 Jan 2026 10:10:39 +0800 Subject: [PATCH] add missing endpoints --- pybit/_v5_account.py | 161 +++++++++++++++++++ pybit/_v5_earn.py | 38 +++++ pybit/_v5_fiat.py | 132 ++++++++++++++++ pybit/_v5_institutional_loan.py | 17 ++ pybit/_v5_market.py | 88 +++++++++++ pybit/_v5_rfq.py | 264 ++++++++++++++++++++++++++++++++ pybit/_v5_spot_margin_trade.py | 68 ++++++++ pybit/_v5_user.py | 16 ++ pybit/account.py | 9 ++ pybit/earn.py | 2 + pybit/fiat.py | 14 ++ pybit/institutional_loan.py | 1 + pybit/market.py | 5 + pybit/rfq.py | 22 +++ pybit/spot_margin_trade.py | 5 + pybit/unified_trading.py | 7 +- pybit/user.py | 1 + 17 files changed, 849 insertions(+), 1 deletion(-) create mode 100644 pybit/_v5_fiat.py create mode 100644 pybit/_v5_rfq.py create mode 100644 pybit/fiat.py create mode 100644 pybit/rfq.py diff --git a/pybit/_v5_account.py b/pybit/_v5_account.py index 349bee2..5a9d7cf 100644 --- a/pybit/_v5_account.py +++ b/pybit/_v5_account.py @@ -314,3 +314,164 @@ def get_mmp_state(self, **kwargs): query=kwargs, auth=True, ) + + def set_no_convert_repay(self, **kwargs): + """Turn off auto repayment using liability. Available only for UTA 2.0. + + Required args: + noConvertRepay (string): "on" or "off" + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/account/set-no-convert-repay + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{Account.SET_NO_CONVERT_REPAY}", + query=kwargs, + auth=True, + ) + + def borrow(self, **kwargs): + """Borrow a certain amount of a coin. + + Required args: + coin (string): Coin name + qty (string): Amount to borrow + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/account/borrow + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{Account.BORROW}", + query=kwargs, + auth=True, + ) + + def get_instruments_info(self, **kwargs): + """Get available instruments info for unified account. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/account/instruments-info + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Account.GET_INSTRUMENTS_INFO}", + query=kwargs, + auth=True, + ) + + def repay(self, **kwargs): + """Repay a certain amount of a coin. + + Required args: + coin (string): Coin name + qty (string): Amount to repay + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/account/repay + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{Account.REPAY}", + query=kwargs, + auth=True, + ) + + def query_dcp_info(self, **kwargs): + """Query the DCP configuration of the account. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/account/dcp-info + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Account.QUERY_DCP_INFO}", + query=kwargs, + auth=True, + ) + + def set_hedging_mode(self, **kwargs): + """Set hedging mode for the account. + + Required args: + hedgingMode (string): "on" or "off" + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/account/set-hedging-mode + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{Account.SET_HEDGING_MODE}", + query=kwargs, + auth=True, + ) + + def get_smp_group(self, **kwargs): + """Get the SMP group ID of the account. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/account/smp-group + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Account.GET_SMP_GROUP}", + query=kwargs, + auth=True, + ) + + def get_user_setting_config(self, **kwargs): + """Get user setting configuration. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/account/user-setting-config + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Account.GET_USER_SETTING_CONFIG}", + query=kwargs, + auth=True, + ) + + def set_limit_price_action(self, **kwargs): + """Set the limit price action behavior. + + Required args: + limitPxAction (string): "ForceAdjust" or "RejectOrder" + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/account/set-limit-px-action + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{Account.SET_LIMIT_PRICE_ACTION}", + query=kwargs, + auth=True, + ) diff --git a/pybit/_v5_earn.py b/pybit/_v5_earn.py index 98d410b..cf0dc6c 100644 --- a/pybit/_v5_earn.py +++ b/pybit/_v5_earn.py @@ -75,3 +75,41 @@ def get_staked_position(self, **kwargs): query=kwargs, auth=True, ) + + def get_yield(self, **kwargs): + """Get the yield information for earn products. + + Required args: + category (string): FlexibleSaving + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/earn/yield + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Earn.GET_YIELD}", + query=kwargs, + auth=True, + ) + + def get_hourly_yield(self, **kwargs): + """Get hourly yield information for earn products. + + Required args: + category (string): FlexibleSaving + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/earn/hourly-yield + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Earn.GET_HOURLY_YIELD}", + query=kwargs, + auth=True, + ) diff --git a/pybit/_v5_fiat.py b/pybit/_v5_fiat.py new file mode 100644 index 0000000..42565d2 --- /dev/null +++ b/pybit/_v5_fiat.py @@ -0,0 +1,132 @@ +from ._http_manager import _V5HTTPManager +from .fiat import Fiat + + +class FiatHTTP(_V5HTTPManager): + def get_fiat_coin_list(self, **kwargs): + """Get the list of supported fiat coins. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/fiat/coin-list + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Fiat.GET_COIN_LIST}", + query=kwargs, + auth=True, + ) + + def get_fiat_reference_price(self, **kwargs): + """Get the reference price for fiat trading. + + Required args: + fiatCoin (string): Fiat coin name + cryptoCoin (string): Crypto coin name + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/fiat/reference-price + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Fiat.GET_REFERENCE_PRICE}", + query=kwargs, + auth=True, + ) + + def request_fiat_quote(self, **kwargs): + """Request a quote for fiat trading. + + Required args: + fiatCoin (string): Fiat coin name + cryptoCoin (string): Crypto coin name + side (string): "buy" or "sell" + size (string): Amount + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/fiat/quote-apply + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{Fiat.REQUEST_QUOTE}", + query=kwargs, + auth=True, + ) + + def execute_fiat_trade(self, **kwargs): + """Execute a fiat trade based on a quote. + + Required args: + quoteId (string): Quote ID from quote-apply + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/fiat/trade-execute + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{Fiat.EXECUTE_TRADE}", + query=kwargs, + auth=True, + ) + + def query_fiat_trade(self, **kwargs): + """Query the status of a fiat trade. + + Required args: + orderId (string): Order ID + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/fiat/trade-query + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Fiat.QUERY_TRADE}", + query=kwargs, + auth=True, + ) + + def get_fiat_trade_history(self, **kwargs): + """Get fiat trade history. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/fiat/trade-history + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Fiat.GET_TRADE_HISTORY}", + query=kwargs, + auth=True, + ) + + def get_fiat_balance(self, **kwargs): + """Get fiat balance. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/fiat/balance-query + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Fiat.GET_BALANCE}", + query=kwargs, + auth=True, + ) diff --git a/pybit/_v5_institutional_loan.py b/pybit/_v5_institutional_loan.py index b0be380..9f4f738 100644 --- a/pybit/_v5_institutional_loan.py +++ b/pybit/_v5_institutional_loan.py @@ -98,3 +98,20 @@ def bind_or_unbind_uid(self, **kwargs) -> dict: query=kwargs, auth=True, ) + + def repay_loan(self, **kwargs) -> dict: + """ + Repay the institutional loan. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/otc/repay-loan + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{InsLoan.REPAY_LOAN}", + query=kwargs, + auth=True, + ) diff --git a/pybit/_v5_market.py b/pybit/_v5_market.py index e910b56..a7b79e3 100644 --- a/pybit/_v5_market.py +++ b/pybit/_v5_market.py @@ -314,3 +314,91 @@ def get_price_limit(self, **kwargs): path=f"{self.endpoint}{Market.GET_PRICE_LIMIT}", query=kwargs, ) + + def get_rpi_orderbook(self, **kwargs): + """Query RPI orderbook data. + + Required args: + category (string): Product type. spot, linear, inverse + symbol (string): Symbol name + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/market/orderbook-rpi + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Market.GET_RPI_ORDERBOOK}", + query=kwargs, + ) + + def get_new_delivery_price(self, **kwargs): + """Get the delivery price for futures. + + Required args: + category (string): Product type. linear, inverse + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/market/delivery-price + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Market.GET_NEW_DELIVERY_PRICE}", + query=kwargs, + ) + + def get_index_price_components(self, **kwargs): + """Get index price components. + + Required args: + symbol (string): Symbol name + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/market/index-price-components + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Market.GET_INDEX_PRICE_COMPONENTS}", + query=kwargs, + ) + + def get_adl_alert(self, **kwargs): + """Get ADL alert information. + + Required args: + coin (string): Coin name + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/market/adl-alert + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Market.GET_ADL_ALERT}", + query=kwargs, + ) + + def get_fee_group_info(self, **kwargs): + """Get fee group information. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/market/fee-group-info + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{Market.GET_FEE_GROUP_INFO}", + query=kwargs, + ) diff --git a/pybit/_v5_rfq.py b/pybit/_v5_rfq.py new file mode 100644 index 0000000..fc93312 --- /dev/null +++ b/pybit/_v5_rfq.py @@ -0,0 +1,264 @@ +from ._http_manager import _V5HTTPManager +from .rfq import RFQ + + +class RFQHTTP(_V5HTTPManager): + def create_rfq(self, **kwargs): + """Create a request for quote (RFQ). + + Required args: + baseCoin (string): Base coin + rfqType (string): RFQ type + legs (array): Array of legs + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/create-rfq + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{RFQ.CREATE_RFQ}", + query=kwargs, + auth=True, + ) + + def get_rfq_config(self, **kwargs): + """Get RFQ configuration. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/config + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{RFQ.GET_CONFIG}", + query=kwargs, + auth=True, + ) + + def cancel_rfq(self, **kwargs): + """Cancel an RFQ. + + Required args: + rfqId (string): RFQ ID + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/cancel-rfq + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{RFQ.CANCEL_RFQ}", + query=kwargs, + auth=True, + ) + + def cancel_all_rfq(self, **kwargs): + """Cancel all RFQs. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/cancel-all-rfq + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{RFQ.CANCEL_ALL_RFQ}", + query=kwargs, + auth=True, + ) + + def create_quote(self, **kwargs): + """Create a quote for an RFQ. + + Required args: + rfqId (string): RFQ ID + legs (array): Array of legs with prices + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/create-quote + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{RFQ.CREATE_QUOTE}", + query=kwargs, + auth=True, + ) + + def execute_quote(self, **kwargs): + """Execute a quote. + + Required args: + quoteId (string): Quote ID + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/execute-quote + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{RFQ.EXECUTE_QUOTE}", + query=kwargs, + auth=True, + ) + + def cancel_quote(self, **kwargs): + """Cancel a quote. + + Required args: + quoteId (string): Quote ID + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/cancel-quote + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{RFQ.CANCEL_QUOTE}", + query=kwargs, + auth=True, + ) + + def cancel_all_quotes(self, **kwargs): + """Cancel all quotes. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/cancel-all-quotes + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{RFQ.CANCEL_ALL_QUOTES}", + query=kwargs, + auth=True, + ) + + def get_rfq_realtime(self, **kwargs): + """Get active RFQs in realtime. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/rfq-realtime + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{RFQ.GET_RFQ_REALTIME}", + query=kwargs, + auth=True, + ) + + def get_rfq_list(self, **kwargs): + """Get RFQ list history. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/rfq-list + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{RFQ.GET_RFQ_LIST}", + query=kwargs, + auth=True, + ) + + def get_quote_realtime(self, **kwargs): + """Get active quotes in realtime. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/quote-realtime + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{RFQ.GET_QUOTE_REALTIME}", + query=kwargs, + auth=True, + ) + + def get_quote_list(self, **kwargs): + """Get quote list history. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/quote-list + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{RFQ.GET_QUOTE_LIST}", + query=kwargs, + auth=True, + ) + + def get_trade_list(self, **kwargs): + """Get RFQ trade list. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/trade-list + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{RFQ.GET_TRADE_LIST}", + query=kwargs, + auth=True, + ) + + def get_public_trades(self, **kwargs): + """Get public RFQ trades. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/public-trades + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{RFQ.GET_PUBLIC_TRADES}", + query=kwargs, + ) + + def accept_other_quote(self, **kwargs): + """Accept another market maker's quote. + + Required args: + quoteId (string): Quote ID + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/rfq/accept-other-quote + """ + return self._submit_request( + method="POST", + path=f"{self.endpoint}{RFQ.ACCEPT_OTHER_QUOTE}", + query=kwargs, + auth=True, + ) diff --git a/pybit/_v5_spot_margin_trade.py b/pybit/_v5_spot_margin_trade.py index baaf2a1..11978b6 100644 --- a/pybit/_v5_spot_margin_trade.py +++ b/pybit/_v5_spot_margin_trade.py @@ -309,3 +309,71 @@ def spot_margin_trade_normal_toggle_margin_trade(self, **kwargs): query=kwargs, auth=True, ) + + def spot_margin_trade_get_max_borrowable(self, **kwargs): + """UTA only. Get the maximum borrowable amount for spot margin. + + Required args: + coin (string): Coin name + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/spot-margin-uta/max-borrowable + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{SpotMarginTrade.GET_MAX_BORROWABLE}", + query=kwargs, + auth=True, + ) + + def spot_margin_trade_get_position_tiers(self, **kwargs): + """Get spot margin position tiers information. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/spot-margin-uta/position-tiers + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{SpotMarginTrade.GET_POSITION_TIERS}", + query=kwargs, + ) + + def spot_margin_trade_get_coin_state(self, **kwargs): + """Get spot margin coin state information. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/spot-margin-uta/coinstate + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{SpotMarginTrade.GET_COIN_STATE}", + query=kwargs, + ) + + def spot_margin_trade_get_repayment_available_amount(self, **kwargs): + """UTA only. Get repayment available amount. + + Required args: + coin (string): Coin name + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/spot-margin-uta/repayment-available-amount + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{SpotMarginTrade.GET_REPAYMENT_AVAILABLE_AMOUNT}", + query=kwargs, + auth=True, + ) diff --git a/pybit/_v5_user.py b/pybit/_v5_user.py index bc14dcb..3c816aa 100644 --- a/pybit/_v5_user.py +++ b/pybit/_v5_user.py @@ -268,3 +268,19 @@ def get_uid_wallet_type(self, **kwargs): query=kwargs, auth=True, ) + + def get_escrow_sub_members(self, **kwargs): + """Get the list of escrow sub members. + + Returns: + Request results as dictionary. + + Additional information: + https://bybit-exchange.github.io/docs/v5/user/escrow-sub-members + """ + return self._submit_request( + method="GET", + path=f"{self.endpoint}{User.GET_ESCROW_SUB_MEMBERS}", + query=kwargs, + auth=True, + ) diff --git a/pybit/account.py b/pybit/account.py index fbe9b19..e1f11c4 100644 --- a/pybit/account.py +++ b/pybit/account.py @@ -19,6 +19,15 @@ class Account(str, Enum): SET_MMP = "/v5/account/mmp-modify" RESET_MMP = "/v5/account/mmp-reset" GET_MMP_STATE = "/v5/account/mmp-state" + SET_NO_CONVERT_REPAY = "/v5/account/no-convert-repay" + BORROW = "/v5/account/borrow" + GET_INSTRUMENTS_INFO = "/v5/account/instruments-info" + REPAY = "/v5/account/repay" + QUERY_DCP_INFO = "/v5/account/query-dcp-info" + SET_HEDGING_MODE = "/v5/account/set-hedging-mode" + GET_SMP_GROUP = "/v5/account/smp-group" + GET_USER_SETTING_CONFIG = "/v5/account/user-setting-config" + SET_LIMIT_PRICE_ACTION = "/v5/account/set-limit-px-action" def __str__(self) -> str: return self.value diff --git a/pybit/earn.py b/pybit/earn.py index 5d78e9b..356106d 100644 --- a/pybit/earn.py +++ b/pybit/earn.py @@ -6,6 +6,8 @@ class Earn(str, Enum): STAKE_OR_REDEEM = "/v5/earn/place-order" GET_STAKE_OR_REDEMPTION_HISTORY = "/v5/earn/order" GET_STAKED_POSITION = "/v5/earn/position" + GET_YIELD = "/v5/earn/yield" + GET_HOURLY_YIELD = "/v5/earn/hourly-yield" def __str__(self) -> str: return self.value diff --git a/pybit/fiat.py b/pybit/fiat.py new file mode 100644 index 0000000..23b80f8 --- /dev/null +++ b/pybit/fiat.py @@ -0,0 +1,14 @@ +from enum import Enum + + +class Fiat(str, Enum): + GET_COIN_LIST = "/v5/fiat/query-coin-list" + GET_REFERENCE_PRICE = "/v5/fiat/reference-price" + REQUEST_QUOTE = "/v5/fiat/quote-apply" + EXECUTE_TRADE = "/v5/fiat/trade-execute" + QUERY_TRADE = "/v5/fiat/trade-query" + GET_TRADE_HISTORY = "/v5/fiat/query-trade-history" + GET_BALANCE = "/v5/fiat/balance-query" + + def __str__(self) -> str: + return self.value diff --git a/pybit/institutional_loan.py b/pybit/institutional_loan.py index f809f2f..d317e79 100644 --- a/pybit/institutional_loan.py +++ b/pybit/institutional_loan.py @@ -8,6 +8,7 @@ class InstitutionalLoan(str, Enum): GET_REPAYMENT_ORDERS = "/v5/ins-loan/repaid-history" GET_LTV = "/v5/ins-loan/ltv-convert" BIND_OR_UNBIND_UID = "/v5/ins-loan/association-uid" + REPAY_LOAN = "/v5/ins-loan/repay-loan" def __str__(self) -> str: return self.value diff --git a/pybit/market.py b/pybit/market.py index 9f0b4ca..e577339 100644 --- a/pybit/market.py +++ b/pybit/market.py @@ -19,6 +19,11 @@ class Market(str, Enum): GET_OPTION_DELIVERY_PRICE = "/v5/market/delivery-price" GET_LONG_SHORT_RATIO = "/v5/market/account-ratio" GET_PRICE_LIMIT = "/v5/market/price-limit" + GET_RPI_ORDERBOOK = "/v5/market/rpi_orderbook" + GET_NEW_DELIVERY_PRICE = "/v5/market/new-delivery-price" + GET_INDEX_PRICE_COMPONENTS = "/v5/market/index-price-components" + GET_ADL_ALERT = "/v5/market/adlAlert" + GET_FEE_GROUP_INFO = "/v5/market/fee-group-info" def __str__(self) -> str: return self.value diff --git a/pybit/rfq.py b/pybit/rfq.py new file mode 100644 index 0000000..959b6ca --- /dev/null +++ b/pybit/rfq.py @@ -0,0 +1,22 @@ +from enum import Enum + + +class RFQ(str, Enum): + CREATE_RFQ = "/v5/rfq/create-rfq" + GET_CONFIG = "/v5/rfq/config" + CANCEL_RFQ = "/v5/rfq/cancel-rfq" + CANCEL_ALL_RFQ = "/v5/rfq/cancel-all-rfq" + CREATE_QUOTE = "/v5/rfq/create-quote" + EXECUTE_QUOTE = "/v5/rfq/execute-quote" + CANCEL_QUOTE = "/v5/rfq/cancel-quote" + CANCEL_ALL_QUOTES = "/v5/rfq/cancel-all-quotes" + GET_RFQ_REALTIME = "/v5/rfq/rfq-realtime" + GET_RFQ_LIST = "/v5/rfq/rfq-list" + GET_QUOTE_REALTIME = "/v5/rfq/quote-realtime" + GET_QUOTE_LIST = "/v5/rfq/quote-list" + GET_TRADE_LIST = "/v5/rfq/trade-list" + GET_PUBLIC_TRADES = "/v5/rfq/public-trades" + ACCEPT_OTHER_QUOTE = "/v5/rfq/accept-other-quote" + + def __str__(self) -> str: + return self.value diff --git a/pybit/spot_margin_trade.py b/pybit/spot_margin_trade.py index 63b40ff..7ef8cb6 100644 --- a/pybit/spot_margin_trade.py +++ b/pybit/spot_margin_trade.py @@ -22,6 +22,11 @@ class SpotMarginTrade(str, Enum): NORMAL_GET_BORROW_ORDER_DETAIL = "/v5/spot-cross-margin-trade/orders" NORMAL_GET_REPAYMENT_ORDER_DETAIL = "/v5/spot-cross-margin-trade/repay-history" NORMAL_TOGGLE_MARGIN_TRADE = "/v5/spot-cross-margin-trade/switch" + # Additional UTA endpoints + GET_MAX_BORROWABLE = "/v5/spot-margin-trade/max-borrowable" + GET_POSITION_TIERS = "/v5/spot-margin-trade/position-tiers" + GET_COIN_STATE = "/v5/spot-margin-trade/coinstate" + GET_REPAYMENT_AVAILABLE_AMOUNT = "/v5/spot-margin-trade/repayment-available-amount" def __str__(self) -> str: return self.value diff --git a/pybit/unified_trading.py b/pybit/unified_trading.py index 454f458..928fdc7 100644 --- a/pybit/unified_trading.py +++ b/pybit/unified_trading.py @@ -19,6 +19,8 @@ from ._v5_institutional_loan import InstitutionalLoanHTTP from ._v5_crypto_loan import CryptoLoanHTTP from ._v5_earn import EarnHTTP +from ._v5_fiat import FiatHTTP +from ._v5_rfq import RFQHTTP from ._websocket_stream import _V5WebSocketManager from ._websocket_trading import _V5TradeWebSocketManager from ._v5_spread import ( @@ -59,7 +61,10 @@ class HTTP( InstitutionalLoanHTTP, CryptoLoanHTTP, EarnHTTP, - RateLimitHTTP + FiatHTTP, + RFQHTTP, + RateLimitHTTP, + SpreadHTTP ): def __init__(self, **args): super().__init__(**args) diff --git a/pybit/user.py b/pybit/user.py index d1a7c73..599c423 100644 --- a/pybit/user.py +++ b/pybit/user.py @@ -17,6 +17,7 @@ class User(str, Enum): GET_UID_WALLET_TYPE = "/v5/user/get-member-type" DELETE_SUB_UID = "/v5/user/del-submember" GET_ALL_SUB_API_KEYS = "/v5/user/sub-apikeys" + GET_ESCROW_SUB_MEMBERS = "/v5/user/escrow_sub_members" def __str__(self) -> str: return self.value