unofficial_tabdeal_api.models ============================= .. py:module:: unofficial_tabdeal_api.models .. autoapi-nested-parse:: This module holds the data models for the API. Classes ------- .. autoapisummary:: unofficial_tabdeal_api.models.PairModel unofficial_tabdeal_api.models.TriggerPriceModel unofficial_tabdeal_api.models.CurrencyModel unofficial_tabdeal_api.models.CurrencyCreditModel unofficial_tabdeal_api.models.IsolatedSymbolDetailsModel unofficial_tabdeal_api.models.MarginOpenOrderModel unofficial_tabdeal_api.models.MarginOrderModel unofficial_tabdeal_api.models.TransferFromMarginModel unofficial_tabdeal_api.models.TransferToMarginModel unofficial_tabdeal_api.models.WalletDetailsModel Module Contents --------------- .. py:class:: PairModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for the isolated symbol pair details. .. py:attribute:: base_precision_visible :type: int Precision of the base currency visible to user, e.g. 8 .. py:attribute:: first_currency_precision :type: int Precision of the first currency, e.g. 8 .. py:attribute:: id :type: int Pair ID .. py:attribute:: last_trade_price :type: decimal.Decimal NOT YET KNOWN .. py:attribute:: price_precision :type: int Precision of the price, e.g. 2 .. py:attribute:: quote_precision_visible :type: int Precision of the quote currency visible to user, e.g. 2 .. py:attribute:: representation_name :type: str Representation name of the pair, e.g. بیت‌ کوین-تتر .. py:attribute:: symbol :type: str Symbol of the pair, e.g. BTC_USDT .. py:attribute:: symbol_fa :type: str Symbol in Persian, e.g. بیت‌ کوین-تتر .. py:class:: TriggerPriceModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for the trigger price details. .. py:attribute:: sl_price :type: decimal.Decimal | None :value: None Stop Loss price, e.g. 9500.00 .. py:attribute:: tp_price :type: decimal.Decimal | None :value: None Take Profit price, e.g. 10500.00 .. py:class:: CurrencyModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for the currency details. .. py:attribute:: id :type: int | None :value: None ID of the currency. server MAY NOT SEND this property in some requests, Therefore, it defaults to `None` if not provided AVAILABLE: `get_margin_all_open_orders` NOT AVAILABLE: `get_isolated_symbol_details` .. py:attribute:: name :type: str Name of the currency, e.g. 'TetherUS' .. py:attribute:: name_fa :type: str Name of the currency in Persian, e.g. 'تتر' .. py:attribute:: precision :type: int | None :value: None Precision of the currency, e.g. 8. server MAY NOT SEND this property in some requests, Therefore, it defaults to `None` if not provided. AVAILABLE: `get_margin_all_open_orders` NOT AVAILABLE: `get_isolated_symbol_details` .. py:attribute:: representation_name :type: str Representation name of the currency, e.g. 'تتر' .. py:attribute:: symbol :type: str Symbol of the currency, e.g. 'USDT' .. py:class:: CurrencyCreditModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for the currency credit details. .. py:attribute:: amount :type: decimal.Decimal Total amount of the currency, e.g. 1100.00 .. py:attribute:: available_amount :type: decimal.Decimal Available amount of the currency, e.g. 1000.00 .. py:attribute:: average_entry_price :type: decimal.Decimal Average entry price of the currency, e.g. 10000.00 .. py:attribute:: borrow :type: decimal.Decimal NOT YET KNOWN .. py:attribute:: currency :type: CurrencyModel Currency details of the credit .. py:attribute:: frozen_amount :type: decimal.Decimal Frozen amount of the currency, e.g. 100.00 .. py:attribute:: genre :type: str | None :value: None Genre of the currency, e.g. 'IsolatedMargin' server MAY NOT SEND this property in some requests, Therefore, it defaults to `None` if not provided AVAILABLE: `get_isolated_symbol_details` NOT AVAILABLE: `get_margin_all_open_orders` .. py:attribute:: genre_fa :type: str | None :value: None Genre of the currency in Persian, e.g. 'کیف پول معامله اهرم‌دار Isolated' server MAY NOT SEND this property in some requests, Therefore, it defaults to `None` if not provided AVAILABLE: `get_isolated_symbol_details` NOT AVAILABLE: `get_margin_all_open_orders` .. py:attribute:: interest :type: decimal.Decimal Interest on the currency, e.g. 10.00 .. py:attribute:: irt_average_entry_price :type: decimal.Decimal Average entry price of the currency in IRT, e.g. 100000000.00 .. py:attribute:: irt_value :type: decimal.Decimal Amount of credit in symbol as IRT, e.g. 10000000.00 .. py:attribute:: is_borrowable :type: bool Whether the currency is borrowable, e.g. True or False .. py:attribute:: max_transfer_out_amount :type: decimal.Decimal | None :value: None Max amount of the currency that can be transferred out, e.g. 900.00 server MAY NOT SEND this property in some requests, Therefore, it defaults to `None` if not provided AVAILABLE: `get_isolated_symbol_details` NOT AVAILABLE: `get_margin_all_open_orders` .. py:attribute:: pair :type: PairModel | None :value: None Pair details of the credit server MAY NOT SEND this property in some requests, Therefore, it defaults to `None` if not provided AVAILABLE: `get_isolated_symbol_details` NOT AVAILABLE: `get_margin_all_open_orders` .. py:attribute:: position :type: decimal.Decimal NOT YET KNOWN .. py:attribute:: position_usdt_value :type: decimal.Decimal | None :value: None Value of the position as USDT. For example, 93427.9345 server MAY NOT SEND this property in some requests, Therefore, it defaults to `None` if not provided. AVAILABLE: `get_margin_all_open_orders` NOT AVAILABLE: `get_isolated_symbol_details` .. py:attribute:: position_irt_value :type: decimal.Decimal | None :value: None Value of the position as IRT. For example, 3255.787 server MAY NOT SEND this property in some requests, Therefore, it defaults to `None` if not provided. AVAILABLE: `get_margin_all_open_orders` NOT AVAILABLE: `get_isolated_symbol_details` .. py:attribute:: position_value :type: decimal.Decimal NOT YET KNOWN .. py:attribute:: usdt_value :type: decimal.Decimal Amount of credit in symbol as USDT, e.g. 1000.00 .. py:class:: IsolatedSymbolDetailsModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for isolated symbol details. .. py:attribute:: active :type: bool Whether the isolated symbol is active for trading, e.g. True or False .. py:attribute:: borrow_active :type: bool Whether the isolated symbol is active for borrowing credit, e.g. True or False .. py:attribute:: break_even_point :type: decimal.Decimal Break-even point for the isolated symbol, e.g. 10000.00 This is the point where the profit/loss is zero. .. py:attribute:: first_currency_borrowable_amount :type: decimal.Decimal Borrowable amount of the first currency, e.g. 1000.00 .. py:attribute:: first_currency_credit :type: CurrencyCreditModel Currency details of first symbol. .. py:attribute:: id :type: int ID of the isolated symbol market, e.g. 157092 .. py:attribute:: margin_active :type: bool Whether the isolated symbol is active for margin trading, e.g. True or False .. py:attribute:: max_margin_level :type: decimal.Decimal Max margin level for the isolated symbol, e.g. 60.0 This is defined by symbol and user trading amount .. py:attribute:: pair :type: PairModel Isolated symbol pair details. .. py:attribute:: second_currency_borrowable_amount :type: decimal.Decimal Borrowable amount of the second currency, e.g. 1000.00 .. py:attribute:: second_currency_credit :type: CurrencyCreditModel Currency details of second symbol, for example, USDT in BTCUSDT .. py:attribute:: trader :type: int ID of the trader, e.g. 5403 .. py:attribute:: transfer_active :type: bool Whether the isolated symbol is active for transferring credit, e.g. True or False .. py:attribute:: trigger_price :type: TriggerPriceModel User-set trigger price points for Stop loss and Take profit. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:class:: MarginOpenOrderModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for open margin orders. .. py:attribute:: break_even_point :type: decimal.Decimal Break-even point for the isolated symbol, e.g. 10000.00 This is the point where the profit/loss is zero. .. py:attribute:: first_currency_credit :type: CurrencyCreditModel Currency details of first symbol, for example, BTC in BTCUSDT .. py:attribute:: id :type: int ID of the isolated symbol market. for example, 157092. .. py:attribute:: is_long :type: bool Whether the order is Long(True) or not (Short = False) .. py:attribute:: is_order_filled :type: bool Whether the order is filled completely(True) or not(False) .. py:attribute:: pair :type: PairModel Isolated symbol pair details. .. py:attribute:: risk_name :type: str Amount of risk in string, determined by server. For example, 'Moderate' .. py:attribute:: second_currency_credit :type: CurrencyCreditModel Currency details of second symbol, for example, USDT in BTCUSDT .. py:attribute:: trigger_price :type: TriggerPriceModel User-set trigger price points for Stop loss and Take profit. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:class:: MarginOrderModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` This is the class storing information about a margin order. .. py:attribute:: deposit_amount :type: decimal.Decimal Deposit amount for the order, e.g. 1000.00 .. py:attribute:: isolated_symbol :type: str Symbol of the order, e.g. BTCUSDT .. py:attribute:: margin_level :type: decimal.Decimal Margin level of the order, Must be greater than 0 and less than or equal to MAX_ALLOWED_MARGIN_LEVEL .. py:attribute:: order_price :type: decimal.Decimal Price of the order, e.g. 10000.00 .. py:attribute:: order_side :type: unofficial_tabdeal_api.enums.OrderSide Side of the order, either BUY or SELL .. py:attribute:: stop_loss_percent :type: decimal.Decimal Percentile of tolerate-able loss, e.g. 5 for 5% .. py:attribute:: take_profit_percent :type: decimal.Decimal Percentile of expected profit, e.g. 10 for 10% .. py:class:: TransferFromMarginModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for transferring USDT from margin asset. .. py:attribute:: account_genre :type: str :value: 'IsolatedMargin' Genre of the account, e.g. 'IsolatedMargin', 'Spot', ... .. py:attribute:: amount :type: decimal.Decimal Amount to transfer, must be a positive decimal value. .. py:attribute:: currency_symbol :type: str :value: 'USDT' Currency symbol for the transfer, defaults to 'USDT'. .. py:attribute:: other_account_genre :type: str :value: 'Main' Genre of the other account, e.g. 'Main'. .. py:attribute:: pair_symbol :type: str Symbol of the trading pair, e.g. 'BTCUSDT'. .. py:attribute:: transfer_direction :type: str :value: 'Out' Direction of transfer, e.g. 'Out' for transferring out of margin asset. .. py:class:: TransferToMarginModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for transferring USDT to margin asset. .. py:attribute:: amount :type: int :value: 0 A default value that is always 0 for no reason. .. py:attribute:: currency_symbol :type: str :value: 'USDT' Currency symbol for the transfer, defaults to 'USDT'. .. py:attribute:: pair_symbol :type: str Symbol of the trading pair, e.g. 'BTCUSDT'. .. py:attribute:: transfer_amount_from_main :type: decimal.Decimal Amount to transfer from main account, must be a positive decimal value. .. py:class:: WalletDetailsModel(/, **data) Bases: :py:obj:`pydantic.BaseModel` Model for wallet details. .. py:attribute:: tether_us :type: decimal.Decimal Amount of Tether US in the wallet, must be a positive decimal value. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].