Skip to content

Commit 4e7bd82

Browse files
committed
porfolio margin account support
1 parent 2f55851 commit 4e7bd82

44 files changed

Lines changed: 2353 additions & 89 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API
55

66
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
77

8-
- API version: 4.24.0
9-
- Package version: 4.24.0
8+
- API version: 4.25.1
9+
- Package version: 4.25.1
1010
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1111
For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)
1212

@@ -134,7 +134,7 @@ Class | Method | HTTP request | Description
134134
*DeliveryApi* | [**create_price_triggered_delivery_order**](docs/DeliveryApi.md#create_price_triggered_delivery_order) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order
135135
*DeliveryApi* | [**cancel_price_triggered_delivery_order_list**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order_list) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders
136136
*DeliveryApi* | [**get_price_triggered_delivery_order**](docs/DeliveryApi.md#get_price_triggered_delivery_order) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order
137-
*DeliveryApi* | [**cancel_price_triggered_delivery_order**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel a single order
137+
*DeliveryApi* | [**cancel_price_triggered_delivery_order**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order
138138
*FlashSwapApi* | [**list_flash_swap_currencies**](docs/FlashSwapApi.md#list_flash_swap_currencies) | **GET** /flash_swap/currencies | List all supported currencies in flash swap
139139
*FlashSwapApi* | [**list_flash_swap_orders**](docs/FlashSwapApi.md#list_flash_swap_orders) | **GET** /flash_swap/orders | List all flash swap orders
140140
*FlashSwapApi* | [**create_flash_swap_order**](docs/FlashSwapApi.md#create_flash_swap_order) | **POST** /flash_swap/orders | Create a flash swap order
@@ -176,7 +176,7 @@ Class | Method | HTTP request | Description
176176
*FuturesApi* | [**create_price_triggered_order**](docs/FuturesApi.md#create_price_triggered_order) | **POST** /futures/{settle}/price_orders | Create a price-triggered order
177177
*FuturesApi* | [**cancel_price_triggered_order_list**](docs/FuturesApi.md#cancel_price_triggered_order_list) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders
178178
*FuturesApi* | [**get_price_triggered_order**](docs/FuturesApi.md#get_price_triggered_order) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order
179-
*FuturesApi* | [**cancel_price_triggered_order**](docs/FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel a single order
179+
*FuturesApi* | [**cancel_price_triggered_order**](docs/FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order
180180
*MarginApi* | [**list_margin_currency_pairs**](docs/MarginApi.md#list_margin_currency_pairs) | **GET** /margin/currency_pairs | List all supported currency pairs supported in margin trading
181181
*MarginApi* | [**get_margin_currency_pair**](docs/MarginApi.md#get_margin_currency_pair) | **GET** /margin/currency_pairs/{currency_pair} | Query one single margin currency pair
182182
*MarginApi* | [**list_funding_book**](docs/MarginApi.md#list_funding_book) | **GET** /margin/funding_book | Order book of lending loans
@@ -206,7 +206,7 @@ Class | Method | HTTP request | Description
206206
*MarginApi* | [**create_cross_margin_loan**](docs/MarginApi.md#create_cross_margin_loan) | **POST** /margin/cross/loans | Create a cross margin borrow loan
207207
*MarginApi* | [**get_cross_margin_loan**](docs/MarginApi.md#get_cross_margin_loan) | **GET** /margin/cross/loans/{loan_id} | Retrieve single borrow loan detail
208208
*MarginApi* | [**list_cross_margin_repayments**](docs/MarginApi.md#list_cross_margin_repayments) | **GET** /margin/cross/repayments | Retrieve cross margin repayments
209-
*MarginApi* | [**repay_cross_margin_loan**](docs/MarginApi.md#repay_cross_margin_loan) | **POST** /margin/cross/repayments | Repay cross margin loan
209+
*MarginApi* | [**repay_cross_margin_loan**](docs/MarginApi.md#repay_cross_margin_loan) | **POST** /margin/cross/repayments | When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred.When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first
210210
*MarginApi* | [**get_cross_margin_transferable**](docs/MarginApi.md#get_cross_margin_transferable) | **GET** /margin/cross/transferable | Get the max transferable amount for a specific cross margin currency
211211
*MarginApi* | [**get_cross_margin_borrowable**](docs/MarginApi.md#get_cross_margin_borrowable) | **GET** /margin/cross/borrowable | Get the max borrowable amount for a specific cross margin currency
212212
*OptionsApi* | [**list_options_underlyings**](docs/OptionsApi.md#list_options_underlyings) | **GET** /options/underlyings | List all underlyings
@@ -215,6 +215,7 @@ Class | Method | HTTP request | Description
215215
*OptionsApi* | [**get_options_contract**](docs/OptionsApi.md#get_options_contract) | **GET** /options/contracts/{contract} | Query specified contract detail
216216
*OptionsApi* | [**list_options_settlements**](docs/OptionsApi.md#list_options_settlements) | **GET** /options/settlements | List settlement history
217217
*OptionsApi* | [**get_options_settlement**](docs/OptionsApi.md#get_options_settlement) | **GET** /options/settlements/{contract} | Get specified contract's settlement
218+
*OptionsApi* | [**list_my_options_settlements**](docs/OptionsApi.md#list_my_options_settlements) | **GET** /options/my_settlements | List my options settlements
218219
*OptionsApi* | [**list_options_order_book**](docs/OptionsApi.md#list_options_order_book) | **GET** /options/order_book | Futures order book
219220
*OptionsApi* | [**list_options_tickers**](docs/OptionsApi.md#list_options_tickers) | **GET** /options/tickers | List tickers of options contracts
220221
*OptionsApi* | [**list_options_underlying_tickers**](docs/OptionsApi.md#list_options_underlying_tickers) | **GET** /options/underlying/tickers/{underlying} | Get underlying ticker
@@ -244,18 +245,20 @@ Class | Method | HTTP request | Description
244245
*SpotApi* | [**list_spot_accounts**](docs/SpotApi.md#list_spot_accounts) | **GET** /spot/accounts | List spot accounts
245246
*SpotApi* | [**create_batch_orders**](docs/SpotApi.md#create_batch_orders) | **POST** /spot/batch_orders | Create a batch of orders
246247
*SpotApi* | [**list_all_open_orders**](docs/SpotApi.md#list_all_open_orders) | **GET** /spot/open_orders | List all open orders
248+
*SpotApi* | [**create_cross_liquidate_order**](docs/SpotApi.md#create_cross_liquidate_order) | **POST** /spot/cross_liquidate_orders | close position when cross-currency is disabled
247249
*SpotApi* | [**list_orders**](docs/SpotApi.md#list_orders) | **GET** /spot/orders | List orders
248250
*SpotApi* | [**create_order**](docs/SpotApi.md#create_order) | **POST** /spot/orders | Create an order
249251
*SpotApi* | [**cancel_orders**](docs/SpotApi.md#cancel_orders) | **DELETE** /spot/orders | Cancel all `open` orders in specified currency pair
250252
*SpotApi* | [**cancel_batch_orders**](docs/SpotApi.md#cancel_batch_orders) | **POST** /spot/cancel_batch_orders | Cancel a batch of orders with an ID list
251253
*SpotApi* | [**get_order**](docs/SpotApi.md#get_order) | **GET** /spot/orders/{order_id} | Get a single order
252254
*SpotApi* | [**cancel_order**](docs/SpotApi.md#cancel_order) | **DELETE** /spot/orders/{order_id} | Cancel a single order
253255
*SpotApi* | [**list_my_trades**](docs/SpotApi.md#list_my_trades) | **GET** /spot/my_trades | List personal trading history
256+
*SpotApi* | [**get_system_time**](docs/SpotApi.md#get_system_time) | **GET** /spot/time | Get server current time
254257
*SpotApi* | [**list_spot_price_triggered_orders**](docs/SpotApi.md#list_spot_price_triggered_orders) | **GET** /spot/price_orders | Retrieve running auto order list
255258
*SpotApi* | [**create_spot_price_triggered_order**](docs/SpotApi.md#create_spot_price_triggered_order) | **POST** /spot/price_orders | Create a price-triggered order
256259
*SpotApi* | [**cancel_spot_price_triggered_order_list**](docs/SpotApi.md#cancel_spot_price_triggered_order_list) | **DELETE** /spot/price_orders | Cancel all open orders
257260
*SpotApi* | [**get_spot_price_triggered_order**](docs/SpotApi.md#get_spot_price_triggered_order) | **GET** /spot/price_orders/{order_id} | Get a single order
258-
*SpotApi* | [**cancel_spot_price_triggered_order**](docs/SpotApi.md#cancel_spot_price_triggered_order) | **DELETE** /spot/price_orders/{order_id} | Cancel a single order
261+
*SpotApi* | [**cancel_spot_price_triggered_order**](docs/SpotApi.md#cancel_spot_price_triggered_order) | **DELETE** /spot/price_orders/{order_id} | cancel a price-triggered order
259262
*WalletApi* | [**list_currency_chains**](docs/WalletApi.md#list_currency_chains) | **GET** /wallet/currency_chains | List chains supported for specified currency
260263
*WalletApi* | [**get_deposit_address**](docs/WalletApi.md#get_deposit_address) | **GET** /wallet/deposit_address | Generate currency deposit address
261264
*WalletApi* | [**list_withdrawals**](docs/WalletApi.md#list_withdrawals) | **GET** /wallet/withdrawals | Retrieve withdrawal records
@@ -306,6 +309,7 @@ Class | Method | HTTP request | Description
306309
- [FundingRateRecord](docs/FundingRateRecord.md)
307310
- [FuturesAccount](docs/FuturesAccount.md)
308311
- [FuturesAccountBook](docs/FuturesAccountBook.md)
312+
- [FuturesAccountHistory](docs/FuturesAccountHistory.md)
309313
- [FuturesCandlestick](docs/FuturesCandlestick.md)
310314
- [FuturesIndexConstituents](docs/FuturesIndexConstituents.md)
311315
- [FuturesInitialOrder](docs/FuturesInitialOrder.md)
@@ -321,6 +325,7 @@ Class | Method | HTTP request | Description
321325
- [IndexConstituent](docs/IndexConstituent.md)
322326
- [InsuranceRecord](docs/InsuranceRecord.md)
323327
- [LedgerRecord](docs/LedgerRecord.md)
328+
- [LiquidateOrder](docs/LiquidateOrder.md)
324329
- [Loan](docs/Loan.md)
325330
- [LoanPatch](docs/LoanPatch.md)
326331
- [LoanRecord](docs/LoanRecord.md)
@@ -336,6 +341,7 @@ Class | Method | HTTP request | Description
336341
- [OptionsAccount](docs/OptionsAccount.md)
337342
- [OptionsAccountBook](docs/OptionsAccountBook.md)
338343
- [OptionsContract](docs/OptionsContract.md)
344+
- [OptionsMySettlements](docs/OptionsMySettlements.md)
339345
- [OptionsMyTrade](docs/OptionsMyTrade.md)
340346
- [OptionsOrder](docs/OptionsOrder.md)
341347
- [OptionsPosition](docs/OptionsPosition.md)
@@ -359,6 +365,7 @@ Class | Method | HTTP request | Description
359365
- [SubAccountFuturesBalance](docs/SubAccountFuturesBalance.md)
360366
- [SubAccountMarginBalance](docs/SubAccountMarginBalance.md)
361367
- [SubAccountTransfer](docs/SubAccountTransfer.md)
368+
- [SystemTime](docs/SystemTime.md)
362369
- [Ticker](docs/Ticker.md)
363370
- [TotalBalance](docs/TotalBalance.md)
364371
- [Trade](docs/Trade.md)

docs/CancelOrder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**currency_pair** | **str** | Order currency pair |
88
**id** | **str** | Order ID or user custom ID. Custom ID are accepted only within 30 minutes after order creation |
9-
**account** | **str** | If cancelled order is cross margin order, this field must be set and can only be `cross_margin` | [optional]
9+
**account** | **str** | If cancelled order is cross margin order or is portfolio margin account's API key, this field must be set and can only be `cross_margin`If cancelled order is cross margin order, this field must be set and can only be `cross_margin` | [optional]
1010

1111
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1212

docs/CrossMarginAccount.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ Name | Type | Description | Notes
1010
**borrowed** | **str** | Total borrowed value in USDT, i.e., the sum of all currencies' `borrowed*price*discount` | [optional]
1111
**interest** | **str** | Total unpaid interests in USDT, i.e., the sum of all currencies' `interest*price*discount` | [optional]
1212
**risk** | **str** | Risk rate. When it belows 110%, liquidation will be triggered. Calculation formula: `total / (borrowed+interest)` | [optional]
13+
**total_initial_margin** | **str** | Total initial margin | [optional]
14+
**total_margin_balance** | **str** | Total margin balance | [optional]
15+
**total_maintenance_margin** | **str** | Total maintenance margin | [optional]
16+
**total_initial_margin_rate** | **str** | Total initial margin rate | [optional]
17+
**total_maintenance_margin_rate** | **str** | Total maintenance margin rate | [optional]
18+
**total_available_margin** | **str** | Total available margin | [optional]
1319

1420
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1521

docs/CrossMarginCurrency.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Name | Type | Description | Notes
1111
**user_max_borrow_amount** | **str** | Maximum borrow value allowed per user, in USDT | [optional]
1212
**total_max_borrow_amount** | **str** | Maximum borrow value allowed for this currency, in USDT | [optional]
1313
**price** | **str** | Price change between this currency and USDT | [optional]
14+
**status** | **int** | status - `0` : disable - `1` : enable | [optional]
1415

1516
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1617

docs/DeliveryApi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Method | HTTP request | Description
3131
[**create_price_triggered_delivery_order**](DeliveryApi.md#create_price_triggered_delivery_order) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order
3232
[**cancel_price_triggered_delivery_order_list**](DeliveryApi.md#cancel_price_triggered_delivery_order_list) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders
3333
[**get_price_triggered_delivery_order**](DeliveryApi.md#get_price_triggered_delivery_order) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a single order
34-
[**cancel_price_triggered_delivery_order**](DeliveryApi.md#cancel_price_triggered_delivery_order) | **DELETE** /delivery/{settle}/price_orders/{order_id} | Cancel a single order
34+
[**cancel_price_triggered_delivery_order**](DeliveryApi.md#cancel_price_triggered_delivery_order) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order
3535

3636

3737
# **list_delivery_contracts**
@@ -1915,7 +1915,7 @@ Name | Type | Description | Notes
19151915
# **cancel_price_triggered_delivery_order**
19161916
> FuturesPriceTriggeredOrder cancel_price_triggered_delivery_order(settle, order_id)
19171917
1918-
Cancel a single order
1918+
cancel a price-triggered order
19191919

19201920
### Example
19211921

@@ -1945,7 +1945,7 @@ settle = 'usdt' # str | Settle currency
19451945
order_id = 'order_id_example' # str | Retrieve the data of the order with the specified ID
19461946

19471947
try:
1948-
# Cancel a single order
1948+
# cancel a price-triggered order
19491949
api_response = api_instance.cancel_price_triggered_delivery_order(settle, order_id)
19501950
print(api_response)
19511951
except GateApiException as ex:

docs/FuturesAccount.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**total** | **str** | Total assets, total = position_margin + order_margin + available | [optional]
6+
**total** | **str** | total = position_margin + order_margin + available | [optional]
77
**unrealised_pnl** | **str** | Unrealized PNL | [optional]
88
**position_margin** | **str** | Position margin | [optional]
99
**order_margin** | **str** | Order margin of unfinished orders | [optional]
10-
**available** | **str** | Available balance to transfer out or trade | [optional]
10+
**available** | **str** | The available balance for transferring or trading | [optional]
1111
**point** | **str** | POINT amount | [optional]
1212
**currency** | **str** | Settle currency | [optional]
1313
**in_dual_mode** | **bool** | Whether dual mode is enabled | [optional]
14+
**enable_credit** | **bool** | Whether portfolio margin account mode is enabled | [optional]
15+
**position_initial_margin** | **str** | Initial margin position, applicable to the portfolio margin account model | [optional]
16+
**maintenance_margin** | **str** | Maintenance margin position, applicable to the portfolio margin account model | [optional]
17+
**bonus** | **str** | Perpetual Contract Bonus | [optional]
18+
**history** | [**FuturesAccountHistory**](FuturesAccountHistory.md) | | [optional]
1419

1520
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1621

docs/FuturesAccountHistory.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+

docs/FuturesApi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Method | HTTP request | Description
4040
[**create_price_triggered_order**](FuturesApi.md#create_price_triggered_order) | **POST** /futures/{settle}/price_orders | Create a price-triggered order
4141
[**cancel_price_triggered_order_list**](FuturesApi.md#cancel_price_triggered_order_list) | **DELETE** /futures/{settle}/price_orders | Cancel all open orders
4242
[**get_price_triggered_order**](FuturesApi.md#get_price_triggered_order) | **GET** /futures/{settle}/price_orders/{order_id} | Get a single order
43-
[**cancel_price_triggered_order**](FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | Cancel a single order
43+
[**cancel_price_triggered_order**](FuturesApi.md#cancel_price_triggered_order) | **DELETE** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order
4444

4545

4646
# **list_futures_contracts**
@@ -2543,7 +2543,7 @@ Name | Type | Description | Notes
25432543
# **cancel_price_triggered_order**
25442544
> FuturesPriceTriggeredOrder cancel_price_triggered_order(settle, order_id)
25452545
2546-
Cancel a single order
2546+
cancel a price-triggered order
25472547

25482548
### Example
25492549

@@ -2573,7 +2573,7 @@ settle = 'usdt' # str | Settle currency
25732573
order_id = 'order_id_example' # str | Retrieve the data of the order with the specified ID
25742574

25752575
try:
2576-
# Cancel a single order
2576+
# cancel a price-triggered order
25772577
api_response = api_instance.cancel_price_triggered_order(settle, order_id)
25782578
print(api_response)
25792579
except GateApiException as ex:

docs/LiquidateOrder.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# LiquidateOrder
2+
3+
Liquidate Order detail
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**text** | **str** | User defined information. If not empty, must follow the rules below: 1. prefixed with `t-` 2. no longer than 28 bytes without `t-` prefix 3. can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional]
8+
**currency_pair** | **str** | Currency pair |
9+
**amount** | **str** | Trade amount |
10+
**price** | **str** | Order price |
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+

0 commit comments

Comments
 (0)