├── test-requirements.txt ├── requirements.txt ├── tox.ini ├── docs ├── OrderResp.md ├── TransactionID.md ├── DebitFee.md ├── SystemTime.md ├── UidPushWithdrawalResp.md ├── TriggerOrderResponse.md ├── InlineResponse200.md ├── TriggerTime.md ├── UserSubRelation.md ├── CollateralCurrency.md ├── RebateUserInfo.md ├── AccountDetailKey.md ├── FindCoin.md ├── FuturesOrderBookItem.md ├── IndexConstituent.md ├── AutoRepaySetting.md ├── FundingRateRecord.md ├── InlineResponse2001.md ├── InsuranceRecord.md ├── MultiLoanItem.md ├── PatchUniLend.md ├── RepayResp.md ├── StructuredBuy.md ├── UnifiedLoanResult.md ├── UnifiedBorrowable.md ├── PartnerSubList.md ├── UniLendInterest.md ├── Eth2Swap.md ├── OptionsUnderlying.md ├── SubAccountBalance.md ├── UnifiedTransferable.md ├── MarginMarketLeverage.md ├── SubAccountCrossMarginBalance.md ├── UidPushWithdrawal.md ├── UnifiedCollateralRes.md ├── Eth2RateList.md ├── UnifiedLeverageSetting.md ├── BrokerCommission.md ├── StpGroupUser.md ├── BrokerTransaction.md ├── InlineObject.md ├── SubAccountMarginBalance.md ├── PartnerCommissionHistory.md ├── ConvertSmallBalance.md ├── PartnerTransactionHistory.md ├── SubAccountFuturesBalance.md ├── MultiCollateralItem.md ├── RepayMultiLoan.md ├── CollateralCurrentRate.md ├── FuturesIndexConstituents.md ├── FuturesPositionCrossMode.md ├── MarginTransferable.md ├── MaxUniBorrowable.md ├── SpotInsuranceHistory.md ├── UnifiedBorrowable1.md ├── StpGroup.md ├── TransferablesResult.md ├── DepositAddress.md ├── UnifiedMarginTiers.md ├── MockOptionsPosition.md ├── MultiRepayResp.md ├── SwapCoin.md ├── UnifiedDiscount.md ├── UnifiedHistoryLoanRateRates.md ├── UserTotalAmount.md ├── MockFuturesPosition.md ├── CountdownCancelAllSpotTask.md ├── CountdownCancelAllFuturesTask.md ├── FuturesFee.md ├── MultiLoanRepayItem.md ├── OpenOrders.md ├── UniCurrencyInterest.md ├── AgencyCommissionHistory.md ├── CollateralLoanCurrency.md ├── AgencyTransactionHistory.md ├── MarginLeverageTier.md ├── UnifiedRiskUnits.md ├── CollateralAdjustRes.md ├── CreateCollateralOrder.md ├── CrossMarginBalance.md ├── SpotAccount.md ├── CollateralAdjust.md ├── CollateralLtv.md ├── PositionCloseOrder.md ├── CollateralAlign.md ├── MockSpotBalance.md ├── PartnerSub.md ├── ProfitLossRange.md ├── RepayRecordTotalInterest.md ├── CountdownCancelAllOptionsTask.md ├── OptionsPositionCloseOrder.md ├── TransferOrderStatus.md ├── MockOptionsOrder.md ├── SmallBalance.md ├── FuturesPremiumIndex.md ├── OptionsUnderlyingTicker.md ├── CollateralCurrencyInfo.md ├── UnifiedDiscountTiers.md ├── FutureCancelOrderResult.md ├── MarginTiers.md ├── SubUserMode.md ├── UnifiedModeSet.md ├── SavedAddress.md ├── MockFuturesOrder.md ├── CollateralFixRate.md ├── MultiCollateralCurrency.md ├── AccountRateLimit.md ├── SmallBalanceHistory.md ├── BorrowCurrencyInfo.md ├── CreateUniLend.md ├── BrokerCommissionSubBrokerInfo.md ├── UniCurrencyPair.md ├── RepayLoan.md ├── SpotCurrencyChain.md ├── UserSub.md ├── SubAccountKeyPerms.md ├── UniLoanRecord.md ├── SpotPriceTrigger.md ├── CurrencyQuota.md ├── RepayRecordRepaidCurrency.md ├── CreateUniLoan.md ├── CollateralCurrencyRes.md ├── StructuredOrderList.md ├── RepayRecordCurrency.md ├── AccountBalance.md ├── AgencyCommission.md ├── UniCurrency.md ├── UnifiedLoan.md ├── FundingAccount.md ├── MarginAccountCurrency.md ├── MockSpotOrder.md ├── UniLoan.md ├── MultiCollateralRecordCurrency.md ├── MultiChainAddressItem.md ├── OptionsSettlement.md ├── OrderBook.md ├── RepayCurrencyRes.md ├── OptionsAccountBook.md ├── UnifiedCollateralReq.md ├── UnifiedSettings.md ├── TotalBalance.md ├── AccountDetail.md ├── DeliveryCandlestick.md ├── FuturesRiskLimitTier.md ├── FuturesOrderBook.md ├── PlaceDualInvestmentOrder.md ├── RepayRecordLeftInterest.md ├── OptionsMyTrade.md ├── UnifiedHistoryLoanRate.md ├── UniInterestRecord.md ├── RiskUnits.md ├── CrossMarginRepayment.md ├── OptionsPositionClose.md ├── FuturesCandlestick.md ├── FuturesLiqOrder.md ├── UnifiedCurrency.md ├── CancelOrderResult.md ├── UniLendRecord.md ├── UniLoanInterestRecord.md ├── AgencyTransaction.md ├── FuturesLimitRiskTiers.md ├── UnifiedLeverageConfig.md ├── UserLtvInfo.md ├── DeliverySettlement.md ├── MockRiskUnit.md ├── FlashSwapOrderRequest.md ├── FlashSwapOrderPreview.md ├── MarginAccountBook.md ├── OptionsCandlestick.md ├── CurrencyChain.md ├── SpotAccountBook.md ├── UnifiedPortfolioOutput.md ├── FlashSwapCurrencyPair.md ├── CancelBatchOrder.md ├── MultiCollateralRecord.md ├── MockMarginResult.md ├── FlashSwapOrder.md ├── OptionsMySettlements.md ├── BrokerTransaction1.md ├── FuturesOrderAmendment.md ├── SubAccountKey.md ├── UnifiedPortfolioInput.md ├── CollateralRecord.md ├── FuturesTrade.md ├── FlashSwapPreviewRequest.md ├── UidPushOrder.md ├── SubAccountTransfer.md ├── Transfer.md ├── OrderPatch.md ├── SubAccount.md ├── SubAccountToSubAccount.md ├── OptionsMMP.md ├── FuturesAccountBook.md ├── BrokerCommission1.md ├── FuturesAccountHistory.md ├── CreateMultiCollateralOrder.md ├── FuturesAutoDeleverage.md ├── CrossMarginLoan.md ├── DualGetPlans.md ├── SpotPriceTriggeredOrder.md ├── LiquidateOrder.md ├── UniLend.md ├── SpotFee.md ├── SwapCoinStruct.md ├── BatchAmendOrderReq.md ├── OptionsMMPReset.md ├── FuturesBatchAmendOrderRequest.md ├── Currency.md ├── UnifiedLoanRecord.md ├── WithdrawStatus.md ├── MarginAccount.md ├── RepayRecord.md ├── BatchAmendItem.md ├── DepositRecord.md ├── FuturesLiquidate.md ├── FuturesPriceTrigger.md ├── ContractStat.md ├── TradeFee.md ├── SubAccountTransferRecordItem.md ├── StructuredGetProjectList.md ├── MyFuturesTrade.md ├── MultiRepayRecord.md ├── MyFuturesTradeTimeRange.md ├── OptionsTicker.md ├── DualGetOrders.md ├── OptionsPosition.md ├── PositionClose.md ├── Trade.md ├── SpotPricePutOrder.md ├── Ticker.md └── CollateralOrder.md ├── .travis.yml ├── setup.cfg ├── example ├── config.py ├── README.md ├── build.sh └── app.py ├── .gitlab-ci.yml ├── gate_api └── api │ └── __init__.py ├── .github └── workflows │ └── python-publish.yml ├── .gitignore └── setup.py /test-requirements.txt: -------------------------------------------------------------------------------- 1 | pytest~=4.6.7 # needed for python 2.7+3.4 2 | pytest-cov>=2.8.1 3 | pytest-randomly==1.2.3 # needed for python 2.7+3.4 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | certifi >= 14.05.14 2 | future; python_version<="2.7" 3 | six >= 1.10 4 | python_dateutil >= 2.5.3 5 | setuptools >= 21.0.0 6 | urllib3 >= 1.15.1 7 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py27, py3 3 | 4 | [testenv] 5 | deps=-r{toxinidir}/requirements.txt 6 | -r{toxinidir}/test-requirements.txt 7 | 8 | commands= 9 | pytest --cov=gate_api 10 | -------------------------------------------------------------------------------- /docs/OrderResp.md: -------------------------------------------------------------------------------- 1 | # OrderResp 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **order_id** | **int** | Order ID | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/TransactionID.md: -------------------------------------------------------------------------------- 1 | # TransactionID 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **tx_id** | **int** | Order ID | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/DebitFee.md: -------------------------------------------------------------------------------- 1 | # DebitFee 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **enabled** | **bool** | Whether GT fee deduction is enabled | 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/SystemTime.md: -------------------------------------------------------------------------------- 1 | # SystemTime 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **server_time** | **int** | Server current time(ms) | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/UidPushWithdrawalResp.md: -------------------------------------------------------------------------------- 1 | # UidPushWithdrawalResp 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Order ID | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/TriggerOrderResponse.md: -------------------------------------------------------------------------------- 1 | # TriggerOrderResponse 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Auto order ID | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # ref: https://docs.travis-ci.com/user/languages/python 2 | language: python 3 | python: 4 | - "2.7" 5 | - "3.2" 6 | - "3.3" 7 | - "3.4" 8 | - "3.5" 9 | - "3.6" 10 | - "3.7" 11 | - "3.8" 12 | # command to install dependencies 13 | install: 14 | - "pip install -r requirements.txt" 15 | - "pip install -r test-requirements.txt" 16 | # command to run tests 17 | script: pytest --cov=gate_api 18 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | long_description = file: README.md 3 | long_description_content_type = text/markdown 4 | classifiers: 5 | License :: OSI Approved :: Apache Software License 6 | Programming Language :: Python :: 2 7 | Programming Language :: Python :: 2.7 8 | Programming Language :: Python :: 3 9 | maintainer = gate 10 | maintainer_email = dev@mail.gate.com 11 | 12 | [flake8] 13 | max-line-length=99 14 | -------------------------------------------------------------------------------- /docs/InlineResponse200.md: -------------------------------------------------------------------------------- 1 | # InlineResponse200 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **int** | | [optional] 7 | **value** | **str** | | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/TriggerTime.md: -------------------------------------------------------------------------------- 1 | # TriggerTime 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **trigger_time** | **int** | Timestamp when countdown ends, in milliseconds | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/UserSubRelation.md: -------------------------------------------------------------------------------- 1 | # UserSubRelation 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **list** | [**list[UserSub]**](UserSub.md) | Subordinate relationship list | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/CollateralCurrency.md: -------------------------------------------------------------------------------- 1 | # CollateralCurrency 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **amount** | **str** | Size | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/RebateUserInfo.md: -------------------------------------------------------------------------------- 1 | # RebateUserInfo 2 | 3 | Retrieve user rebate information 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **invite_uid** | **int** | My inviter's UID | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/AccountDetailKey.md: -------------------------------------------------------------------------------- 1 | # AccountDetailKey 2 | 3 | API Key details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **mode** | **int** | Mode: 1 - Classic mode, 2 - Legacy unified mode | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/FindCoin.md: -------------------------------------------------------------------------------- 1 | # FindCoin 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **cointype** | **str** | Currency type: swap - voucher; lock - locked position; debt - US Treasury bond. | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/FuturesOrderBookItem.md: -------------------------------------------------------------------------------- 1 | # FuturesOrderBookItem 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **p** | **str** | Price (quote currency) | [optional] 7 | **s** | **int** | Size | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/IndexConstituent.md: -------------------------------------------------------------------------------- 1 | # IndexConstituent 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **exchange** | **str** | Exchange | [optional] 7 | **symbols** | **list[str]** | Symbol list | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/AutoRepaySetting.md: -------------------------------------------------------------------------------- 1 | # AutoRepaySetting 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **status** | **str** | Auto repayment status: `on` - enabled, `off` - disabled | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/FundingRateRecord.md: -------------------------------------------------------------------------------- 1 | # FundingRateRecord 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **t** | **int** | Unix timestamp in seconds | [optional] 7 | **r** | **str** | Funding rate | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/InlineResponse2001.md: -------------------------------------------------------------------------------- 1 | # InlineResponse2001 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | | [optional] 7 | **est_rate** | **str** | Unconverted percentage | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/InsuranceRecord.md: -------------------------------------------------------------------------------- 1 | # InsuranceRecord 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **t** | **int** | Unix timestamp in seconds | [optional] 7 | **b** | **str** | Insurance balance | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/MultiLoanItem.md: -------------------------------------------------------------------------------- 1 | # MultiLoanItem 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **price** | **str** | Latest price of the currency | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/PatchUniLend.md: -------------------------------------------------------------------------------- 1 | # PatchUniLend 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency name | [optional] 7 | **min_rate** | **str** | Minimum interest rate | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/RepayResp.md: -------------------------------------------------------------------------------- 1 | # RepayResp 2 | 3 | Repay 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **repaid_principal** | **str** | Principal | [optional] 8 | **repaid_interest** | **str** | Interest | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/StructuredBuy.md: -------------------------------------------------------------------------------- 1 | # StructuredBuy 2 | 3 | Dual Investment Buy 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **pid** | **str** | Product ID | [optional] 8 | **amount** | **str** | Buy Quantity | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UnifiedLoanResult.md: -------------------------------------------------------------------------------- 1 | # UnifiedLoanResult 2 | 3 | Unified account borrowing and repayment response result 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **tran_id** | **int** | Transaction ID | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/UnifiedBorrowable.md: -------------------------------------------------------------------------------- 1 | # UnifiedBorrowable 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency detail | [optional] 7 | **amount** | **str** | Max borrowable amount | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/PartnerSubList.md: -------------------------------------------------------------------------------- 1 | # PartnerSubList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **total** | **int** | Total | [optional] 7 | **list** | [**list[PartnerSub]**](PartnerSub.md) | Subordinate list | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/UniLendInterest.md: -------------------------------------------------------------------------------- 1 | # UniLendInterest 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] [readonly] 7 | **interest** | **str** | Interest income | [optional] [readonly] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /example/config.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/env python 2 | # coding: utf-8 3 | 4 | from six.moves.urllib.parse import urlparse 5 | 6 | 7 | class RunConfig(object): 8 | 9 | def __init__(self, api_key=None, api_secret=None, host_used=None): 10 | # type: (str, str, str) -> None 11 | self.api_key = api_key 12 | self.api_secret = api_secret 13 | self.host_used = host_used 14 | self.use_test = urlparse(host_used).hostname == "fx-api-testnet.gateio.ws" 15 | -------------------------------------------------------------------------------- /docs/Eth2Swap.md: -------------------------------------------------------------------------------- 1 | # Eth2Swap 2 | 3 | ETH2 Mining 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **side** | **str** | 1-Forward Swap (ETH -> ETH2), 2-Reverse Swap (ETH2 -> ETH) | 8 | **amount** | **str** | Swap Amount | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/OptionsUnderlying.md: -------------------------------------------------------------------------------- 1 | # OptionsUnderlying 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **name** | **str** | Underlying name | [optional] 7 | **index_price** | **str** | Spot index price (quote currency) | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/SubAccountBalance.md: -------------------------------------------------------------------------------- 1 | # SubAccountBalance 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **uid** | **str** | User ID | [optional] 7 | **available** | **dict(str, str)** | Available balances of currencies | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/UnifiedTransferable.md: -------------------------------------------------------------------------------- 1 | # UnifiedTransferable 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency detail | [optional] 7 | **amount** | **str** | Maximum transferable amount | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/MarginMarketLeverage.md: -------------------------------------------------------------------------------- 1 | # MarginMarketLeverage 2 | 3 | Market leverage settings 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency_pair** | **str** | Market | [optional] 8 | **leverage** | **str** | Position leverage | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/SubAccountCrossMarginBalance.md: -------------------------------------------------------------------------------- 1 | # SubAccountCrossMarginBalance 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **uid** | **str** | User ID | [optional] 7 | **available** | [**SubCrossMarginAccount**](.md) | 账户余额信息 | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/UidPushWithdrawal.md: -------------------------------------------------------------------------------- 1 | # UidPushWithdrawal 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **receive_uid** | **int** | Recipient UID | 7 | **currency** | **str** | Currency name | 8 | **amount** | **str** | Transfer amount | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UnifiedCollateralRes.md: -------------------------------------------------------------------------------- 1 | # UnifiedCollateralRes 2 | 3 | Unified account collateral mode settings response 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **is_success** | **bool** | Whether the setting was successful | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/Eth2RateList.md: -------------------------------------------------------------------------------- 1 | # Eth2RateList 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **date_time** | **int** | Date Timestamp | [optional] 7 | **date** | **str** | Date | [optional] 8 | **rate** | **str** | Percentage Rate | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UnifiedLeverageSetting.md: -------------------------------------------------------------------------------- 1 | # UnifiedLeverageSetting 2 | 3 | Leverage multiplier for borrowing currency 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency name | 8 | **leverage** | **str** | Multiplier | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/BrokerCommission.md: -------------------------------------------------------------------------------- 1 | # BrokerCommission 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **total** | **int** | Total | [optional] 7 | **list** | [**list[BrokerCommission1]**](BrokerCommission1.md) | List of commission history | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/StpGroupUser.md: -------------------------------------------------------------------------------- 1 | # StpGroupUser 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **user_id** | **int** | User ID | [optional] 7 | **stp_id** | **int** | STP Group ID | [optional] 8 | **create_time** | **int** | Created time | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/BrokerTransaction.md: -------------------------------------------------------------------------------- 1 | # BrokerTransaction 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **total** | **int** | Total | [optional] 7 | **list** | [**list[BrokerTransaction1]**](BrokerTransaction1.md) | List of transaction history | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/InlineObject.md: -------------------------------------------------------------------------------- 1 | # InlineObject 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **mode** | **str** | Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode | 7 | **contract** | **str** | Futures market | 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/SubAccountMarginBalance.md: -------------------------------------------------------------------------------- 1 | # SubAccountMarginBalance 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **uid** | **str** | User ID | [optional] 7 | **available** | [**list[MarginAccount]**](MarginAccount.md) | Margin account balances | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/PartnerCommissionHistory.md: -------------------------------------------------------------------------------- 1 | # PartnerCommissionHistory 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **total** | **int** | Total | [optional] 7 | **list** | [**list[AgencyCommission]**](AgencyCommission.md) | List of commission history | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/ConvertSmallBalance.md: -------------------------------------------------------------------------------- 1 | # ConvertSmallBalance 2 | 3 | Small Balance Conversion 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **list[str]** | Currency to be converted | [optional] 8 | **is_all** | **bool** | Whether to convert all | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/PartnerTransactionHistory.md: -------------------------------------------------------------------------------- 1 | # PartnerTransactionHistory 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **total** | **int** | Total | [optional] 7 | **list** | [**list[AgencyTransaction]**](AgencyTransaction.md) | List of transaction history | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/SubAccountFuturesBalance.md: -------------------------------------------------------------------------------- 1 | # SubAccountFuturesBalance 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **uid** | **str** | User ID | [optional] 7 | **available** | [**dict(str, FuturesAccount)**](FuturesAccount.md) | Futures account balances | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/MultiCollateralItem.md: -------------------------------------------------------------------------------- 1 | # MultiCollateralItem 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **index_price** | **str** | Currency Index Price | [optional] 8 | **discount** | **str** | Discount | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/RepayMultiLoan.md: -------------------------------------------------------------------------------- 1 | # RepayMultiLoan 2 | 3 | Multi-currency collateral repayment 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order ID | 8 | **repay_items** | [**list[MultiLoanRepayItem]**](MultiLoanRepayItem.md) | Repay Currency Item | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/CollateralCurrentRate.md: -------------------------------------------------------------------------------- 1 | # CollateralCurrentRate 2 | 3 | Multi-collateral current interest rate 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency | [optional] 8 | **current_rate** | **str** | Currency current interest rate | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/FuturesIndexConstituents.md: -------------------------------------------------------------------------------- 1 | # FuturesIndexConstituents 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **index** | **str** | Index name | [optional] [readonly] 7 | **constituents** | [**list[IndexConstituent]**](IndexConstituent.md) | Constituents | [optional] [readonly] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/FuturesPositionCrossMode.md: -------------------------------------------------------------------------------- 1 | # FuturesPositionCrossMode 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **mode** | **str** | Cross margin or isolated margin mode. ISOLATED - isolated margin mode, CROSS - cross margin mode | 7 | **contract** | **str** | Futures market | 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/MarginTransferable.md: -------------------------------------------------------------------------------- 1 | # MarginTransferable 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency detail | [optional] 7 | **currency_pair** | **str** | Currency pair | [optional] 8 | **amount** | **str** | Max transferable amount | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/MaxUniBorrowable.md: -------------------------------------------------------------------------------- 1 | # MaxUniBorrowable 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [readonly] 7 | **currency_pair** | **str** | Currency pair | [optional] [readonly] 8 | **borrowable** | **str** | Maximum borrowable | [readonly] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/SpotInsuranceHistory.md: -------------------------------------------------------------------------------- 1 | # SpotInsuranceHistory 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **balance** | **str** | Balance | [optional] 8 | **time** | **int** | Creation time, timestamp, milliseconds | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UnifiedBorrowable1.md: -------------------------------------------------------------------------------- 1 | # UnifiedBorrowable1 2 | 3 | Batch query unified account maximum borrowable results 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency detail | [optional] 8 | **amount** | **str** | Maximum borrowable amount | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/StpGroup.md: -------------------------------------------------------------------------------- 1 | # StpGroup 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | STP Group ID | [optional] 7 | **name** | **str** | STP Group name | 8 | **creator_id** | **int** | Creator ID | [optional] 9 | **create_time** | **int** | Created time | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/TransferablesResult.md: -------------------------------------------------------------------------------- 1 | # TransferablesResult 2 | 3 | Batch query unified account maximum transferable results 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency detail | [optional] 8 | **amount** | **str** | Maximum transferable amount | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/DepositAddress.md: -------------------------------------------------------------------------------- 1 | # DepositAddress 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency detail | 7 | **address** | **str** | Deposit address | 8 | **multichain_addresses** | [**list[MultiChainAddressItem]**](MultiChainAddressItem.md) | | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UnifiedMarginTiers.md: -------------------------------------------------------------------------------- 1 | # UnifiedMarginTiers 2 | 3 | Unified account borrowing margin tiers 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency name | [optional] 8 | **margin_tiers** | [**list[MarginTiers]**](MarginTiers.md) | Tiered margin | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/MockOptionsPosition.md: -------------------------------------------------------------------------------- 1 | # MockOptionsPosition 2 | 3 | Options positions 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **options_name** | **str** | Option name, currently only supports USDT options for BTC and ETH | 8 | **size** | **str** | Position size, measured in contract quantity | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/MultiRepayResp.md: -------------------------------------------------------------------------------- 1 | # MultiRepayResp 2 | 3 | Multi-currency collateral repayment 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order ID | [optional] 8 | **repaid_currencies** | [**list[RepayCurrencyRes]**](RepayCurrencyRes.md) | Repay Currency List | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/SwapCoin.md: -------------------------------------------------------------------------------- 1 | # SwapCoin 2 | 3 | Blockchain Mining 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **coin** | **str** | Currency | 8 | **side** | **str** | 0 - Stake 1 - Redeem | 9 | **amount** | **str** | Size | 10 | **pid** | **int** | DeFi-type Mining Protocol Identifier | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/UnifiedDiscount.md: -------------------------------------------------------------------------------- 1 | # UnifiedDiscount 2 | 3 | Unified account tiered discount 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency name | [optional] 8 | **discount_tiers** | [**list[UnifiedDiscountTiers]**](UnifiedDiscountTiers.md) | Tiered discount | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UnifiedHistoryLoanRateRates.md: -------------------------------------------------------------------------------- 1 | # UnifiedHistoryLoanRateRates 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **int** | Hourly timestamp corresponding to this interest rate, in milliseconds | [optional] 7 | **rate** | **str** | Historical interest rate for this hour | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/UserTotalAmount.md: -------------------------------------------------------------------------------- 1 | # UserTotalAmount 2 | 3 | User's total borrowing and collateral amount 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **borrow_amount** | **str** | Total borrowing amount in USDT | [optional] 8 | **collateral_amount** | **str** | Total collateral amount in USDT | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/MockFuturesPosition.md: -------------------------------------------------------------------------------- 1 | # MockFuturesPosition 2 | 3 | Futures positions 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **contract** | **str** | Futures name, currently only supports USDT perpetual contracts for BTC and ETH | 8 | **size** | **str** | Position size, measured in contract quantity | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/CountdownCancelAllSpotTask.md: -------------------------------------------------------------------------------- 1 | # CountdownCancelAllSpotTask 2 | 3 | Countdown cancel task details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **timeout** | **int** | Countdown time in seconds At least 5 seconds, 0 means cancel countdown | 8 | **currency_pair** | **str** | Currency pair | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/CountdownCancelAllFuturesTask.md: -------------------------------------------------------------------------------- 1 | # CountdownCancelAllFuturesTask 2 | 3 | Countdown cancel task details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **timeout** | **int** | Countdown time in seconds At least 5 seconds, 0 means cancel countdown | 8 | **contract** | **str** | Futures contract | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/FuturesFee.md: -------------------------------------------------------------------------------- 1 | # FuturesFee 2 | 3 | The returned result is a map type, where the key represents the market and taker and maker fee rates 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **taker_fee** | **str** | Taker fee | [optional] [readonly] 8 | **maker_fee** | **str** | maker fee | [optional] [readonly] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/MultiLoanRepayItem.md: -------------------------------------------------------------------------------- 1 | # MultiLoanRepayItem 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Repayment currency | [optional] 7 | **amount** | **str** | Size | [optional] 8 | **repaid_all** | **bool** | Repayment method, set to true for full repayment, false for partial repayment | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/OpenOrders.md: -------------------------------------------------------------------------------- 1 | # OpenOrders 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency_pair** | **str** | Currency pair | [optional] 7 | **total** | **int** | Total number of open orders for this trading pair on the current page | [optional] 8 | **orders** | [**list[Order]**](Order.md) | | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UniCurrencyInterest.md: -------------------------------------------------------------------------------- 1 | # UniCurrencyInterest 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] [readonly] 7 | **interest_status** | **str** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [optional] [readonly] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/AgencyCommissionHistory.md: -------------------------------------------------------------------------------- 1 | # AgencyCommissionHistory 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency_pair** | **str** | Currency pair | [optional] 7 | **total** | **int** | Total | [optional] 8 | **list** | [**list[AgencyCommission]**](AgencyCommission.md) | List of commission history | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/CollateralLoanCurrency.md: -------------------------------------------------------------------------------- 1 | # CollateralLoanCurrency 2 | 3 | Supported borrowing and collateral currencies 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **loan_currency** | **str** | Borrowed currency | [optional] 8 | **collateral_currency** | **list[str]** | List of supported collateral currencies | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/AgencyTransactionHistory.md: -------------------------------------------------------------------------------- 1 | # AgencyTransactionHistory 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency_pair** | **str** | Currency pair | [optional] 7 | **total** | **int** | Total | [optional] 8 | **list** | [**list[AgencyTransaction]**](AgencyTransaction.md) | List of transaction history | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/MarginLeverageTier.md: -------------------------------------------------------------------------------- 1 | # MarginLeverageTier 2 | 3 | Market gradient information 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **upper_limit** | **str** | Maximum loan limit | [optional] 8 | **mmr** | **str** | Maintenance margin rate | [optional] 9 | **leverage** | **str** | Maximum leverage multiple | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/UnifiedRiskUnits.md: -------------------------------------------------------------------------------- 1 | # UnifiedRiskUnits 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **user_id** | **int** | User ID | [optional] 7 | **spot_hedge** | **bool** | Spot hedging status: true - enabled, false - disabled | [optional] 8 | **risk_units** | [**list[RiskUnits]**](RiskUnits.md) | Risk unit | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/CollateralAdjustRes.md: -------------------------------------------------------------------------------- 1 | # CollateralAdjustRes 2 | 3 | Multi-collateral adjustment result 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order ID | [optional] 8 | **collateral_currencies** | [**list[CollateralCurrencyRes]**](CollateralCurrencyRes.md) | Collateral currency information | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/CreateCollateralOrder.md: -------------------------------------------------------------------------------- 1 | # CreateCollateralOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **collateral_amount** | **str** | Collateral amount | 7 | **collateral_currency** | **str** | Collateral currency | 8 | **borrow_amount** | **str** | Borrowed amount | 9 | **borrow_currency** | **str** | Borrowed currency | 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/CrossMarginBalance.md: -------------------------------------------------------------------------------- 1 | # CrossMarginBalance 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **available** | **str** | Available balance | [optional] 7 | **freeze** | **str** | Locked balance | [optional] 8 | **borrowed** | **str** | Borrowed balance | [optional] 9 | **interest** | **str** | Unpaid interest | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/SpotAccount.md: -------------------------------------------------------------------------------- 1 | # SpotAccount 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency detail | [optional] 7 | **available** | **str** | Available amount | [optional] 8 | **locked** | **str** | Locked amount, used in trading | [optional] 9 | **update_id** | **int** | Version number | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/CollateralAdjust.md: -------------------------------------------------------------------------------- 1 | # CollateralAdjust 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **order_id** | **int** | Order ID | 7 | **type** | **str** | Operation type: append - add collateral, redeem - withdraw collateral | 8 | **collaterals** | [**list[CollateralCurrency]**](CollateralCurrency.md) | Collateral currency list | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/CollateralLtv.md: -------------------------------------------------------------------------------- 1 | # CollateralLtv 2 | 3 | Multi-collateral ratio 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **init_ltv** | **str** | Initial collateralization rate | [optional] 8 | **alert_ltv** | **str** | Warning collateralization rate | [optional] 9 | **liquidate_ltv** | **str** | Liquidation collateralization rate | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/PositionCloseOrder.md: -------------------------------------------------------------------------------- 1 | # PositionCloseOrder 2 | 3 | Current close order information, or `null` if no close order 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **int** | Order ID | [optional] 8 | **price** | **str** | Order price | [optional] 9 | **is_liq** | **bool** | Whether the close order is from liquidation | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/CollateralAlign.md: -------------------------------------------------------------------------------- 1 | # CollateralAlign 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **order_id** | **int** | Order ID | 7 | **collateral_currency** | **str** | Collateral currency | 8 | **collateral_amount** | **str** | Collateral amount | 9 | **type** | **str** | Operation type: append - add collateral, redeem - withdraw collateral | 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/MockSpotBalance.md: -------------------------------------------------------------------------------- 1 | # MockSpotBalance 2 | 3 | Spot 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency name | 8 | **equity** | **str** | Currency equity, where equity = balance - borrowed, represents the net delta exposure of your spot positions, which can be negative. Currently only supports BTC and ETH | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/PartnerSub.md: -------------------------------------------------------------------------------- 1 | # PartnerSub 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **user_id** | **int** | User ID | [optional] 7 | **user_join_time** | **int** | Time when user joined the system, Unix timestamp in seconds | [optional] 8 | **type** | **int** | Type (1-Sub-agent 2-Indirect direct customer 3-Direct direct customer) | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/ProfitLossRange.md: -------------------------------------------------------------------------------- 1 | # ProfitLossRange 2 | 3 | Profit and loss range 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **price_percentage** | **str** | Percentage change in price | [optional] 8 | **implied_volatility_percentage** | **str** | Percentage change in implied volatility | [optional] 9 | **profit_loss** | **str** | PnL | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/RepayRecordTotalInterest.md: -------------------------------------------------------------------------------- 1 | # RepayRecordTotalInterest 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **index_price** | **str** | Currency Index Price | [optional] 8 | **amount** | **str** | Interest Amount | [optional] 9 | **amount_usdt** | **str** | Interest amount converted to USDT | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/CountdownCancelAllOptionsTask.md: -------------------------------------------------------------------------------- 1 | # CountdownCancelAllOptionsTask 2 | 3 | Countdown cancel task details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **timeout** | **int** | Countdown time in seconds At least 5 seconds, 0 means cancel countdown | 8 | **contract** | **str** | Options contract name | [optional] 9 | **underlying** | **str** | Underlying | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/OptionsPositionCloseOrder.md: -------------------------------------------------------------------------------- 1 | # OptionsPositionCloseOrder 2 | 3 | Current close order information, or `null` if no close order 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **int** | Order ID | [optional] 8 | **price** | **str** | Order price (quote currency) | [optional] 9 | **is_liq** | **bool** | Whether the close order is from liquidation | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/TransferOrderStatus.md: -------------------------------------------------------------------------------- 1 | # TransferOrderStatus 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **tx_id** | **str** | Order ID | [optional] 7 | **status** | **str** | Transfer status: PENDING - Processing, SUCCESS - Transfer successful, FAIL - Transfer failed, PARTIAL_SUCCESS - Partially successful (this status appears when transferring between sub-accounts) | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/MockOptionsOrder.md: -------------------------------------------------------------------------------- 1 | # MockOptionsOrder 2 | 3 | Option orders 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **options_name** | **str** | Option name, currently only supports USDT options for BTC and ETH | 8 | **size** | **str** | Initial order quantity, not involved in actual calculation | 9 | **left** | **str** | Unfilled contract quantity, involved in actual calculation | 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/SmallBalance.md: -------------------------------------------------------------------------------- 1 | # SmallBalance 2 | 3 | Small Balance Conversion 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency | [optional] 8 | **available_balance** | **str** | Available balance | [optional] 9 | **estimated_as_btc** | **str** | Estimated as BTC | [optional] 10 | **convertible_to_gt** | **str** | Estimated conversion to GT | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/FuturesPremiumIndex.md: -------------------------------------------------------------------------------- 1 | # FuturesPremiumIndex 2 | 3 | data point in every timestamp 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **t** | **float** | Unix timestamp in seconds | [optional] 8 | **c** | **str** | Close price | [optional] 9 | **h** | **str** | Highest price | [optional] 10 | **l** | **str** | Lowest price | [optional] 11 | **o** | **str** | Open price | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/OptionsUnderlyingTicker.md: -------------------------------------------------------------------------------- 1 | # OptionsUnderlyingTicker 2 | 3 | Options underlying detail 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **trade_put** | **int** | Total put options trades amount in last 24h | [optional] 8 | **trade_call** | **int** | Total call options trades amount in last 24h | [optional] 9 | **index_price** | **str** | Index price (quote currency) | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/CollateralCurrencyInfo.md: -------------------------------------------------------------------------------- 1 | # CollateralCurrencyInfo 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **index_price** | **str** | Currency Index Price | [optional] 8 | **left_collateral** | **str** | Remaining collateral amount | [optional] 9 | **left_collateral_usdt** | **str** | Remaining collateral value converted to USDT | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/UnifiedDiscountTiers.md: -------------------------------------------------------------------------------- 1 | # UnifiedDiscountTiers 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **tier** | **str** | Tier | [optional] 7 | **discount** | **str** | Discount | [optional] 8 | **lower_limit** | **str** | Lower limit | [optional] 9 | **upper_limit** | **str** | Upper limit, + indicates positive infinity | [optional] 10 | **leverage** | **str** | Position leverage | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/FutureCancelOrderResult.md: -------------------------------------------------------------------------------- 1 | # FutureCancelOrderResult 2 | 3 | Order cancellation result 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **str** | Order ID | [optional] 8 | **user_id** | **int** | User ID | [optional] 9 | **succeeded** | **bool** | Whether cancellation succeeded | [optional] 10 | **message** | **str** | Error description when cancellation fails, empty if successful | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/MarginTiers.md: -------------------------------------------------------------------------------- 1 | # MarginTiers 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **tier** | **str** | Tier | [optional] 7 | **margin_rate** | **str** | Discount | [optional] 8 | **lower_limit** | **str** | Lower limit | [optional] 9 | **upper_limit** | **str** | Upper limit, \"\" indicates greater than (the last tier) | [optional] 10 | **leverage** | **str** | Position leverage | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/SubUserMode.md: -------------------------------------------------------------------------------- 1 | # SubUserMode 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **user_id** | **int** | User ID | [optional] 7 | **is_unified** | **bool** | Whether it is a unified account | [optional] 8 | **mode** | **str** | Unified account mode: - `classic`: Classic account mode - `multi_currency`: Multi-currency margin mode - `portfolio`: Portfolio margin mode | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UnifiedModeSet.md: -------------------------------------------------------------------------------- 1 | # UnifiedModeSet 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **mode** | **str** | Unified account mode: - `classic`: Classic account mode - `multi_currency`: Cross-currency margin mode - `portfolio`: Portfolio margin mode - `single_currency`: Single-currency margin mode | 7 | **settings** | [**UnifiedSettings**](UnifiedSettings.md) | | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/SavedAddress.md: -------------------------------------------------------------------------------- 1 | # SavedAddress 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **chain** | **str** | Chain name | [optional] 8 | **address** | **str** | Address | [optional] 9 | **name** | **str** | Name | [optional] 10 | **tag** | **str** | Tag | [optional] 11 | **verified** | **str** | Whether to pass the verification 0-unverified, 1-verified | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/MockFuturesOrder.md: -------------------------------------------------------------------------------- 1 | # MockFuturesOrder 2 | 3 | Futures order 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **contract** | **str** | Futures name, currently only supports USDT perpetual contracts for BTC and ETH | 8 | **size** | **str** | Contract quantity, representing the initial order quantity, not involved in actual settlement | 9 | **left** | **str** | Unfilled contract quantity, involved in actual calculation | 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/CollateralFixRate.md: -------------------------------------------------------------------------------- 1 | # CollateralFixRate 2 | 3 | Multi-collateral fixed interest rate 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency | [optional] 8 | **rate_7d** | **str** | Fixed interest rate for 7-day lending period | [optional] 9 | **rate_30d** | **str** | Fixed interest rate for 30-day lending period | [optional] 10 | **update_time** | **int** | Update time, timestamp in seconds | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/MultiCollateralCurrency.md: -------------------------------------------------------------------------------- 1 | # MultiCollateralCurrency 2 | 3 | Borrowing and collateral currencies supported for Multi-Collateral 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **loan_currencies** | [**list[MultiLoanItem]**](MultiLoanItem.md) | List of supported borrowing currencies | [optional] 8 | **collateral_currencies** | [**list[MultiCollateralItem]**](MultiCollateralItem.md) | List of supported collateral currencies | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/AccountRateLimit.md: -------------------------------------------------------------------------------- 1 | # AccountRateLimit 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **tier** | **str** | Frequency limit level (For detailed frequency limit rules, see [Transaction ratio frequency limit](#rate-limit-based-on-fill-ratio)) | [optional] 7 | **ratio** | **str** | Fill rate | [optional] 8 | **main_ratio** | **str** | Total fill ratio of main account | [optional] 9 | **updated_at** | **str** | Update time | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/SmallBalanceHistory.md: -------------------------------------------------------------------------------- 1 | # SmallBalanceHistory 2 | 3 | Small Balance Conversion 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **str** | Order ID | [optional] [readonly] 8 | **currency** | **str** | Currency | [optional] [readonly] 9 | **amount** | **str** | Swap Amount | [optional] [readonly] 10 | **gt_amount** | **str** | GT amount | [optional] [readonly] 11 | **create_time** | **int** | Exchange time (in seconds) | [optional] [readonly] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/BorrowCurrencyInfo.md: -------------------------------------------------------------------------------- 1 | # BorrowCurrencyInfo 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **index_price** | **str** | Currency Index Price | [optional] 8 | **left_repay_principal** | **str** | Outstanding principal | [optional] 9 | **left_repay_interest** | **str** | Outstanding interest | [optional] 10 | **left_repay_usdt** | **str** | Remaining total outstanding value converted to USDT | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/CreateUniLend.md: -------------------------------------------------------------------------------- 1 | # CreateUniLend 2 | 3 | Create lending or redemption 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency name | 8 | **amount** | **str** | Amount to deposit into lending pool | 9 | **type** | **str** | Operation type: lend - Lend, redeem - Redeem | 10 | **min_rate** | **str** | Minimum interest rate. If set too high, lending may fail and no interest will be earned. Required for lending operations. | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/BrokerCommissionSubBrokerInfo.md: -------------------------------------------------------------------------------- 1 | # BrokerCommissionSubBrokerInfo 2 | 3 | Sub-broker information 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **user_id** | **int** | Sub-broker user ID | [optional] 8 | **original_commission_rate** | **str** | Sub-broker original commission rate | [optional] 9 | **relative_commission_rate** | **str** | Sub-broker relative commission rate | [optional] 10 | **commission_rate** | **str** | Sub-broker actual commission rate | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/UniCurrencyPair.md: -------------------------------------------------------------------------------- 1 | # UniCurrencyPair 2 | 3 | Currency pair of the loan 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency_pair** | **str** | Currency pair | [optional] [readonly] 8 | **base_min_borrow_amount** | **str** | Minimum borrow amount of base currency | [optional] [readonly] 9 | **quote_min_borrow_amount** | **str** | Minimum borrow amount of quote currency | [optional] [readonly] 10 | **leverage** | **str** | Position leverage | [optional] [readonly] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/RepayLoan.md: -------------------------------------------------------------------------------- 1 | # RepayLoan 2 | 3 | Repay 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order ID | 8 | **repay_amount** | **str** | Repayment amount, it is mandatory when making partial repayments | 9 | **repaid_all** | **bool** | Repayment method, set to `true` for full repayment, and `false` for partial repayment; When partial repayment, the repay_amount parameter cannot be greater than the remaining amount to be repaid by the user. | 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/SpotCurrencyChain.md: -------------------------------------------------------------------------------- 1 | # SpotCurrencyChain 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **name** | **str** | Blockchain name | [optional] 7 | **addr** | **str** | token address | [optional] 8 | **withdraw_disabled** | **bool** | Whether currency's withdrawal is disabled | [optional] 9 | **withdraw_delayed** | **bool** | Whether currency's withdrawal is delayed | [optional] 10 | **deposit_disabled** | **bool** | Whether currency's deposit is disabled | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/UserSub.md: -------------------------------------------------------------------------------- 1 | # UserSub 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **uid** | **int** | User ID | [optional] 7 | **belong** | **str** | User's system affiliation (partner/referral). Empty means not belonging to any system | [optional] 8 | **type** | **int** | Type (0-Not in system 1-Direct subordinate agent 2-Indirect subordinate agent 3-Direct direct customer 4-Indirect direct customer 5-Regular user) | [optional] 9 | **ref_uid** | **int** | Inviter user ID | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/SubAccountKeyPerms.md: -------------------------------------------------------------------------------- 1 | # SubAccountKeyPerms 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **name** | **str** | Permission function name (no value will be cleared) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery contract - earn: earn - custody: custody - options: options - account: account information - loan: lending - margin: margin - unified: unified account - copy: copy trading | [optional] 7 | **read_only** | **bool** | Read Only | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/UniLoanRecord.md: -------------------------------------------------------------------------------- 1 | # UniLoanRecord 2 | 3 | Borrowing Records 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **type** | **str** | Type: `borrow` - borrow, `repay` - repay | [optional] [readonly] 8 | **currency_pair** | **str** | Currency pair | [optional] [readonly] 9 | **currency** | **str** | Currency | [optional] [readonly] 10 | **amount** | **str** | Borrow or repayment amount | [optional] [readonly] 11 | **create_time** | **int** | Created time | [optional] [readonly] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/SpotPriceTrigger.md: -------------------------------------------------------------------------------- 1 | # SpotPriceTrigger 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **price** | **str** | Trigger price | 7 | **rule** | **str** | Price trigger condition - `>=`: triggered when market price is greater than or equal to `price` - `<=`: triggered when market price is less than or equal to `price` | 8 | **expiration** | **int** | Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout | 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/CurrencyQuota.md: -------------------------------------------------------------------------------- 1 | # CurrencyQuota 2 | 3 | Currency Quota 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency | [optional] 8 | **index_price** | **str** | Currency Index Price | [optional] 9 | **min_quota** | **str** | Minimum borrowing/collateral limit for the currency | [optional] 10 | **left_quota** | **str** | Remaining borrowing/collateral quota for the currency | [optional] 11 | **left_quote_usdt** | **str** | Remaining currency limit converted to USDT | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/RepayRecordRepaidCurrency.md: -------------------------------------------------------------------------------- 1 | # RepayRecordRepaidCurrency 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Repayment currency | [optional] 7 | **index_price** | **str** | Currency Index Price | [optional] 8 | **repaid_amount** | **str** | Repayment amount | [optional] 9 | **repaid_principal** | **str** | Principal | [optional] 10 | **repaid_interest** | **str** | Interest | [optional] 11 | **repaid_amount_usdt** | **str** | Repayment amount converted to USDT | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/CreateUniLoan.md: -------------------------------------------------------------------------------- 1 | # CreateUniLoan 2 | 3 | Borrow or repay 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency | 8 | **type** | **str** | Type: `borrow` - borrow, `repay` - repay | 9 | **amount** | **str** | Borrow or repayment amount | 10 | **repaid_all** | **bool** | Full repayment. For repayment operations only. When `true`, overrides `amount` and repays the full amount | [optional] 11 | **currency_pair** | **str** | Currency pair | 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/CollateralCurrencyRes.md: -------------------------------------------------------------------------------- 1 | # CollateralCurrencyRes 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **succeeded** | **bool** | Update success status | [optional] 7 | **label** | **str** | Error identifier for failed operations; empty when successful | [optional] 8 | **message** | **str** | Error description for failed operations; empty when successful | [optional] 9 | **currency** | **str** | Currency | [optional] 10 | **amount** | **str** | Successfully operated collateral quantity; 0 if operation fails | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/StructuredOrderList.md: -------------------------------------------------------------------------------- 1 | # StructuredOrderList 2 | 3 | Structured order 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **int** | Order ID | [optional] 8 | **pid** | **str** | Product ID | [optional] 9 | **lock_coin** | **str** | Locked coin | [optional] 10 | **amount** | **str** | Locked amount | [optional] 11 | **status** | **str** | Status: SUCCESS - SUCCESS FAILED - FAILED DONE - DONE | [optional] 12 | **income** | **str** | Income | [optional] 13 | **create_time** | **int** | Created time | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/RepayRecordCurrency.md: -------------------------------------------------------------------------------- 1 | # RepayRecordCurrency 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **index_price** | **str** | Currency Index Price | [optional] 8 | **before_amount** | **str** | Amount before the operation | [optional] 9 | **before_amount_usdt** | **str** | USDT Amount before the operation | [optional] 10 | **after_amount** | **str** | Amount after the operation | [optional] 11 | **after_amount_usdt** | **str** | USDT Amount after the operation | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/AccountBalance.md: -------------------------------------------------------------------------------- 1 | # AccountBalance 2 | 3 | Total balances calculated with specified currency unit 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **amount** | **str** | Account total balance amount | [optional] 8 | **currency** | **str** | Currency | [optional] 9 | **unrealised_pnl** | **str** | Unrealised_pnl, this field will only appear in futures, options, delivery, and total accounts | [optional] 10 | **borrowed** | **str** | Total borrowed amount, this field will only appear in margin and cross_margin accounts | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/AgencyCommission.md: -------------------------------------------------------------------------------- 1 | # AgencyCommission 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **commission_time** | **int** | Commission time (Unix timestamp in seconds) | [optional] 7 | **user_id** | **int** | User ID | [optional] 8 | **group_name** | **str** | Group name | [optional] 9 | **commission_amount** | **str** | Transaction amount | [optional] 10 | **commission_asset** | **str** | Commission Asset | [optional] 11 | **source** | **str** | Commission source: SPOT - Spot commission, FUTURES - Futures commission | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/UniCurrency.md: -------------------------------------------------------------------------------- 1 | # UniCurrency 2 | 3 | Currency detail 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency name | [optional] [readonly] 8 | **min_lend_amount** | **str** | The minimum lending amount, in the unit of the currency | [optional] [readonly] 9 | **max_lend_amount** | **str** | The total maximum lending amount, in USDT | [optional] [readonly] 10 | **max_rate** | **str** | Maximum rate (Hourly) | [optional] [readonly] 11 | **min_rate** | **str** | Minimum rate (Hourly) | [optional] [readonly] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/UnifiedLoan.md: -------------------------------------------------------------------------------- 1 | # UnifiedLoan 2 | 3 | Borrow or repay 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency | 8 | **type** | **str** | Type: `borrow` - borrow, `repay` - repay | 9 | **amount** | **str** | Borrow or repayment amount | 10 | **repaid_all** | **bool** | Full repayment, only used for repayment operations. When set to `true`, overrides `amount` and directly repays the full amount | [optional] 11 | **text** | **str** | User defined custom ID | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # ref: https://docs.gitlab.com/ee/ci/README.html 2 | 3 | stages: 4 | - test 5 | 6 | .nosetest: 7 | stage: test 8 | script: 9 | - pip install -r requirements.txt 10 | - pip install -r test-requirements.txt 11 | - pytest --cov=gate_api 12 | 13 | nosetest-2.7: 14 | extends: .nosetest 15 | image: python:2.7-alpine 16 | nosetest-3.3: 17 | extends: .nosetest 18 | image: python:3.3-alpine 19 | nosetest-3.4: 20 | extends: .nosetest 21 | image: python:3.4-alpine 22 | nosetest-3.5: 23 | extends: .nosetest 24 | image: python:3.5-alpine 25 | nosetest-3.6: 26 | extends: .nosetest 27 | image: python:3.6-alpine 28 | nosetest-3.7: 29 | extends: .nosetest 30 | image: python:3.7-alpine 31 | nosetest-3.8: 32 | extends: .nosetest 33 | image: python:3.8-alpine 34 | -------------------------------------------------------------------------------- /docs/FundingAccount.md: -------------------------------------------------------------------------------- 1 | # FundingAccount 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency name | [optional] 7 | **available** | **str** | Available assets to lend, which is identical to spot account `available` | [optional] 8 | **locked** | **str** | Locked amount. i.e. amount in `open` loans | [optional] 9 | **lent** | **str** | Outstanding loan amount yet to be repaid | [optional] 10 | **total_lent** | **str** | Amount used for lending. total_lent = lent + locked | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/MarginAccountCurrency.md: -------------------------------------------------------------------------------- 1 | # MarginAccountCurrency 2 | 3 | Currency account information 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency name | [optional] 8 | **available** | **str** | Amount available for margin trading, available = margin + borrowed | [optional] 9 | **locked** | **str** | Frozen funds, such as amounts already placed in margin market for order trading | [optional] 10 | **borrowed** | **str** | Borrowed funds | [optional] 11 | **interest** | **str** | Unpaid interest | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/MockSpotOrder.md: -------------------------------------------------------------------------------- 1 | # MockSpotOrder 2 | 3 | Spot orders 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency_pairs** | **str** | Market | 8 | **order_price** | **str** | Price | 9 | **count** | **str** | Initial order quantity for spot trading pairs, not involved in actual calculation. Currently only supports BTC and ETH Currently only supports three currencies: BTC, ETH | [optional] 10 | **left** | **str** | Unfilled quantity, involved in actual calculation | 11 | **type** | **str** | Order type, sell - sell order, buy - buy order | 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/UniLoan.md: -------------------------------------------------------------------------------- 1 | # UniLoan 2 | 3 | Borrowing 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency | [optional] [readonly] 8 | **currency_pair** | **str** | Currency pair | [optional] [readonly] 9 | **amount** | **str** | Amount to Repay | [optional] [readonly] 10 | **type** | **str** | Loan type: platform borrowing - platform, margin borrowing - margin | [optional] [readonly] 11 | **create_time** | **int** | Created time | [optional] [readonly] 12 | **update_time** | **int** | Last Update Time | [optional] [readonly] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/MultiCollateralRecordCurrency.md: -------------------------------------------------------------------------------- 1 | # MultiCollateralRecordCurrency 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **index_price** | **str** | Currency Index Price | [optional] 8 | **before_amount** | **str** | Amount before the operation | [optional] 9 | **before_amount_usdt** | **str** | USDT Amount before the operation | [optional] 10 | **after_amount** | **str** | Amount after the operation | [optional] 11 | **after_amount_usdt** | **str** | USDT Amount after the operation | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/MultiChainAddressItem.md: -------------------------------------------------------------------------------- 1 | # MultiChainAddressItem 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **chain** | **str** | Name of the chain | [optional] 7 | **address** | **str** | Deposit address | [optional] 8 | **payment_id** | **str** | Notes that some currencies required(e.g., Tag, Memo) when depositing | [optional] 9 | **payment_name** | **str** | Note type, `Tag` or `Memo` | [optional] 10 | **obtain_failed** | **int** | The obtain failed status- 0: address successfully obtained- 1: failed to obtain address | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/OptionsSettlement.md: -------------------------------------------------------------------------------- 1 | # OptionsSettlement 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **float** | Last configuration update time | [optional] 7 | **contract** | **str** | Options contract name | [optional] 8 | **profit** | **str** | Settlement profit per contract (quote currency) | [optional] 9 | **fee** | **str** | Settlement fee per contract (quote currency) | [optional] 10 | **strike_price** | **str** | Strike price (quote currency) | [optional] 11 | **settle_price** | **str** | Settlement price (quote currency) | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/OrderBook.md: -------------------------------------------------------------------------------- 1 | # OrderBook 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Order book ID, which is updated whenever the order book is changed. Valid only when `with_id` is set to `true` | [optional] 7 | **current** | **int** | The timestamp of the response data being generated (in milliseconds) | [optional] 8 | **update** | **int** | The timestamp of when the orderbook last changed (in milliseconds) | [optional] 9 | **asks** | **list[list[str]]** | Ask Depth | 10 | **bids** | **list[list[str]]** | Bid Depth | 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/RepayCurrencyRes.md: -------------------------------------------------------------------------------- 1 | # RepayCurrencyRes 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **succeeded** | **bool** | Whether the repayment was successful | [optional] 7 | **label** | **str** | Error identifier for failed operations; empty when successful | [optional] 8 | **message** | **str** | Error description for failed operations; empty when successful | [optional] 9 | **currency** | **str** | Repayment currency | [optional] 10 | **repaid_principal** | **str** | Principal | [optional] 11 | **repaid_interest** | **str** | Principal | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/OptionsAccountBook.md: -------------------------------------------------------------------------------- 1 | # OptionsAccountBook 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **float** | Change time | [optional] 7 | **change** | **str** | Amount changed (USDT) | [optional] 8 | **balance** | **str** | Account total balance after change (USDT) | [optional] 9 | **type** | **str** | Changing Type: - dnw: Deposit & Withdraw - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - point_dnw: point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] 10 | **text** | **str** | Remark | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/UnifiedCollateralReq.md: -------------------------------------------------------------------------------- 1 | # UnifiedCollateralReq 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **collateral_type** | **int** | User-set collateral mode: 0(all)-All currencies as collateral, 1(custom)-Custom currencies as collateral. When collateral_type is 0(all), enable_list and disable_list parameters are invalid | [optional] 7 | **enable_list** | **list[str]** | Currency list, where collateral_type=1(custom) indicates the addition logic | [optional] 8 | **disable_list** | **list[str]** | Disable list, indicating the disable logic | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UnifiedSettings.md: -------------------------------------------------------------------------------- 1 | # UnifiedSettings 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **usdt_futures** | **bool** | USDT futures switch. In cross-currency margin mode, can only be enabled and cannot be disabled | [optional] 7 | **spot_hedge** | **bool** | Spot hedging switch | [optional] 8 | **use_funding** | **bool** | Earn switch, when mode is cross-currency margin mode, whether to use Earn funds as margin | [optional] 9 | **options** | **bool** | Options switch. In cross-currency margin mode, can only be enabled and cannot be disabled | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/TotalBalance.md: -------------------------------------------------------------------------------- 1 | # TotalBalance 2 | 3 | User's total balance information 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **total** | [**AccountBalance**](AccountBalance.md) | | [optional] 8 | **details** | [**dict(str, AccountBalance)**](AccountBalance.md) | Total balances in different accounts - cross_margin: cross margin account - spot: spot account - finance: finance account - margin: margin account - quant: quant account - futures: perpetual contract account - delivery: delivery contract account - warrant: warrant account - cbbc: CBBC account | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/AccountDetail.md: -------------------------------------------------------------------------------- 1 | # AccountDetail 2 | 3 | Account details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **ip_whitelist** | **list[str]** | IP Whitelist | [optional] 8 | **currency_pairs** | **list[str]** | Trading pair whitelist | [optional] 9 | **user_id** | **int** | User ID | [optional] 10 | **tier** | **int** | User VIP level | [optional] 11 | **key** | [**AccountDetailKey**](AccountDetailKey.md) | | [optional] 12 | **copy_trading_role** | **int** | User role: 0 - Normal user, 1 - Copy trading leader, 2 - Follower, 3 - Both leader and follower | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/DeliveryCandlestick.md: -------------------------------------------------------------------------------- 1 | # DeliveryCandlestick 2 | 3 | data point in every timestamp 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **t** | **float** | Unix timestamp in seconds | [optional] 8 | **v** | **int** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] 9 | **c** | **str** | Close price (quote currency) | [optional] 10 | **h** | **str** | Highest price (quote currency) | [optional] 11 | **l** | **str** | Lowest price (quote currency) | [optional] 12 | **o** | **str** | Open price (quote currency) | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/FuturesRiskLimitTier.md: -------------------------------------------------------------------------------- 1 | # FuturesRiskLimitTier 2 | 3 | Information for each tier of the gradient risk limit table 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **tier** | **int** | Tier | [optional] 8 | **risk_limit** | **str** | Position risk limit | [optional] 9 | **initial_rate** | **str** | Initial margin rate | [optional] 10 | **maintenance_rate** | **str** | Maintenance margin rate | [optional] 11 | **leverage_max** | **str** | Maximum leverage | [optional] 12 | **deduction** | **str** | Maintenance margin quick calculation deduction amount | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/FuturesOrderBook.md: -------------------------------------------------------------------------------- 1 | # FuturesOrderBook 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Order Book ID. Increases by 1 on every order book change. Set `with_id=true` to include this field in response | [optional] 7 | **current** | **float** | Response data generation timestamp | [optional] 8 | **update** | **float** | Order book changed timestamp | [optional] 9 | **asks** | [**list[FuturesOrderBookItem]**](FuturesOrderBookItem.md) | Ask Depth | 10 | **bids** | [**list[FuturesOrderBookItem]**](FuturesOrderBookItem.md) | Bid Depth | 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/PlaceDualInvestmentOrder.md: -------------------------------------------------------------------------------- 1 | # PlaceDualInvestmentOrder 2 | 3 | Dual Investment Order 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **plan_id** | **str** | Product ID | 8 | **amount** | **str** | Subscription amount, mutually exclusive with copies field | 9 | **text** | **str** | Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/RepayRecordLeftInterest.md: -------------------------------------------------------------------------------- 1 | # RepayRecordLeftInterest 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **index_price** | **str** | Currency Index Price | [optional] 8 | **before_amount** | **str** | Interest amount before repayment | [optional] 9 | **before_amount_usdt** | **str** | Converted value of interest before repayment in USDT | [optional] 10 | **after_amount** | **str** | Interest amount after repayment | [optional] 11 | **after_amount_usdt** | **str** | Converted value of interest after repayment in USDT | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/OptionsMyTrade.md: -------------------------------------------------------------------------------- 1 | # OptionsMyTrade 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Fill ID | [optional] 7 | **create_time** | **float** | Fill Time | [optional] 8 | **contract** | **str** | Options contract name | [optional] 9 | **order_id** | **int** | Related order ID | [optional] 10 | **size** | **int** | Trading size | [optional] 11 | **price** | **str** | Trade price (quote currency) | [optional] 12 | **underlying_price** | **str** | Underlying price (quote currency) | [optional] 13 | **role** | **str** | Trade role. taker - taker, maker - maker | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/UnifiedHistoryLoanRate.md: -------------------------------------------------------------------------------- 1 | # UnifiedHistoryLoanRate 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency name | [optional] 7 | **tier** | **str** | VIP level for the floating rate to be retrieved | [optional] 8 | **tier_up_rate** | **str** | Floating rate corresponding to VIP level | [optional] 9 | **rates** | [**list[UnifiedHistoryLoanRateRates]**](UnifiedHistoryLoanRateRates.md) | Historical interest rate information, one data point per hour, array size determined by page and limit parameters from the API request, sorted by time from recent to distant | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/UniInterestRecord.md: -------------------------------------------------------------------------------- 1 | # UniInterestRecord 2 | 3 | Interest Record 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **status** | **int** | Status: 0 - fail, 1 - success | [optional] [readonly] 8 | **currency** | **str** | Currency | [optional] [readonly] 9 | **actual_rate** | **str** | Actual Rate | [optional] [readonly] 10 | **interest** | **str** | Interest | [optional] [readonly] 11 | **interest_status** | **str** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [optional] [readonly] 12 | **create_time** | **int** | Created time | [optional] [readonly] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/RiskUnits.md: -------------------------------------------------------------------------------- 1 | # RiskUnits 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **symbol** | **str** | Risk unit flag | [optional] 7 | **spot_in_use** | **str** | Spot hedging occupied amount | [optional] 8 | **maintain_margin** | **str** | Maintenance margin for risk unit | [optional] 9 | **initial_margin** | **str** | Initial margin for risk unit | [optional] 10 | **delta** | **str** | Total Delta of risk unit | [optional] 11 | **gamma** | **str** | Total Gamma of risk unit | [optional] 12 | **theta** | **str** | Total Theta of risk unit | [optional] 13 | **vega** | **str** | Total Vega of risk unit | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/CrossMarginRepayment.md: -------------------------------------------------------------------------------- 1 | # CrossMarginRepayment 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | Loan record ID | [optional] 7 | **create_time** | **int** | Repayment time | [optional] 8 | **loan_id** | **str** | Loan record ID | [optional] 9 | **currency** | **str** | Currency name | [optional] 10 | **principal** | **str** | Repaid principal | [optional] 11 | **interest** | **str** | Repaid interest | [optional] 12 | **repayment_type** | **str** | Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment after cancellation | [optional] [readonly] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/OptionsPositionClose.md: -------------------------------------------------------------------------------- 1 | # OptionsPositionClose 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **float** | Position close time | [optional] [readonly] 7 | **contract** | **str** | Options contract name | [optional] [readonly] 8 | **side** | **str** | Position side - `long`: Long position - `short`: Short position | [optional] [readonly] 9 | **pnl** | **str** | PnL | [optional] [readonly] 10 | **text** | **str** | Source of close order. See `order.text` field for specific values | [optional] [readonly] 11 | **settle_size** | **str** | Settlement size | [optional] [readonly] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/FuturesCandlestick.md: -------------------------------------------------------------------------------- 1 | # FuturesCandlestick 2 | 3 | data point in every timestamp 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **t** | **float** | Unix timestamp in seconds | [optional] 8 | **v** | **int** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] 9 | **c** | **str** | Close price (quote currency) | [optional] 10 | **h** | **str** | Highest price (quote currency) | [optional] 11 | **l** | **str** | Lowest price (quote currency) | [optional] 12 | **o** | **str** | Open price (quote currency) | [optional] 13 | **sum** | **str** | Trading volume (unit: Quote currency) | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/FuturesLiqOrder.md: -------------------------------------------------------------------------------- 1 | # FuturesLiqOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **int** | Liquidation time | [optional] [readonly] 7 | **contract** | **str** | Futures contract | [optional] [readonly] 8 | **size** | **int** | User position size | [optional] [readonly] 9 | **order_size** | **int** | Number of forced liquidation orders | [optional] [readonly] 10 | **order_price** | **str** | Liquidation order price | [optional] [readonly] 11 | **fill_price** | **str** | Liquidation order average taker price | [optional] [readonly] 12 | **left** | **int** | System liquidation order maker size | [optional] [readonly] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/UnifiedCurrency.md: -------------------------------------------------------------------------------- 1 | # UnifiedCurrency 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **name** | **str** | Currency name | [optional] 7 | **prec** | **str** | Currency precision | [optional] 8 | **min_borrow_amount** | **str** | Minimum borrowable limit, in currency units | [optional] 9 | **user_max_borrow_amount** | **str** | User's maximum borrowable limit, in USDT | [optional] 10 | **total_max_borrow_amount** | **str** | Platform's maximum borrowable limit, in USDT | [optional] 11 | **loan_status** | **str** | Lending status - `disable` : Lending prohibited - `enable` : Lending supported | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/CancelOrderResult.md: -------------------------------------------------------------------------------- 1 | # CancelOrderResult 2 | 3 | Order cancellation result 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency_pair** | **str** | Order currency pair | [optional] 8 | **id** | **str** | Order ID | [optional] 9 | **text** | **str** | Custom order information | [optional] 10 | **succeeded** | **bool** | Whether cancellation succeeded | [optional] 11 | **label** | **str** | Error label when failed to cancel the order; emtpy if succeeded | [optional] 12 | **message** | **str** | Error description when cancellation fails, empty if successful | [optional] 13 | **account** | **str** | Default is empty (deprecated) | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/UniLendRecord.md: -------------------------------------------------------------------------------- 1 | # UniLendRecord 2 | 3 | Lending Record 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency name | [optional] [readonly] 8 | **amount** | **str** | Current Amount | [optional] [readonly] 9 | **last_wallet_amount** | **str** | Previous Available Amount | [optional] [readonly] 10 | **last_lent_amount** | **str** | Previous Lent Amount | [optional] [readonly] 11 | **last_frozen_amount** | **str** | Previous Frozen Amount | [optional] [readonly] 12 | **type** | **str** | Record Type: lend - Lend, redeem - Redeem | [optional] [readonly] 13 | **create_time** | **int** | Created time | [optional] [readonly] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/UniLoanInterestRecord.md: -------------------------------------------------------------------------------- 1 | # UniLoanInterestRecord 2 | 3 | Interest Deduction Record 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency name | [optional] [readonly] 8 | **currency_pair** | **str** | Currency pair | [optional] [readonly] 9 | **actual_rate** | **str** | Actual Rate | [optional] [readonly] 10 | **interest** | **str** | Interest | [optional] [readonly] 11 | **status** | **int** | Status: 0 - fail, 1 - success | [optional] [readonly] 12 | **type** | **str** | Type: platform - Platform borrowing, margin - Margin borrowing | [optional] [readonly] 13 | **create_time** | **int** | Created time | [optional] [readonly] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/AgencyTransaction.md: -------------------------------------------------------------------------------- 1 | # AgencyTransaction 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **transaction_time** | **int** | Transaction Time. (unix timestamp) | [optional] 7 | **user_id** | **int** | User ID | [optional] 8 | **group_name** | **str** | Group name | [optional] 9 | **fee** | **str** | Fee | [optional] 10 | **fee_asset** | **str** | Fee currency | [optional] 11 | **currency_pair** | **str** | Currency pair | [optional] 12 | **amount** | **str** | Transaction amount | [optional] 13 | **amount_asset** | **str** | Commission Asset | [optional] 14 | **source** | **str** | Commission source: SPOT - Spot commission, FUTURES - Futures commission | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/FuturesLimitRiskTiers.md: -------------------------------------------------------------------------------- 1 | # FuturesLimitRiskTiers 2 | 3 | Retrieve risk limit configurations for different tiers under a specified contract 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **tier** | **int** | Tier | [optional] 8 | **risk_limit** | **str** | Position risk limit | [optional] 9 | **initial_rate** | **str** | Initial margin rate | [optional] 10 | **maintenance_rate** | **str** | Maintenance margin rate | [optional] 11 | **leverage_max** | **str** | Maximum leverage | [optional] 12 | **contract** | **str** | Market, only visible when market pagination is requested | [optional] 13 | **deduction** | **str** | Maintenance margin quick calculation deduction amount | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/UnifiedLeverageConfig.md: -------------------------------------------------------------------------------- 1 | # UnifiedLeverageConfig 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **current_leverage** | **str** | Current leverage ratio | [optional] 7 | **min_leverage** | **str** | Minimum adjustable leverage ratio | [optional] 8 | **max_leverage** | **str** | Maximum adjustable leverage ratio | [optional] 9 | **debit** | **str** | Current liabilities | [optional] 10 | **available_margin** | **str** | Available Margin | [optional] 11 | **borrowable** | **str** | Maximum borrowable amount at current leverage | [optional] 12 | **except_leverage_borrowable** | **str** | Maximum borrowable from margin and maximum borrowable from Earn, whichever is smaller | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/UserLtvInfo.md: -------------------------------------------------------------------------------- 1 | # UserLtvInfo 2 | 3 | User's currency statistics data 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **collateral_currency** | **str** | Collateral currency | [optional] 8 | **borrow_currency** | **str** | Borrowed currency | [optional] 9 | **init_ltv** | **str** | Initial collateralization rate | [optional] 10 | **alert_ltv** | **str** | Warning collateralization rate | [optional] 11 | **liquidate_ltv** | **str** | Liquidation collateralization rate | [optional] 12 | **min_borrow_amount** | **str** | Minimum borrowable amount for the loan currency | [optional] 13 | **left_borrowable_amount** | **str** | Remaining borrowable amount for the loan currency | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/DeliverySettlement.md: -------------------------------------------------------------------------------- 1 | # DeliverySettlement 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **int** | Liquidation time | [optional] [readonly] 7 | **contract** | **str** | Futures contract | [optional] [readonly] 8 | **leverage** | **str** | Position leverage | [optional] [readonly] 9 | **size** | **int** | Position size | [optional] [readonly] 10 | **margin** | **str** | Position margin | [optional] [readonly] 11 | **entry_price** | **str** | Average entry price | [optional] [readonly] 12 | **settle_price** | **str** | Settled price | [optional] [readonly] 13 | **profit** | **str** | Profit | [optional] [readonly] 14 | **fee** | **str** | Fee deducted | [optional] [readonly] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/MockRiskUnit.md: -------------------------------------------------------------------------------- 1 | # MockRiskUnit 2 | 3 | Risk unit 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **symbol** | **str** | Risk unit name | [optional] 8 | **spot_in_use** | **str** | Spot hedge usage | [optional] 9 | **maintain_margin** | **str** | Maintenance margin | [optional] 10 | **initial_margin** | **str** | Initial margin | [optional] 11 | **margin_result** | [**list[MockMarginResult]**](MockMarginResult.md) | Margin result | [optional] 12 | **delta** | **str** | Total Delta of risk unit | [optional] 13 | **gamma** | **str** | Total Gamma of risk unit | [optional] 14 | **theta** | **str** | Total Theta of risk unit | [optional] 15 | **vega** | **str** | Total Vega of risk unit | [optional] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/FlashSwapOrderRequest.md: -------------------------------------------------------------------------------- 1 | # FlashSwapOrderRequest 2 | 3 | Parameters of flash swap order creation 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **preview_id** | **str** | Preview result ID | 8 | **sell_currency** | **str** | Name of the asset to be sold, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap | 9 | **sell_amount** | **str** | Amount to sell (based on the preview result) | 10 | **buy_currency** | **str** | Name of the asset to be bought, obtained from the interface GET /flash_swap/currency_pairs: Query the list of all trading pairs supporting flash swap | 11 | **buy_amount** | **str** | Amount to buy (based on the preview result) | 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/FlashSwapOrderPreview.md: -------------------------------------------------------------------------------- 1 | # FlashSwapOrderPreview 2 | 3 | Flash swap order preview 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **preview_id** | **str** | Preview result ID | [optional] 8 | **sell_currency** | **str** | Name of the sold asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain | [optional] 9 | **sell_amount** | **str** | Amount to sell | [optional] 10 | **buy_currency** | **str** | Name of the purchased asset, Refer to the interface Query the list of currencies supported for flash swap GET /flash_swap/currenciesto obtain | [optional] 11 | **buy_amount** | **str** | Amount to buy | [optional] 12 | **price** | **str** | Price | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/MarginAccountBook.md: -------------------------------------------------------------------------------- 1 | # MarginAccountBook 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | Balance change record ID | [optional] 7 | **time** | **str** | Account change timestamp | [optional] 8 | **time_ms** | **int** | The timestamp of the change (in milliseconds) | [optional] 9 | **currency** | **str** | Currency changed | [optional] 10 | **currency_pair** | **str** | Account trading pair | [optional] 11 | **change** | **str** | Amount changed. Positive value means transferring in, while negative out | [optional] 12 | **balance** | **str** | Balance after change | [optional] 13 | **type** | **str** | Account book type. Please refer to [account book type](#accountbook-type) for more detail | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/OptionsCandlestick.md: -------------------------------------------------------------------------------- 1 | # OptionsCandlestick 2 | 3 | data point in every timestamp 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **t** | **float** | Unix timestamp in seconds | [optional] 8 | **v** | **int** | size volume (contract size). Only returned if `contract` is not prefixed | [optional] 9 | **c** | **str** | Close price (quote currency, unit: underlying corresponding option price) | [optional] 10 | **h** | **str** | Highest price (quote currency, unit: underlying corresponding option price) | [optional] 11 | **l** | **str** | Lowest price (quote currency, unit: underlying corresponding option price) | [optional] 12 | **o** | **str** | Open price (quote currency, unit: underlying corresponding option price) | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/CurrencyChain.md: -------------------------------------------------------------------------------- 1 | # CurrencyChain 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **chain** | **str** | Chain name | [optional] 7 | **name_cn** | **str** | Chain name in Chinese | [optional] 8 | **name_en** | **str** | Chain name in English | [optional] 9 | **contract_address** | **str** | Smart contract address for the currency; if no address is available, it will be an empty string | [optional] 10 | **is_disabled** | **int** | If it is disabled. 0 means NOT being disabled | [optional] 11 | **is_deposit_disabled** | **int** | Is deposit disabled. 0 means not disabled | [optional] 12 | **is_withdraw_disabled** | **int** | Is withdrawal disabled. 0 means not disabled | [optional] 13 | **decimal** | **str** | Withdrawal precision | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/SpotAccountBook.md: -------------------------------------------------------------------------------- 1 | # SpotAccountBook 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | Balance change record ID | [optional] 7 | **time** | **int** | The timestamp of the change (in milliseconds) | [optional] 8 | **currency** | **str** | Currency changed | [optional] 9 | **change** | **str** | Amount changed. Positive value means transferring in, while negative out | [optional] 10 | **balance** | **str** | Balance after change | [optional] 11 | **type** | **str** | Account book type. Please refer to [account book type](#accountbook-type) for more detail | [optional] 12 | **code** | **str** | Account change code, see [Asset Record Code] (Asset Record Code) | [optional] 13 | **text** | **str** | Additional information | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/UnifiedPortfolioOutput.md: -------------------------------------------------------------------------------- 1 | # UnifiedPortfolioOutput 2 | 3 | Portfolio margin calculator output 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **maintain_margin_total** | **str** | Total maintenance margin, including only portfolio margin calculation results for positions in risk units, excluding borrowing margin. If borrowing exists, conventional borrowing margin requirements will still apply | [optional] 8 | **initial_margin_total** | **str** | Total initial margin, calculated as the maximum of the following three combinations: position, position + positive delta orders, position + negative delta orders | [optional] 9 | **calculate_time** | **int** | Calculation time | [optional] 10 | **risk_unit** | [**list[MockRiskUnit]**](MockRiskUnit.md) | Risk unit | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/FlashSwapCurrencyPair.md: -------------------------------------------------------------------------------- 1 | # FlashSwapCurrencyPair 2 | 3 | List all supported currencies in flash swap 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency_pair** | **str** | Currency pair, `BTC_USDT` represents selling `BTC` and buying `USDT` | [optional] [readonly] 8 | **sell_currency** | **str** | Currency to sell | [optional] [readonly] 9 | **buy_currency** | **str** | Currency to buy | [optional] [readonly] 10 | **sell_min_amount** | **str** | Minimum sell quantity | [optional] [readonly] 11 | **sell_max_amount** | **str** | Maximum sell quantity | [optional] [readonly] 12 | **buy_min_amount** | **str** | Minimum buy quantity | [optional] [readonly] 13 | **buy_max_amount** | **str** | Maximum buy quantity | [optional] [readonly] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/CancelBatchOrder.md: -------------------------------------------------------------------------------- 1 | # CancelBatchOrder 2 | 3 | Info of order to be cancelled 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency_pair** | **str** | Order currency pair | 8 | **id** | **str** | Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation | 9 | **account** | **str** | If the canceled order is a unified account apikey, this field must be specified and set to `unified` | [optional] 10 | **action_mode** | **str** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/MultiCollateralRecord.md: -------------------------------------------------------------------------------- 1 | # MultiCollateralRecord 2 | 3 | Multi-Collateral adjustment record 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order ID | [optional] 8 | **record_id** | **int** | Collateral record ID | [optional] 9 | **before_ltv** | **str** | Collateral ratio before adjustment | [optional] 10 | **after_ltv** | **str** | Collateral ratio before adjustment | [optional] 11 | **operate_time** | **int** | Operation time, timestamp in seconds | [optional] 12 | **borrow_currencies** | [**list[MultiCollateralRecordCurrency]**](MultiCollateralRecordCurrency.md) | Borrowing Currency List | [optional] 13 | **collateral_currencies** | [**list[MultiCollateralRecordCurrency]**](MultiCollateralRecordCurrency.md) | Collateral Currency List | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/MockMarginResult.md: -------------------------------------------------------------------------------- 1 | # MockMarginResult 2 | 3 | Margin result 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **type** | **str** | Position combination type `original_position` - Original position `long_delta_original_position` - Positive delta + Original position `short_delta_original_position` - Negative delta + Original position | [optional] 8 | **profit_loss_ranges** | [**list[ProfitLossRange]**](ProfitLossRange.md) | Results of 33 stress scenarios for MR1 | [optional] 9 | **max_loss** | [**ProfitLossRange**](.md) | 最大损失 | [optional] 10 | **mr1** | **str** | Stress testing | [optional] 11 | **mr2** | **str** | Basis spread risk | [optional] 12 | **mr3** | **str** | Volatility spread risk | [optional] 13 | **mr4** | **str** | Option short risk | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /gate_api/api/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # flake8: noqa 4 | 5 | # import apis into api package 6 | from gate_api.api.earn_uni_api import EarnUniApi 7 | from gate_api.api.margin_uni_api import MarginUniApi 8 | from gate_api.api.sub_account_api import SubAccountApi 9 | from gate_api.api.unified_api import UnifiedApi 10 | from gate_api.api.account_api import AccountApi 11 | from gate_api.api.collateral_loan_api import CollateralLoanApi 12 | from gate_api.api.delivery_api import DeliveryApi 13 | from gate_api.api.earn_api import EarnApi 14 | from gate_api.api.flash_swap_api import FlashSwapApi 15 | from gate_api.api.futures_api import FuturesApi 16 | from gate_api.api.margin_api import MarginApi 17 | from gate_api.api.multi_collateral_loan_api import MultiCollateralLoanApi 18 | from gate_api.api.options_api import OptionsApi 19 | from gate_api.api.rebate_api import RebateApi 20 | from gate_api.api.spot_api import SpotApi 21 | from gate_api.api.wallet_api import WalletApi 22 | from gate_api.api.withdrawal_api import WithdrawalApi 23 | -------------------------------------------------------------------------------- /docs/FlashSwapOrder.md: -------------------------------------------------------------------------------- 1 | # FlashSwapOrder 2 | 3 | Flash swap order 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **int** | Flash swap order ID | [optional] [readonly] 8 | **create_time** | **int** | Creation time of order (in milliseconds) | [optional] [readonly] 9 | **user_id** | **int** | User ID | [optional] [readonly] 10 | **sell_currency** | **str** | Currency to sell | [optional] [readonly] 11 | **sell_amount** | **str** | Amount to sell | [optional] [readonly] 12 | **buy_currency** | **str** | Currency to buy | [optional] [readonly] 13 | **buy_amount** | **str** | Amount to buy | [optional] [readonly] 14 | **price** | **str** | Price | [optional] [readonly] 15 | **status** | **int** | Flash swap order status `1` - success `2` - failure | [optional] [readonly] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/OptionsMySettlements.md: -------------------------------------------------------------------------------- 1 | # OptionsMySettlements 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **float** | Settlement time | [optional] 7 | **underlying** | **str** | Underlying | [optional] 8 | **contract** | **str** | Options contract name | [optional] 9 | **strike_price** | **str** | Strike price (quote currency) | [optional] 10 | **settle_price** | **str** | Settlement price (quote currency) | [optional] 11 | **size** | **int** | Settlement size | [optional] 12 | **settle_profit** | **str** | Settlement profit (quote currency) | [optional] 13 | **fee** | **str** | Settlement fee (quote currency) | [optional] 14 | **realised_pnl** | **str** | Accumulated profit and loss from opening positions, including premium, fees, settlement profit, etc. (quote currency) | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/BrokerTransaction1.md: -------------------------------------------------------------------------------- 1 | # BrokerTransaction1 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **transaction_time** | **int** | Transaction Time. (unix timestamp) | [optional] 7 | **user_id** | **int** | User ID | [optional] 8 | **group_name** | **str** | Group name | [optional] 9 | **fee** | **str** | Fee amount (USDT) | [optional] 10 | **currency_pair** | **str** | Currency pair | [optional] 11 | **amount** | **str** | Transaction amount | [optional] 12 | **fee_asset** | **str** | Fee currency | [optional] 13 | **source** | **str** | Commission transaction type: Spot, Futures, Options, Alpha | [optional] 14 | **sub_broker_info** | [**BrokerCommissionSubBrokerInfo**](BrokerCommissionSubBrokerInfo.md) | | [optional] 15 | **alpha_contract_addr** | **str** | Alpha contract address | [optional] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/FuturesOrderAmendment.md: -------------------------------------------------------------------------------- 1 | # FuturesOrderAmendment 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **size** | **int** | New order size, including filled part. - If new size is less than or equal to filled size, the order will be cancelled. - Order side must be identical to the original one. - Close order size cannot be changed. - For reduce only orders, increasing size may leads to other reduce only orders being cancelled. - If price is not changed, decreasing size will not change its precedence in order book, while increasing will move it to the last at current price. | [optional] 7 | **price** | **str** | New order price | [optional] 8 | **amend_text** | **str** | Custom info during order amendment | [optional] 9 | **text** | **str** | Internal users can modify information in the text field. | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/SubAccountKey.md: -------------------------------------------------------------------------------- 1 | # SubAccountKey 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **user_id** | **int** | User ID | [optional] [readonly] 7 | **mode** | **int** | Mode: 1 - classic 2 - portfolio account | [optional] 8 | **name** | **str** | API Key Name | [optional] 9 | **perms** | [**list[SubAccountKeyPerms]**](SubAccountKeyPerms.md) | | [optional] 10 | **ip_whitelist** | **list[str]** | IP whitelist (list will be cleared if no value is passed) | [optional] 11 | **key** | **str** | API Key | [optional] [readonly] 12 | **state** | **int** | Status: 1-Normal 2-Frozen 3-Locked | [optional] [readonly] 13 | **created_at** | **int** | Created time | [optional] [readonly] 14 | **updated_at** | **int** | Last Update Time | [optional] [readonly] 15 | **last_access** | **int** | Last Access Time | [optional] [readonly] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /.github/workflows/python-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | name: Upload Python Package 5 | 6 | on: push 7 | 8 | jobs: 9 | deploy: 10 | 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Set up Python 16 | uses: actions/setup-python@v2 17 | with: 18 | python-version: '3.x' 19 | - name: Install dependencies 20 | run: | 21 | python -m pip install --upgrade pip 22 | pip install setuptools wheel twine 23 | - name: Build and publish 24 | run: | 25 | python setup.py sdist bdist_wheel 26 | - name: Publish package 27 | if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') 28 | uses: pypa/gh-action-pypi-publish@v1.4.2 29 | with: 30 | user: __token__ 31 | password: ${{ secrets.PYPI_API_TOKEN }} 32 | -------------------------------------------------------------------------------- /docs/UnifiedPortfolioInput.md: -------------------------------------------------------------------------------- 1 | # UnifiedPortfolioInput 2 | 3 | Portfolio margin calculator input 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **spot_balances** | [**list[MockSpotBalance]**](MockSpotBalance.md) | Spot | [optional] 8 | **spot_orders** | [**list[MockSpotOrder]**](MockSpotOrder.md) | Spot orders | [optional] 9 | **futures_positions** | [**list[MockFuturesPosition]**](MockFuturesPosition.md) | Futures positions | [optional] 10 | **futures_orders** | [**list[MockFuturesOrder]**](MockFuturesOrder.md) | Futures order | [optional] 11 | **options_positions** | [**list[MockOptionsPosition]**](MockOptionsPosition.md) | Options positions | [optional] 12 | **options_orders** | [**list[MockOptionsOrder]**](MockOptionsOrder.md) | Option orders | [optional] 13 | **spot_hedge** | **bool** | Whether to enable spot hedging | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/CollateralRecord.md: -------------------------------------------------------------------------------- 1 | # CollateralRecord 2 | 3 | Collateral record 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order ID | [optional] 8 | **record_id** | **int** | Collateral record ID | [optional] 9 | **borrow_currency** | **str** | Borrowed currency | [optional] 10 | **borrow_amount** | **str** | Borrowed amount | [optional] 11 | **collateral_currency** | **str** | Collateral currency | [optional] 12 | **before_collateral** | **str** | Collateral amount before adjustment | [optional] 13 | **after_collateral** | **str** | Collateral amount after adjustment | [optional] 14 | **before_ltv** | **str** | Collateral ratio before adjustment | [optional] 15 | **after_ltv** | **str** | Collateral ratio after adjustment | [optional] 16 | **operate_time** | **int** | Operation time, timestamp in seconds | [optional] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/FuturesTrade.md: -------------------------------------------------------------------------------- 1 | # FuturesTrade 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Fill ID | [optional] 7 | **create_time** | **float** | Fill Time | [optional] 8 | **create_time_ms** | **float** | Trade time, with millisecond precision to 3 decimal places | [optional] 9 | **contract** | **str** | Futures contract | [optional] 10 | **size** | **int** | Trading size | [optional] 11 | **price** | **str** | Trade price (quote currency) | [optional] 12 | **is_internal** | **bool** | Whether it is an internal trade. Internal trade refers to the takeover of liquidation orders by the insurance fund and ADL users. Since it is not a normal matching on the market depth, the trade price may deviate from the market, and it will not be recorded in the K-line. If it is not an internal trade, this field will not be returned | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | venv/ 48 | .venv/ 49 | .python-version 50 | .pytest_cache 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | 59 | # Sphinx documentation 60 | docs/_build/ 61 | 62 | # PyBuilder 63 | target/ 64 | 65 | #Ipython Notebook 66 | .ipynb_checkpoints 67 | -------------------------------------------------------------------------------- /docs/FlashSwapPreviewRequest.md: -------------------------------------------------------------------------------- 1 | # FlashSwapPreviewRequest 2 | 3 | Parameters of flash swap order creation 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **sell_currency** | **str** | The name of the asset being sold, as obtained from the \"GET /flash_swap/currency_pairs\" API, which retrieves a list of supported flash swap currency pairs | 8 | **sell_amount** | **str** | Amount to sell. It is required to choose one parameter between `sell_amount` and `buy_amount` | [optional] 9 | **buy_currency** | **str** | The name of the asset being purchased, as obtained from the \"GET /flash_swap/currency_pairs\" API, which provides a list of supported flash swap currency pairs | 10 | **buy_amount** | **str** | Amount to buy. It is required to choose one parameter between `sell_amount` and `buy_amount` | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/UidPushOrder.md: -------------------------------------------------------------------------------- 1 | # UidPushOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Order ID | [optional] 7 | **push_uid** | **int** | Initiator User ID | [optional] 8 | **receive_uid** | **int** | Recipient User ID | [optional] 9 | **currency** | **str** | Currency name | [optional] 10 | **amount** | **str** | Transfer amount | [optional] 11 | **create_time** | **int** | Created time | [optional] 12 | **status** | **str** | Withdrawal status: - CREATING: Creating - PENDING: Waiting for recipient (Please contact the recipient to accept the transfer on Gate official website) - CANCELLING: Cancelling - CANCELLED: Cancelled - REFUSING: Refusing - REFUSED: Refused - RECEIVING: Receiving - RECEIVED: Success | [optional] 13 | **message** | **str** | PENDING reason tips | [optional] 14 | **transaction_type** | **str** | Order Type | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/SubAccountTransfer.md: -------------------------------------------------------------------------------- 1 | # SubAccountTransfer 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **sub_account** | **str** | Sub account user ID | 7 | **sub_account_type** | **str** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account | [optional] [default to 'spot'] 8 | **currency** | **str** | Transfer currency name | 9 | **amount** | **str** | Transfer amount | 10 | **direction** | **str** | Transfer direction: to - transfer into sub-account, from - transfer out from sub-account | 11 | **client_order_id** | **str** | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/Transfer.md: -------------------------------------------------------------------------------- 1 | # Transfer 2 | 3 | Accounts available to transfer: - `spot`: spot account - `margin`: margin account - `futures`: perpetual futures account - `delivery`: delivery futures account - `options`: options account 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Transfer currency name. For contract accounts, `currency` can be set to `POINT` (points) or supported settlement currencies (e.g., `BTC`, `USDT`) | 8 | **_from** | **str** | Account to transfer from | 9 | **to** | **str** | Account to transfer to | 10 | **amount** | **str** | Transfer amount | 11 | **currency_pair** | **str** | Margin trading pair. Required when transferring to or from margin account | [optional] 12 | **settle** | **str** | Contract settlement currency. Required when transferring to or from contract account | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/OrderPatch.md: -------------------------------------------------------------------------------- 1 | # OrderPatch 2 | 3 | Spot order details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency_pair** | **str** | Currency pair | [optional] 8 | **account** | **str** | Specify query account | [optional] 9 | **amount** | **str** | Trading quantity. Either `amount` or `price` must be specified | [optional] 10 | **price** | **str** | Trading price. Either `amount` or `price` must be specified | [optional] 11 | **amend_text** | **str** | Custom info during order amendment | [optional] 12 | **action_mode** | **str** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/SubAccount.md: -------------------------------------------------------------------------------- 1 | # SubAccount 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **remark** | **str** | Remark | [optional] 7 | **login_name** | **str** | Sub-account login name: Only letters, numbers and underscores are supported, cannot contain other invalid characters | 8 | **password** | **str** | The sub-account's password. (Default: the same as main account's password) | [optional] 9 | **email** | **str** | The sub-account's email address. (Default: the same as main account's email address) | [optional] 10 | **state** | **int** | Sub-account status: 1-normal, 2-locked | [optional] [readonly] 11 | **type** | **int** | Sub-account type: 1-Regular sub-account, 3-Cross margin sub-account | [optional] [readonly] 12 | **user_id** | **int** | Sub-account user ID | [optional] [readonly] 13 | **create_time** | **int** | Created time | [optional] [readonly] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/SubAccountToSubAccount.md: -------------------------------------------------------------------------------- 1 | # SubAccountToSubAccount 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Transfer currency name | 7 | **sub_account_type** | **str** | Transfer from account (deprecated, use `sub_account_from_type` and `sub_account_to_type` instead) | [optional] 8 | **sub_account_from** | **str** | Transfer from the user id of the sub-account | 9 | **sub_account_from_type** | **str** | Source sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account | 10 | **sub_account_to** | **str** | Transfer to the user id of the sub-account | 11 | **sub_account_to_type** | **str** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account | 12 | **amount** | **str** | Transfer amount | 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/OptionsMMP.md: -------------------------------------------------------------------------------- 1 | # OptionsMMP 2 | 3 | MMP Settings 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **underlying** | **str** | Underlying | 8 | **window** | **int** | Time window (milliseconds), between 1-5000, 0 means disable MMP | 9 | **frozen_period** | **int** | Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze | 10 | **qty_limit** | **str** | Trading volume upper limit (positive number, up to 2 decimal places) | 11 | **delta_limit** | **str** | Upper limit of net delta value (positive number, up to 2 decimal places) | 12 | **trigger_time_ms** | **int** | Trigger freeze time (milliseconds), 0 means no freeze is triggered | [optional] [readonly] 13 | **frozen_until_ms** | **int** | Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered | [optional] [readonly] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/FuturesAccountBook.md: -------------------------------------------------------------------------------- 1 | # FuturesAccountBook 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **float** | Change time | [optional] 7 | **change** | **str** | Change amount | [optional] 8 | **balance** | **str** | Balance after change | [optional] 9 | **type** | **str** | Change types: - dnw: Deposit and withdrawal - pnl: Profit and loss from position reduction - fee: Trading fees - refr: Referrer rebates - fund: Funding fees - point_dnw: Point card deposit and withdrawal - point_fee: Point card trading fees - point_refr: Point card referrer rebates - bonus_offset: Trial fund deduction | [optional] 10 | **text** | **str** | Comment | [optional] 11 | **contract** | **str** | Futures contract, the field is only available for data after 2023-10-30 | [optional] 12 | **trade_id** | **str** | trade id | [optional] 13 | **id** | **str** | Account change record ID | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/BrokerCommission1.md: -------------------------------------------------------------------------------- 1 | # BrokerCommission1 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **commission_time** | **int** | Commission time (Unix timestamp in seconds) | [optional] 7 | **user_id** | **int** | User ID | [optional] 8 | **group_name** | **str** | Group name | [optional] 9 | **amount** | **str** | The amount of commission rebates | [optional] 10 | **fee** | **str** | Fee | [optional] 11 | **fee_asset** | **str** | Fee currency | [optional] 12 | **rebate_fee** | **str** | The income from rebates, converted to USDT | [optional] 13 | **source** | **str** | Commission transaction type: Spot, Futures, Options, Alpha | [optional] 14 | **currency_pair** | **str** | Currency pair | [optional] 15 | **sub_broker_info** | [**BrokerCommissionSubBrokerInfo**](BrokerCommissionSubBrokerInfo.md) | | [optional] 16 | **alpha_contract_addr** | **str** | Alpha contract address | [optional] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/FuturesAccountHistory.md: -------------------------------------------------------------------------------- 1 | # FuturesAccountHistory 2 | 3 | Statistical data 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **dnw** | **str** | total amount of deposit and withdraw | [optional] 8 | **pnl** | **str** | total amount of trading profit and loss | [optional] 9 | **fee** | **str** | total amount of fee | [optional] 10 | **refr** | **str** | total amount of referrer rebates | [optional] 11 | **fund** | **str** | total amount of funding costs | [optional] 12 | **point_dnw** | **str** | total amount of point deposit and withdraw | [optional] 13 | **point_fee** | **str** | total amount of point fee | [optional] 14 | **point_refr** | **str** | total amount of referrer rebates of point fee | [optional] 15 | **bonus_dnw** | **str** | total amount of perpetual contract bonus transfer | [optional] 16 | **bonus_offset** | **str** | total amount of perpetual contract bonus deduction | [optional] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/CreateMultiCollateralOrder.md: -------------------------------------------------------------------------------- 1 | # CreateMultiCollateralOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **order_id** | **str** | Order ID | [optional] 7 | **order_type** | **str** | current - current rate, fixed - fixed rate, defaults to current if not specified | [optional] 8 | **fixed_type** | **str** | Fixed interest rate lending period: 7d - 7 days, 30d - 30 days. Required for fixed rate | [optional] 9 | **fixed_rate** | **str** | Fixed interest rate, required for fixed rate | [optional] 10 | **auto_renew** | **bool** | Fixed interest rate, auto-renewal | [optional] 11 | **auto_repay** | **bool** | Fixed interest rate, auto-repayment | [optional] 12 | **borrow_currency** | **str** | Borrowed currency | 13 | **borrow_amount** | **str** | Borrowed amount | 14 | **collateral_currencies** | [**list[CollateralCurrency]**](CollateralCurrency.md) | Collateral currency and amount | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/FuturesAutoDeleverage.md: -------------------------------------------------------------------------------- 1 | # FuturesAutoDeleverage 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **int** | Automatic deleveraging time | [optional] [readonly] 7 | **user** | **int** | User ID | [optional] [readonly] 8 | **order_id** | **int** | Order ID. Order IDs before 2023-02-20 are null | [optional] [readonly] 9 | **contract** | **str** | Futures contract | [optional] [readonly] 10 | **leverage** | **str** | Position leverage | [optional] [readonly] 11 | **cross_leverage_limit** | **str** | Cross margin leverage (valid only when `leverage` is 0) | [optional] [readonly] 12 | **entry_price** | **str** | Average entry price | [optional] [readonly] 13 | **fill_price** | **str** | Average fill price | [optional] [readonly] 14 | **trade_size** | **int** | Trading size | [optional] [readonly] 15 | **position_size** | **int** | Positions after auto-deleveraging | [optional] [readonly] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/CrossMarginLoan.md: -------------------------------------------------------------------------------- 1 | # CrossMarginLoan 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | Loan record ID | [optional] [readonly] 7 | **create_time** | **int** | Creation timestamp, in milliseconds | [optional] [readonly] 8 | **update_time** | **int** | Update timestamp, in milliseconds | [optional] [readonly] 9 | **currency** | **str** | Currency name | 10 | **amount** | **str** | Borrowed amount | 11 | **text** | **str** | User defined custom ID | [optional] 12 | **status** | **int** | Deprecated. Currently, all statuses have been set to 2. Borrow loan status, which includes: - 1: failed to borrow - 2: borrowed but not repaid - 3: repayment complete | [optional] [readonly] 13 | **repaid** | **str** | Repaid amount | [optional] [readonly] 14 | **repaid_interest** | **str** | Repaid interest | [optional] [readonly] 15 | **unpaid_interest** | **str** | Unpaid interest | [optional] [readonly] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/DualGetPlans.md: -------------------------------------------------------------------------------- 1 | # DualGetPlans 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Product ID | [optional] 7 | **instrument_name** | **str** | Product Name | [optional] 8 | **invest_currency** | **str** | Investment Token | [optional] 9 | **exercise_currency** | **str** | Strike Token | [optional] 10 | **exercise_price** | **float** | Strike price | [optional] 11 | **delivery_time** | **int** | Settlement time | [optional] 12 | **min_copies** | **int** | Minimum Units | [optional] 13 | **max_copies** | **int** | Maximum Units | [optional] 14 | **per_value** | **str** | Value Per Unit | [optional] 15 | **apy_display** | **str** | Annual Yield | [optional] 16 | **start_time** | **int** | Start Time | [optional] 17 | **end_time** | **int** | End time | [optional] 18 | **status** | **str** | Status: `NOTSTARTED`-Not Started `ONGOING`-In Progress `ENDED`-Ended | [optional] 19 | 20 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/SpotPriceTriggeredOrder.md: -------------------------------------------------------------------------------- 1 | # SpotPriceTriggeredOrder 2 | 3 | Spot price order details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **trigger** | [**SpotPriceTrigger**](SpotPriceTrigger.md) | | 8 | **put** | [**SpotPricePutOrder**](SpotPricePutOrder.md) | | 9 | **id** | **int** | Auto order ID | [optional] [readonly] 10 | **user** | **int** | User ID | [optional] [readonly] 11 | **market** | **str** | Market | 12 | **ctime** | **int** | Created time | [optional] [readonly] 13 | **ftime** | **int** | End time | [optional] [readonly] 14 | **fired_order_id** | **int** | ID of the order created after trigger | [optional] [readonly] 15 | **status** | **str** | Status - open: Running - cancelled: Manually cancelled - finish: Successfully completed - failed: Failed to execute - expired: Expired | [optional] [readonly] 16 | **reason** | **str** | Additional description of how the order was completed | [optional] [readonly] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/LiquidateOrder.md: -------------------------------------------------------------------------------- 1 | # LiquidateOrder 2 | 3 | Spot liquidation order details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **text** | **str** | Order custom information. Users can set custom ID with this field. Custom fields must meet the following conditions: 1. Must start with `t-` 2. Excluding `t-`, length cannot exceed 28 bytes 3. Can only contain numbers, letters, underscore(_), hyphen(-) or dot(.) | [optional] 8 | **currency_pair** | **str** | Currency pair | 9 | **amount** | **str** | Trade amount | 10 | **price** | **str** | Order price | 11 | **action_mode** | **str** | Processing mode: Different fields are returned when placing an order based on action_mode. This field is only valid during the request and is not included in the response `ACK`: Asynchronous mode, only returns key order fields `RESULT`: No liquidation information `FULL`: Full mode (default) | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/UniLend.md: -------------------------------------------------------------------------------- 1 | # UniLend 2 | 3 | Loan record 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | Currency | [optional] [readonly] 8 | **current_amount** | **str** | Current amount | [optional] [readonly] 9 | **amount** | **str** | Total Lending Amount | [optional] [readonly] 10 | **lent_amount** | **str** | Lent Amount | [optional] [readonly] 11 | **frozen_amount** | **str** | Pending Redemption Amount | [optional] [readonly] 12 | **min_rate** | **str** | Minimum interest rate | [optional] [readonly] 13 | **interest_status** | **str** | Interest status: interest_dividend - Normal dividend, interest_reinvest - Interest reinvestment | [optional] [readonly] 14 | **reinvest_left_amount** | **str** | Non-reinvested Amount | [optional] [readonly] 15 | **create_time** | **int** | Lending Order Creation Time | [optional] [readonly] 16 | **update_time** | **int** | Lending Order Last Update Time | [optional] [readonly] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/SpotFee.md: -------------------------------------------------------------------------------- 1 | # SpotFee 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **user_id** | **int** | User ID | [optional] 7 | **taker_fee** | **str** | taker fee rate | [optional] 8 | **maker_fee** | **str** | maker fee rate | [optional] 9 | **gt_discount** | **bool** | Whether GT deduction discount is enabled | [optional] 10 | **gt_taker_fee** | **str** | Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] 11 | **gt_maker_fee** | **str** | Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled | [optional] 12 | **loan_fee** | **str** | Loan fee rate of margin lending | [optional] 13 | **point_type** | **str** | Point card type: 0 - Original version, 1 - New version since 202009 | [optional] 14 | **currency_pair** | **str** | Currency pair | [optional] 15 | **debit_fee** | **int** | Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates | [optional] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/SwapCoinStruct.md: -------------------------------------------------------------------------------- 1 | # SwapCoinStruct 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Order ID | [optional] 7 | **pid** | **int** | Product ID | [optional] 8 | **uid** | **int** | User ID | [optional] 9 | **coin** | **str** | Currency | [optional] 10 | **type** | **int** | Type 0-Staking 1-Redemption | [optional] 11 | **subtype** | **str** | SubType | [optional] 12 | **amount** | **str** | Amount | [optional] 13 | **exchange_rate** | **str** | Exchange ratio | [optional] 14 | **exchange_amount** | **str** | Redemption Amount | [optional] 15 | **update_stamp** | **int** | UpdateTimestamp | [optional] 16 | **create_stamp** | **int** | Transaction timestamp | [optional] 17 | **status** | **int** | status 1-success | [optional] 18 | **protocol_type** | **int** | DEFI Protocol Type | [optional] 19 | **client_order_id** | **str** | Reference ID | [optional] 20 | **source** | **str** | Order Origin | [optional] 21 | 22 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/BatchAmendOrderReq.md: -------------------------------------------------------------------------------- 1 | # BatchAmendOrderReq 2 | 3 | Modify contract order parameters 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order id, order_id and text must contain at least one | [optional] 8 | **text** | **str** | User-defined order text, at least one of order_id and text must be passed | [optional] 9 | **size** | **int** | New order size, including filled size. - If less than or equal to the filled quantity, the order will be cancelled. - The new order side must be identical to the original one. - Close order size cannot be modified. - For reduce-only orders, increasing the size may cancel other reduce-only orders. - If the price is not modified, decreasing the size will not affect the depth queue, while increasing the size will place it at the end of the current price level. | [optional] 10 | **price** | **str** | New order price | [optional] 11 | **amend_text** | **str** | Custom info during order amendment | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/OptionsMMPReset.md: -------------------------------------------------------------------------------- 1 | # OptionsMMPReset 2 | 3 | MMP Reset 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **underlying** | **str** | Underlying | 8 | **window** | **int** | Time window (milliseconds), between 1-5000, 0 means disable MMP | [optional] [readonly] 9 | **frozen_period** | **int** | Freeze duration (milliseconds), 0 means always frozen, need to call reset API to unfreeze | [optional] [readonly] 10 | **qty_limit** | **str** | Trading volume upper limit (positive number, up to 2 decimal places) | [optional] [readonly] 11 | **delta_limit** | **str** | Upper limit of net delta value (positive number, up to 2 decimal places) | [optional] [readonly] 12 | **trigger_time_ms** | **int** | Trigger freeze time (milliseconds), 0 means no freeze is triggered | [optional] [readonly] 13 | **frozen_until_ms** | **int** | Unfreeze time (milliseconds). If the freeze duration is not configured, there will be no unfreeze time after the freeze is triggered | [optional] [readonly] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/FuturesBatchAmendOrderRequest.md: -------------------------------------------------------------------------------- 1 | # FuturesBatchAmendOrderRequest 2 | 3 | Modify contract order parameters 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order id, order_id and text must contain at least one | [optional] 8 | **text** | **str** | User-defined order text, at least one of order_id and text must be passed | [optional] 9 | **size** | **int** | New order size, including filled size. - If less than or equal to the filled quantity, the order will be cancelled. - The new order side must be identical to the original one. - Close order size cannot be modified. - For reduce-only orders, increasing the size may cancel other reduce-only orders. - If the price is not modified, decreasing the size will not affect the depth queue, while increasing the size will place it at the end of the current price level. | [optional] 10 | **price** | **str** | New order price | [optional] 11 | **amend_text** | **str** | Custom info during order amendment | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/Currency.md: -------------------------------------------------------------------------------- 1 | # Currency 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency symbol | [optional] 7 | **name** | **str** | Currency name | [optional] 8 | **delisted** | **bool** | Whether currency is de-listed | [optional] 9 | **withdraw_disabled** | **bool** | Whether currency's withdrawal is disabled (deprecated) | [optional] 10 | **withdraw_delayed** | **bool** | Whether currency's withdrawal is delayed (deprecated) | [optional] 11 | **deposit_disabled** | **bool** | Whether currency's deposit is disabled (deprecated) | [optional] 12 | **trade_disabled** | **bool** | Whether currency's trading is disabled | [optional] 13 | **fixed_rate** | **str** | Fixed fee rate. Only for fixed rate currencies, not valid for normal currencies | [optional] 14 | **chain** | **str** | The main chain corresponding to the coin | [optional] 15 | **chains** | [**list[SpotCurrencyChain]**](SpotCurrencyChain.md) | All links corresponding to coins | [optional] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Gate API 5 | 6 | Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading. # noqa: E501 7 | 8 | Contact: support@mail.gate.com 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from setuptools import setup, find_packages # noqa: H301 14 | 15 | NAME = "gate-api" 16 | VERSION = "7.1.8" 17 | # To install the library, run the following 18 | # 19 | # python setup.py install 20 | # 21 | # prerequisite: setuptools 22 | # http://pypi.python.org/pypi/setuptools 23 | 24 | REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] 25 | 26 | setup( 27 | name=NAME, 28 | version=VERSION, 29 | description="Gate API", 30 | author="Gate API support", 31 | author_email="support@mail.gate.com", 32 | url="https://github.com/gateio/gateapi-python", 33 | keywords=["OpenAPI", "OpenAPI-Generator", "Gate API"], 34 | install_requires=REQUIRES, 35 | packages=find_packages(exclude=["test", "tests"]), 36 | include_package_data=True, 37 | license="Apache License 2.0" 38 | ) 39 | -------------------------------------------------------------------------------- /docs/UnifiedLoanRecord.md: -------------------------------------------------------------------------------- 1 | # UnifiedLoanRecord 2 | 3 | Borrowing Records 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **int** | ID | [optional] [readonly] 8 | **type** | **str** | Type: `borrow` - borrow, `repay` - repay | [optional] [readonly] 9 | **repayment_type** | **str** | Repayment type: none - No repayment type, manual_repay - Manual repayment, auto_repay - Automatic repayment, cancel_auto_repay - Automatic repayment after order cancellation, different_currencies_repayment - Cross-currency repayment | [optional] [readonly] 10 | **borrow_type** | **str** | Borrowing type, returned when querying loan records: manual_borrow - Manual borrowing, auto_borrow - Automatic borrowing | [optional] 11 | **currency_pair** | **str** | Currency pair | [optional] [readonly] 12 | **currency** | **str** | Currency | [optional] [readonly] 13 | **amount** | **str** | Borrow or repayment amount | [optional] [readonly] 14 | **create_time** | **int** | Created time | [optional] [readonly] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/WithdrawStatus.md: -------------------------------------------------------------------------------- 1 | # WithdrawStatus 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency** | **str** | Currency | [optional] 7 | **name** | **str** | Currency name | [optional] 8 | **name_cn** | **str** | Currency Chinese name | [optional] 9 | **deposit** | **str** | Deposit fee | [optional] 10 | **withdraw_percent** | **str** | Withdrawal fee rate percentage | [optional] 11 | **withdraw_fix** | **str** | Fixed withdrawal fee | [optional] 12 | **withdraw_day_limit** | **str** | Daily allowed withdrawal amount | [optional] 13 | **withdraw_amount_mini** | **str** | Minimum withdrawal amount | [optional] 14 | **withdraw_day_limit_remain** | **str** | Daily withdrawal amount left | [optional] 15 | **withdraw_eachtime_limit** | **str** | Maximum amount for each withdrawal | [optional] 16 | **withdraw_fix_on_chains** | **dict(str, str)** | Fixed withdrawal fee on multiple chains | [optional] 17 | **withdraw_percent_on_chains** | **dict(str, str)** | Percentage withdrawal fee on multiple chains | [optional] 18 | 19 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/MarginAccount.md: -------------------------------------------------------------------------------- 1 | # MarginAccount 2 | 3 | Margin account information for a trading pair. `base` corresponds to base currency account information, `quote` corresponds to quote currency account information 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency_pair** | **str** | Currency pair | [optional] 8 | **account_type** | **str** | Account type: risk - risk rate account, mmr - maintenance margin rate account, inactive - market not activated | [optional] 9 | **leverage** | **str** | User's current market leverage multiplier | [optional] 10 | **locked** | **bool** | Whether the account is locked | [optional] 11 | **risk** | **str** | Current risk rate of the margin account (returned when the account is a risk rate account) | [optional] 12 | **mmr** | **str** | Leveraged Account Current Maintenance Margin Rate (returned when the Account is Account) | [optional] 13 | **base** | [**MarginAccountCurrency**](MarginAccountCurrency.md) | | [optional] 14 | **quote** | [**MarginAccountCurrency**](MarginAccountCurrency.md) | | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/RepayRecord.md: -------------------------------------------------------------------------------- 1 | # RepayRecord 2 | 3 | Repayment record 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order ID | [optional] 8 | **record_id** | **int** | Repayment record ID | [optional] 9 | **repaid_amount** | **str** | Repayment amount | [optional] 10 | **borrow_currency** | **str** | Borrowed currency | [optional] 11 | **collateral_currency** | **str** | Collateral currency | [optional] 12 | **init_ltv** | **str** | Initial collateralization rate | [optional] 13 | **borrow_time** | **int** | Borrowing time, timestamp | [optional] 14 | **repay_time** | **int** | Repayment time, timestamp | [optional] 15 | **total_interest** | **str** | Total interest | [optional] 16 | **before_left_principal** | **str** | Principal to be repaid before repayment | [optional] 17 | **after_left_principal** | **str** | Principal to be repaid after repayment | [optional] 18 | **before_left_collateral** | **str** | Collateral amount before repayment | [optional] 19 | **after_left_collateral** | **str** | Collateral amount after repayment | [optional] 20 | 21 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/BatchAmendItem.md: -------------------------------------------------------------------------------- 1 | # BatchAmendItem 2 | 3 | Order information that needs to be modified 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **str** | The order ID returned upon successful creation or the custom ID specified by the user during creation (i.e., the 'text' field) | 8 | **currency_pair** | **str** | Currency pair | 9 | **account** | **str** | Default spot, unified account and warehouse-by-store leverage account | [optional] 10 | **amount** | **str** | Trading Quantity. Only one of `amount` or `price` can be specified | [optional] 11 | **price** | **str** | Trading Price. Only one of `amount` or `price` can be specified | [optional] 12 | **amend_text** | **str** | Custom info during order amendment | [optional] 13 | **action_mode** | **str** | Processing Mode: When placing an order, different fields are returned based on action_mode. This field is only valid during the request and is not included in the response result ACK: Asynchronous mode, only returns key order fields RESULT: No clearing information FULL: Full mode (default) | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/DepositRecord.md: -------------------------------------------------------------------------------- 1 | # DepositRecord 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | Record ID | [optional] [readonly] 7 | **txid** | **str** | Hash record of the withdrawal | [optional] [readonly] 8 | **withdraw_order_id** | **str** | Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] 9 | **timestamp** | **str** | Operation time | [optional] [readonly] 10 | **amount** | **str** | Token amount | 11 | **currency** | **str** | Currency name | 12 | **address** | **str** | Withdrawal address. Required for withdrawals | [optional] 13 | **memo** | **str** | Additional remarks with regards to the withdrawal | [optional] 14 | **status** | **str** | Trading Status - REVIEW: Recharge review (compliance review) - PEND: Processing - DONE: Waiting for funds to be unlocked - INVALID: Invalid data - TRACK: Track the number of confirmations, waiting to add funds to the user (spot) - BLOCKED: Rejected Recharge - DEP_CREDITED: Recharge to account, withdrawal is not unlocked | [optional] [readonly] 15 | **chain** | **str** | Name of the chain used in withdrawals | 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Example Application 2 | 3 | This is a demo application using `gate-api` to show how Gate APIv4 works. 4 | Instead of running it, it is recommended to read the source code to get a general idea of 5 | how this SDK is used. However, you can modify this code directly to implement your own logic. 6 | 7 | ## Build 8 | 9 | 1. Clone this project and make sure it is named with `gateapi-python` 10 | 2. Run `./build.sh`, then your demo application will be created beside `gateapi-python` 11 | 12 | ## Run 13 | 14 | **READ THIS BEFORE YOU RUN ANYTHING** 15 | 16 | **This application is shown for demo only. It will try to use your input API key and secret to 17 | trade, lend and borrow, etc. Make sure you know exactly what it does before running it.** 18 | 19 | > The build.sh script will try to initiate a virtualenv environment if it can find virtualenv 20 | > executable. Follow what the script prints before running the demo application 21 | 22 | ```bash 23 | # run futures demo against TestNet 24 | python app.py futures -k -s -u fx-api-testnet.gateio.ws 25 | 26 | # run futures demo against real trading 27 | python app.py futures -k -s 28 | 29 | # run spot demo 30 | python app.py spot -k -s 31 | 32 | # run margin demo 33 | python app.py margin -k -s 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/FuturesLiquidate.md: -------------------------------------------------------------------------------- 1 | # FuturesLiquidate 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **int** | Liquidation time | [optional] [readonly] 7 | **contract** | **str** | Futures contract | [optional] [readonly] 8 | **leverage** | **str** | Position leverage. Not returned in public endpoints | [optional] [readonly] 9 | **size** | **int** | Position size | [optional] [readonly] 10 | **margin** | **str** | Position margin. Not returned in public endpoints | [optional] [readonly] 11 | **entry_price** | **str** | Average entry price. Not returned in public endpoints | [optional] [readonly] 12 | **liq_price** | **str** | Liquidation price. Not returned in public endpoints | [optional] [readonly] 13 | **mark_price** | **str** | Mark price. Not returned in public endpoints | [optional] [readonly] 14 | **order_id** | **int** | Liquidation order ID. Not returned in public endpoints | [optional] [readonly] 15 | **order_price** | **str** | Liquidation order price | [optional] [readonly] 16 | **fill_price** | **str** | Liquidation order average taker price | [optional] [readonly] 17 | **left** | **int** | Liquidation order maker size | [optional] [readonly] 18 | 19 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/FuturesPriceTrigger.md: -------------------------------------------------------------------------------- 1 | # FuturesPriceTrigger 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **strategy_type** | **int** | Trigger Strategy - 0: Price trigger, triggered when price meets conditions - 1: Price spread trigger, i.e. the difference between the latest price specified in `price_type` and the second-last price Currently only supports 0 (latest transaction price) | [optional] 7 | **price_type** | **int** | Reference price type. 0 - Latest trade price, 1 - Mark price, 2 - Index price | [optional] 8 | **price** | **str** | Price value for price trigger, or spread value for spread trigger | [optional] 9 | **rule** | **int** | Price Condition Type - 1: Trigger when the price calculated based on `strategy_type` and `price_type` is greater than or equal to `Trigger.Price`, while Trigger.Price must > last_price - 2: Trigger when the price calculated based on `strategy_type` and `price_type` is less than or equal to `Trigger.Price`, and Trigger.Price must < last_price | [optional] 10 | **expiration** | **int** | Maximum wait time for trigger condition (in seconds). Order will be cancelled if timeout | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/ContractStat.md: -------------------------------------------------------------------------------- 1 | # ContractStat 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **int** | Stat timestamp | [optional] 7 | **lsr_taker** | **float** | Long/short taker ratio | [optional] 8 | **lsr_account** | **float** | Long/short position user ratio | [optional] 9 | **long_liq_size** | **int** | Long liquidation size (contracts) | [optional] 10 | **long_liq_amount** | **float** | Long liquidation amount (base currency) | [optional] 11 | **long_liq_usd** | **float** | Long liquidation volume (quote currency) | [optional] 12 | **short_liq_size** | **int** | Short liquidation size (contracts) | [optional] 13 | **short_liq_amount** | **float** | Short liquidation amount (base currency) | [optional] 14 | **short_liq_usd** | **float** | Short liquidation volume (quote currency) | [optional] 15 | **open_interest** | **int** | Total open interest size (contracts) | [optional] 16 | **open_interest_usd** | **float** | Total open interest volume (quote currency) | [optional] 17 | **top_lsr_account** | **float** | Top trader long/short account ratio | [optional] 18 | **top_lsr_size** | **float** | Top trader long/short position ratio | [optional] 19 | **mark_price** | **float** | Mark price | [optional] 20 | 21 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/TradeFee.md: -------------------------------------------------------------------------------- 1 | # TradeFee 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **user_id** | **int** | User ID | [optional] 7 | **taker_fee** | **str** | taker fee rate | [optional] 8 | **maker_fee** | **str** | maker fee rate | [optional] 9 | **gt_discount** | **bool** | Whether GT deduction discount is enabled | [optional] 10 | **gt_taker_fee** | **str** | Taker fee rate if using GT deduction. It will be 0 if GT deduction is disabled | [optional] 11 | **gt_maker_fee** | **str** | Maker fee rate with GT deduction. Returns 0 if GT deduction is disabled | [optional] 12 | **loan_fee** | **str** | Loan fee rate of margin lending | [optional] 13 | **point_type** | **str** | Point card type: 0 - Original version, 1 - New version since 202009 | [optional] 14 | **futures_taker_fee** | **str** | Perpetual contract taker fee rate | [optional] 15 | **futures_maker_fee** | **str** | Perpetual contract maker fee rate | [optional] 16 | **delivery_taker_fee** | **str** | Delivery contract taker fee rate | [optional] 17 | **delivery_maker_fee** | **str** | Delivery contract maker fee rate | [optional] 18 | **debit_fee** | **int** | Deduction types for rates, 1 - GT deduction, 2 - Point card deduction, 3 - VIP rates | [optional] 19 | 20 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/SubAccountTransferRecordItem.md: -------------------------------------------------------------------------------- 1 | # SubAccountTransferRecordItem 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **timest** | **str** | Transfer timestamp | [optional] [readonly] 7 | **uid** | **str** | Main account user ID | [optional] [readonly] 8 | **sub_account** | **str** | Sub account user ID | 9 | **sub_account_type** | **str** | Target sub-account trading account: spot - spot account, futures - perpetual contract account, delivery - delivery contract account, options - options account | [optional] [default to 'spot'] 10 | **currency** | **str** | Transfer currency name | 11 | **amount** | **str** | Transfer amount | 12 | **direction** | **str** | Transfer direction: to - transfer into sub-account, from - transfer out from sub-account | 13 | **source** | **str** | Source of the transfer operation | [optional] [readonly] 14 | **client_order_id** | **str** | Customer-defined ID to prevent duplicate transfers. Can be a combination of letters (case-sensitive), numbers, hyphens '-', and underscores '_'. Can be pure letters or pure numbers with length between 1-64 characters | [optional] 15 | **status** | **str** | Sub-account transfer record status, currently only 'success' | [optional] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/StructuredGetProjectList.md: -------------------------------------------------------------------------------- 1 | # StructuredGetProjectList 2 | 3 | Structured Investment 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **int** | Product ID | [optional] 8 | **type** | **str** | Product Type: `SharkFin2.0`-Shark Fin 2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-Range Accrual `SnowBall`-Snow Ball | [optional] 9 | **name_en** | **str** | Product Name | [optional] 10 | **investment_coin** | **str** | Investment Token | [optional] 11 | **investment_period** | **str** | Investment Period | [optional] 12 | **min_annual_rate** | **str** | Minimum Annual Rate | [optional] 13 | **mid_annual_rate** | **str** | Intermediate Annual Rate | [optional] 14 | **max_annual_rate** | **str** | Maximum Annual Rate | [optional] 15 | **watch_market** | **str** | Underlying Market | [optional] 16 | **start_time** | **int** | Start Time | [optional] 17 | **end_time** | **int** | End time | [optional] 18 | **status** | **str** | Status: `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done | [optional] 19 | 20 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/MyFuturesTrade.md: -------------------------------------------------------------------------------- 1 | # MyFuturesTrade 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Fill ID | [optional] 7 | **create_time** | **float** | Fill Time | [optional] 8 | **contract** | **str** | Futures contract | [optional] 9 | **order_id** | **str** | Related order ID | [optional] 10 | **size** | **int** | Trading size | [optional] 11 | **close_size** | **int** | Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position | [optional] 12 | **price** | **str** | Fill Price | [optional] 13 | **role** | **str** | Trade role. taker - taker, maker - maker | [optional] 14 | **text** | **str** | Order custom information | [optional] 15 | **fee** | **str** | Trade fee | [optional] 16 | **point_fee** | **str** | Points used to deduct trade fee | [optional] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/MultiRepayRecord.md: -------------------------------------------------------------------------------- 1 | # MultiRepayRecord 2 | 3 | Multi-Collateral Repayment Record 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order ID | [optional] 8 | **record_id** | **int** | Repayment record ID | [optional] 9 | **init_ltv** | **str** | Initial collateralization rate | [optional] 10 | **before_ltv** | **str** | Ltv before the operation | [optional] 11 | **after_ltv** | **str** | Ltv after the operation | [optional] 12 | **borrow_time** | **int** | Borrowing time, timestamp in seconds | [optional] 13 | **repay_time** | **int** | Repayment time, timestamp in seconds | [optional] 14 | **borrow_currencies** | [**list[RepayRecordCurrency]**](RepayRecordCurrency.md) | List of borrowing information | [optional] 15 | **collateral_currencies** | [**list[RepayRecordCurrency]**](RepayRecordCurrency.md) | List of collateral information | [optional] 16 | **repaid_currencies** | [**list[RepayRecordRepaidCurrency]**](RepayRecordRepaidCurrency.md) | Repay Currency List | [optional] 17 | **total_interest_list** | [**list[RepayRecordTotalInterest]**](RepayRecordTotalInterest.md) | Total Interest List | [optional] 18 | **left_repay_interest_list** | [**list[RepayRecordLeftInterest]**](RepayRecordLeftInterest.md) | List of remaining interest to be repaid | [optional] 19 | 20 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/MyFuturesTradeTimeRange.md: -------------------------------------------------------------------------------- 1 | # MyFuturesTradeTimeRange 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **trade_id** | **str** | Fill ID | [optional] 7 | **create_time** | **float** | Fill Time | [optional] 8 | **contract** | **str** | Futures contract | [optional] 9 | **order_id** | **str** | Related order ID | [optional] 10 | **size** | **int** | Trading size | [optional] 11 | **close_size** | **int** | Number of closed positions: close_size=0 && size>0 Open long position close_size=0 && size<0 Open short position close_size>0 && size>0 && size <= close_size Close short position close_size>0 && size>0 && size > close_size Close short position and open long position close_size<0 && size<0 && size >= close_size Close long position close_size<0 && size<0 && size < close_size Close long position and open short position | [optional] 12 | **price** | **str** | Fill Price | [optional] 13 | **role** | **str** | Trade role. taker - taker, maker - maker | [optional] 14 | **text** | **str** | Order custom information | [optional] 15 | **fee** | **str** | Trade fee | [optional] 16 | **point_fee** | **str** | Points used to deduct trade fee | [optional] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/OptionsTicker.md: -------------------------------------------------------------------------------- 1 | # OptionsTicker 2 | 3 | Options contract details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **name** | **str** | Options contract name | [optional] 8 | **last_price** | **str** | Last trade price (quote currency) | [optional] 9 | **mark_price** | **str** | Current mark price (quote currency) | [optional] 10 | **index_price** | **str** | Current index price (quote currency) | [optional] 11 | **ask1_size** | **int** | Best ask size | [optional] 12 | **ask1_price** | **str** | Best ask price | [optional] 13 | **bid1_size** | **int** | Best bid size | [optional] 14 | **bid1_price** | **str** | Best bid price | [optional] 15 | **position_size** | **int** | Current total long position size | [optional] 16 | **mark_iv** | **str** | Implied volatility | [optional] 17 | **bid_iv** | **str** | Bid side implied volatility | [optional] 18 | **ask_iv** | **str** | Ask side implied volatility | [optional] 19 | **leverage** | **str** | Current leverage. Formula: underlying_price / mark_price * delta | [optional] 20 | **delta** | **str** | Greek letter delta | [optional] 21 | **gamma** | **str** | Greek letter gamma | [optional] 22 | **vega** | **str** | Greek letter vega | [optional] 23 | **theta** | **str** | Greek letter theta | [optional] 24 | **rho** | **str** | Rho | [optional] 25 | 26 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/DualGetOrders.md: -------------------------------------------------------------------------------- 1 | # DualGetOrders 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **int** | Order ID | [optional] 7 | **plan_id** | **int** | Product ID | [optional] 8 | **copies** | **str** | Units | [optional] 9 | **invest_amount** | **str** | Investment Quantity | [optional] 10 | **settlement_amount** | **str** | Settlement Quantity | [optional] 11 | **create_time** | **int** | Created time | [optional] 12 | **complete_time** | **int** | Completed Time | [optional] 13 | **status** | **str** | Status: `INIT`-Created `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-Settlement Processing `CANCELED`-Canceled `FAILED`-Failed | [optional] 14 | **invest_currency** | **str** | Investment Token | [optional] 15 | **exercise_currency** | **str** | Strike Token | [optional] 16 | **exercise_price** | **str** | Strike price | [optional] 17 | **settlement_price** | **str** | Settlement price | [optional] 18 | **settlement_currency** | **str** | Settlement currency | [optional] 19 | **apy_display** | **str** | Annual Yield | [optional] 20 | **apy_settlement** | **str** | Settlement Annual Yield | [optional] 21 | **delivery_time** | **int** | Settlement time | [optional] 22 | **text** | **str** | Custom order information | [optional] 23 | 24 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/OptionsPosition.md: -------------------------------------------------------------------------------- 1 | # OptionsPosition 2 | 3 | Options contract position details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **user** | **int** | User ID | [optional] [readonly] 8 | **underlying** | **str** | Underlying | [optional] [readonly] 9 | **underlying_price** | **str** | Underlying price (quote currency) | [optional] [readonly] 10 | **contract** | **str** | Options contract name | [optional] [readonly] 11 | **size** | **int** | Position size (contract quantity) | [optional] [readonly] 12 | **entry_price** | **str** | Entry size (quote currency) | [optional] [readonly] 13 | **mark_price** | **str** | Current mark price (quote currency) | [optional] [readonly] 14 | **mark_iv** | **str** | Implied volatility | [optional] [readonly] 15 | **realised_pnl** | **str** | Realized PnL | [optional] [readonly] 16 | **unrealised_pnl** | **str** | Unrealized PNL | [optional] [readonly] 17 | **pending_orders** | **int** | Current pending order quantity | [optional] [readonly] 18 | **close_order** | [**OptionsPositionCloseOrder**](OptionsPositionCloseOrder.md) | | [optional] 19 | **delta** | **str** | Greek letter delta | [optional] [readonly] 20 | **gamma** | **str** | Greek letter gamma | [optional] [readonly] 21 | **vega** | **str** | Greek letter vega | [optional] [readonly] 22 | **theta** | **str** | Greek letter theta | [optional] [readonly] 23 | 24 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/PositionClose.md: -------------------------------------------------------------------------------- 1 | # PositionClose 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time** | **float** | Position close time | [optional] [readonly] 7 | **contract** | **str** | Futures contract | [optional] [readonly] 8 | **side** | **str** | Position side - `long`: Long position - `short`: Short position | [optional] [readonly] 9 | **pnl** | **str** | PnL | [optional] [readonly] 10 | **pnl_pnl** | **str** | PNL - Position P/L | [optional] [readonly] 11 | **pnl_fund** | **str** | PNL - Funding Fees | [optional] [readonly] 12 | **pnl_fee** | **str** | PNL - Transaction Fees | [optional] [readonly] 13 | **text** | **str** | Source of close order. See `order.text` field for specific values | [optional] [readonly] 14 | **max_size** | **str** | Max Trade Size | [optional] [readonly] 15 | **accum_size** | **str** | Cumulative closed position volume | [optional] [readonly] 16 | **first_open_time** | **int** | First Open Time | [optional] [readonly] 17 | **long_price** | **str** | When side is 'long', it indicates the opening average price; when side is 'short', it indicates the closing average price | [optional] [readonly] 18 | **short_price** | **str** | When side is 'long', it indicates the closing average price; when side is 'short', it indicates the opening average price | [optional] [readonly] 19 | 20 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/Trade.md: -------------------------------------------------------------------------------- 1 | # Trade 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **id** | **str** | Fill ID | [optional] 7 | **create_time** | **str** | Fill Time | [optional] 8 | **create_time_ms** | **str** | Trading time, with millisecond precision | [optional] 9 | **currency_pair** | **str** | Currency pair | [optional] 10 | **side** | **str** | Buy or sell order | [optional] 11 | **role** | **str** | Trade role, not returned in public endpoints | [optional] 12 | **amount** | **str** | Trade amount | [optional] 13 | **price** | **str** | Order price | [optional] 14 | **order_id** | **str** | Related order ID, not returned in public endpoints | [optional] 15 | **fee** | **str** | Fee deducted, not returned in public endpoints | [optional] 16 | **fee_currency** | **str** | Fee currency unit, not returned in public endpoints | [optional] 17 | **point_fee** | **str** | Points used to deduct fee, not returned in public endpoints | [optional] 18 | **gt_fee** | **str** | GT used to deduct fee, not returned in public endpoints | [optional] 19 | **amend_text** | **str** | The custom data that the user remarked when amending the order | [optional] 20 | **sequence_id** | **str** | Consecutive trade ID within a single market. Used to track and identify trades in the specific market | [optional] 21 | **text** | **str** | User-defined information, not returned in public endpoints | [optional] 22 | 23 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 24 | 25 | 26 | -------------------------------------------------------------------------------- /example/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -e 4 | 5 | WORKDIR="${PWD}/gateapi-demo" 6 | VENV_DIR="$WORKDIR/.venv" 7 | : "${GATEAPI_SOURCE_DIR:=gateapi-python}" 8 | 9 | # determine python environment 10 | python=$(command -v python3 || true) 11 | 12 | if [ -z "$python" ]; then 13 | python=$(command -v python2 || true) 14 | if [ -z "$python" ]; then 15 | echo >&2 "No python executable found." 16 | exit 1 17 | fi 18 | fi 19 | 20 | mkdir -p "$WORKDIR" 21 | 22 | virtualenv=$(command -v virtualenv || true) 23 | if [ -z "$virtualenv" ]; then 24 | echo "No virtualenv found. Native python environment will be used" 25 | LOCAL_INSTALL="--user" 26 | else 27 | if [ -n "$VIRTUAL_ENV" ]; then 28 | # find original python path, osx compatible 29 | while true; do 30 | orig=$(readlink "$python") 31 | if [ -z "$orig" ]; then 32 | break 33 | elif [ "$orig" != "${orig#/}" ]; then 34 | python=$orig 35 | break 36 | else 37 | python="$(dirname "${python}")"/"$orig" 38 | fi 39 | done 40 | fi 41 | if [ ! -d "$VENV_DIR" ]; then 42 | "$virtualenv" -p "$python" "$VENV_DIR" 43 | fi 44 | python="$VENV_DIR/bin/python" 45 | fi 46 | 47 | echo "Python used: $python" 48 | 49 | cd "$GATEAPI_SOURCE_DIR" && "$python" setup.py install ${LOCAL_INSTALL+"$LOCAL_INSTALL"} && cd - 50 | cp "$GATEAPI_SOURCE_DIR"/example/*.py "$WORKDIR" 51 | 52 | if [ -n "$virtualenv" ]; then 53 | echo "run \`source $VENV_DIR/bin/activate \` and then " 54 | fi 55 | echo "run \`cd $WORKDIR && $python app.py -h\` for help" 56 | -------------------------------------------------------------------------------- /example/app.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/env python 2 | # coding: utf-8 3 | import logging 4 | from argparse import ArgumentParser 5 | 6 | from config import RunConfig 7 | from futures import futures_demo 8 | from margin import margin_demo 9 | from spot import spot_demo 10 | 11 | logging.basicConfig(format="%(asctime)s: %(message)s", level=logging.DEBUG) 12 | logger = logging.getLogger(__name__) 13 | 14 | 15 | def main(): 16 | parser = ArgumentParser(description="Run Gate APIv4 demo application") 17 | parser.add_argument("-k", "--key", required=True, help="Gate APIv4 Key") 18 | parser.add_argument("-s", "--secret", required=True, help="Gate APIv4 Secret") 19 | parser.add_argument("-u", "--url", required=False, help="API base URL used to test") 20 | parser.add_argument("tests", nargs='+', help="tests to run") 21 | options = parser.parse_args() 22 | 23 | host_used = options.url 24 | if not host_used: 25 | host_used = "https://api.gateio.ws/api/v4" 26 | if not host_used.startswith("http"): 27 | host_used = "https://" + host_used 28 | host_used = host_used.rstrip("/") 29 | if not host_used.endswith("/api/v4"): 30 | host_used += '/api/v4' 31 | 32 | run_config = RunConfig(options.key, options.secret, host_used) 33 | for t in options.tests: 34 | logger.info("run %s API demo", t) 35 | if t == 'spot': 36 | spot_demo(run_config) 37 | elif t == 'margin': 38 | margin_demo(run_config) 39 | elif t == 'futures': 40 | futures_demo(run_config) 41 | else: 42 | logger.warning("ignore unknown test %s", t) 43 | 44 | 45 | if __name__ == '__main__': 46 | main() 47 | -------------------------------------------------------------------------------- /docs/SpotPricePutOrder.md: -------------------------------------------------------------------------------- 1 | # SpotPricePutOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **type** | **str** | Order type,default to `limit` - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] 7 | **side** | **str** | Order side - buy: buy side - sell: sell side | 8 | **price** | **str** | Order price | 9 | **amount** | **str** | Trading quantity When `type` is `limit`, it refers to the base currency (the currency being traded), such as `BTC` in `BTC_USDT` When `type` is `market`, it refers to different currencies based on the side: - `side`: `buy` refers to quote currency, `BTC_USDT` means `USDT` - `side`: `sell` refers to base currency, `BTC_USDT` means `BTC` | 10 | **account** | **str** | Trading account type. Unified account must be set to `unified` - normal: spot trading - margin: margin trading - unified: unified account | [default to 'normal'] 11 | **time_in_force** | **str** | time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only | [optional] [default to 'gtc'] 12 | **auto_borrow** | **bool** | Whether to borrow coins automatically | [optional] [default to False] 13 | **auto_repay** | **bool** | Whether to repay the loan automatically | [optional] [default to False] 14 | **text** | **str** | The source of the order, including: - web: Web - api: API call - app: Mobile app | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/Ticker.md: -------------------------------------------------------------------------------- 1 | # Ticker 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **currency_pair** | **str** | Currency pair | [optional] 7 | **last** | **str** | Last trading price | [optional] 8 | **lowest_ask** | **str** | Recent lowest ask | [optional] 9 | **lowest_size** | **str** | Latest seller's lowest price quantity; not available for batch queries; available for single queries, empty if no data | [optional] 10 | **highest_bid** | **str** | Recent highest bid | [optional] 11 | **highest_size** | **str** | Latest buyer's highest price quantity; not available for batch queries; available for single queries, empty if no data | [optional] 12 | **change_percentage** | **str** | 24h price change percentage (negative for decrease, e.g., -7.45) | [optional] 13 | **change_utc0** | **str** | UTC+0 timezone, 24h price change percentage, negative for decline (e.g., -7.45) | [optional] 14 | **change_utc8** | **str** | UTC+8 timezone, 24h price change percentage, negative for decline (e.g., -7.45) | [optional] 15 | **base_volume** | **str** | Base currency trading volume in the last 24h | [optional] 16 | **quote_volume** | **str** | Quote currency trading volume in the last 24h | [optional] 17 | **high_24h** | **str** | 24h High | [optional] 18 | **low_24h** | **str** | 24h Low | [optional] 19 | **etf_net_value** | **str** | ETF net value | [optional] 20 | **etf_pre_net_value** | **str** | ETF net value at previous rebalancing point | [optional] 21 | **etf_pre_timestamp** | **int** | ETF previous rebalancing time | [optional] 22 | **etf_leverage** | **str** | ETF current leverage | [optional] 23 | 24 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/CollateralOrder.md: -------------------------------------------------------------------------------- 1 | # CollateralOrder 2 | 3 | Collateral order 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **order_id** | **int** | Order ID | [optional] 8 | **collateral_currency** | **str** | Collateral currency | [optional] 9 | **collateral_amount** | **str** | Collateral amount | [optional] 10 | **borrow_currency** | **str** | Borrowed currency | [optional] 11 | **borrow_amount** | **str** | Borrowed amount | [optional] 12 | **repaid_amount** | **str** | Repaid amount | [optional] 13 | **repaid_principal** | **str** | Repaid principal | [optional] 14 | **repaid_interest** | **str** | Repaid interest | [optional] 15 | **init_ltv** | **str** | Initial collateralization rate | [optional] 16 | **current_ltv** | **str** | Current collateralization rate | [optional] 17 | **liquidate_ltv** | **str** | Liquidation collateralization rate | [optional] 18 | **status** | **str** | Order status: - initial: Initial state after placing the order - collateral_deducted: Collateral deduction successful - collateral_returning: Loan failed - Collateral return pending - lent: Loan successful - repaying: Repayment in progress - liquidating: Liquidation in progress - finished: Order completed - closed_liquidated: Liquidation and repayment completed | [optional] 19 | **borrow_time** | **int** | Borrowing time, timestamp in seconds | [optional] 20 | **left_repay_total** | **str** | Outstanding principal and interest (outstanding principal + outstanding interest) | [optional] 21 | **left_repay_principal** | **str** | Outstanding principal | [optional] 22 | **left_repay_interest** | **str** | Outstanding interest | [optional] 23 | 24 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 25 | 26 | 27 | --------------------------------------------------------------------------------