# FuturesApi All URIs are relative to *https://api.gateio.ws/api/v4* Method | HTTP request | Description ------------- | ------------- | ------------- [**ListFuturesContracts**](FuturesApi.md#ListFuturesContracts) | **Get** /futures/{settle}/contracts | List all futures contracts [**GetFuturesContract**](FuturesApi.md#GetFuturesContract) | **Get** /futures/{settle}/contracts/{contract} | Get a single contract [**ListFuturesOrderBook**](FuturesApi.md#ListFuturesOrderBook) | **Get** /futures/{settle}/order_book | Futures order book [**ListFuturesTrades**](FuturesApi.md#ListFuturesTrades) | **Get** /futures/{settle}/trades | Futures trading history [**ListFuturesCandlesticks**](FuturesApi.md#ListFuturesCandlesticks) | **Get** /futures/{settle}/candlesticks | Get futures candlesticks [**ListFuturesPremiumIndex**](FuturesApi.md#ListFuturesPremiumIndex) | **Get** /futures/{settle}/premium_index | Premium Index K-Line [**ListFuturesTickers**](FuturesApi.md#ListFuturesTickers) | **Get** /futures/{settle}/tickers | List futures tickers [**ListFuturesFundingRateHistory**](FuturesApi.md#ListFuturesFundingRateHistory) | **Get** /futures/{settle}/funding_rate | Funding rate history [**ListFuturesInsuranceLedger**](FuturesApi.md#ListFuturesInsuranceLedger) | **Get** /futures/{settle}/insurance | Futures insurance balance history [**ListContractStats**](FuturesApi.md#ListContractStats) | **Get** /futures/{settle}/contract_stats | Futures stats [**GetIndexConstituents**](FuturesApi.md#GetIndexConstituents) | **Get** /futures/{settle}/index_constituents/{index} | Get index constituents [**ListLiquidatedOrders**](FuturesApi.md#ListLiquidatedOrders) | **Get** /futures/{settle}/liq_orders | Retrieve liquidation history [**ListRiskLimitTiers**](FuturesApi.md#ListRiskLimitTiers) | **Get** /futures/{settle}/risk_limit_tiers | List risk limit tiers [**ListFuturesAccounts**](FuturesApi.md#ListFuturesAccounts) | **Get** /futures/{settle}/accounts | Query futures account [**ListFuturesAccountBook**](FuturesApi.md#ListFuturesAccountBook) | **Get** /futures/{settle}/account_book | Query account book [**ListPositions**](FuturesApi.md#ListPositions) | **Get** /futures/{settle}/positions | List all positions of a user [**GetPosition**](FuturesApi.md#GetPosition) | **Get** /futures/{settle}/positions/{contract} | Get single position [**UpdatePositionMargin**](FuturesApi.md#UpdatePositionMargin) | **Post** /futures/{settle}/positions/{contract}/margin | Update position margin [**UpdatePositionLeverage**](FuturesApi.md#UpdatePositionLeverage) | **Post** /futures/{settle}/positions/{contract}/leverage | Update position leverage [**UpdatePositionRiskLimit**](FuturesApi.md#UpdatePositionRiskLimit) | **Post** /futures/{settle}/positions/{contract}/risk_limit | Update position risk limit [**SetDualMode**](FuturesApi.md#SetDualMode) | **Post** /futures/{settle}/dual_mode | Enable or disable dual mode [**GetDualModePosition**](FuturesApi.md#GetDualModePosition) | **Get** /futures/{settle}/dual_comp/positions/{contract} | Retrieve position detail in dual mode [**UpdateDualModePositionMargin**](FuturesApi.md#UpdateDualModePositionMargin) | **Post** /futures/{settle}/dual_comp/positions/{contract}/margin | Update position margin in dual mode [**UpdateDualModePositionLeverage**](FuturesApi.md#UpdateDualModePositionLeverage) | **Post** /futures/{settle}/dual_comp/positions/{contract}/leverage | Update position leverage in dual mode [**UpdateDualModePositionRiskLimit**](FuturesApi.md#UpdateDualModePositionRiskLimit) | **Post** /futures/{settle}/dual_comp/positions/{contract}/risk_limit | Update position risk limit in dual mode [**ListFuturesOrders**](FuturesApi.md#ListFuturesOrders) | **Get** /futures/{settle}/orders | List futures orders [**CreateFuturesOrder**](FuturesApi.md#CreateFuturesOrder) | **Post** /futures/{settle}/orders | Create a futures order [**CancelFuturesOrders**](FuturesApi.md#CancelFuturesOrders) | **Delete** /futures/{settle}/orders | Cancel all `open` orders matched [**GetOrdersWithTimeRange**](FuturesApi.md#GetOrdersWithTimeRange) | **Get** /futures/{settle}/orders_timerange | List Futures Orders By Time Range [**CreateBatchFuturesOrder**](FuturesApi.md#CreateBatchFuturesOrder) | **Post** /futures/{settle}/batch_orders | Create a batch of futures orders [**GetFuturesOrder**](FuturesApi.md#GetFuturesOrder) | **Get** /futures/{settle}/orders/{order_id} | Get a single order [**AmendFuturesOrder**](FuturesApi.md#AmendFuturesOrder) | **Put** /futures/{settle}/orders/{order_id} | Amend an order [**CancelFuturesOrder**](FuturesApi.md#CancelFuturesOrder) | **Delete** /futures/{settle}/orders/{order_id} | Cancel a single order [**GetMyTrades**](FuturesApi.md#GetMyTrades) | **Get** /futures/{settle}/my_trades | List personal trading history [**GetMyTradesWithTimeRange**](FuturesApi.md#GetMyTradesWithTimeRange) | **Get** /futures/{settle}/my_trades_timerange | List personal trading history by time range [**ListPositionClose**](FuturesApi.md#ListPositionClose) | **Get** /futures/{settle}/position_close | List position close history [**ListLiquidates**](FuturesApi.md#ListLiquidates) | **Get** /futures/{settle}/liquidates | List liquidation history [**ListAutoDeleverages**](FuturesApi.md#ListAutoDeleverages) | **Get** /futures/{settle}/auto_deleverages | List Auto-Deleveraging History [**CountdownCancelAllFutures**](FuturesApi.md#CountdownCancelAllFutures) | **Post** /futures/{settle}/countdown_cancel_all | Countdown cancel orders [**GetFuturesFee**](FuturesApi.md#GetFuturesFee) | **Get** /futures/{settle}/fee | Query user trading fee rates [**CancelBatchFutureOrders**](FuturesApi.md#CancelBatchFutureOrders) | **Post** /futures/{settle}/batch_cancel_orders | Cancel a batch of orders with an ID list [**ListPriceTriggeredOrders**](FuturesApi.md#ListPriceTriggeredOrders) | **Get** /futures/{settle}/price_orders | List all auto orders [**CreatePriceTriggeredOrder**](FuturesApi.md#CreatePriceTriggeredOrder) | **Post** /futures/{settle}/price_orders | Create a price-triggered order [**CancelPriceTriggeredOrderList**](FuturesApi.md#CancelPriceTriggeredOrderList) | **Delete** /futures/{settle}/price_orders | Cancel all open orders [**GetPriceTriggeredOrder**](FuturesApi.md#GetPriceTriggeredOrder) | **Get** /futures/{settle}/price_orders/{order_id} | Get a price-triggered order [**CancelPriceTriggeredOrder**](FuturesApi.md#CancelPriceTriggeredOrder) | **Delete** /futures/{settle}/price_orders/{order_id} | cancel a price-triggered order ## ListFuturesContracts > []Contract ListFuturesContracts(ctx, settle, optional) List all futures contracts ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListFuturesContractsOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesContractsOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListFuturesContracts(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]Contract**](Contract.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetFuturesContract > Contract GetFuturesContract(ctx, settle, contract) Get a single contract ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.GetFuturesContract(ctx, settle, contract) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**Contract**](Contract.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesOrderBook > FuturesOrderBook ListFuturesOrderBook(ctx, settle, contract, optional) Futures order book Bids will be sorted by price from high to low, while asks sorted reversely ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **ListFuturesOrderBookOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesOrderBookOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **interval** | **optional.String**| Order depth. 0 means no aggregation is applied. default to 0 | [default to 0] **limit** | **optional.Int32**| Maximum number of order depth data in asks or bids | [default to 10] **withId** | **optional.Bool**| Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [default to false] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.ListFuturesOrderBook(ctx, settle, contract, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesOrderBook**](FuturesOrderBook.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesTrades > []FuturesTrade ListFuturesTrades(ctx, settle, contract, optional) Futures trading history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **ListFuturesTradesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesTradesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] **lastId** | **optional.String**| Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range | **from** | **optional.Int64**| Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | **to** | **optional.Int64**| Specify end time in Unix seconds, default to current time | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.ListFuturesTrades(ctx, settle, contract, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesTrade**](FuturesTrade.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesCandlesticks > []FuturesCandlestick ListFuturesCandlesticks(ctx, settle, contract, optional) Get futures candlesticks Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval` ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **ListFuturesCandlesticksOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesCandlesticksOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **from** | **optional.Int64**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | **to** | **optional.Int64**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | **limit** | **optional.Int32**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [default to 100] **interval** | **optional.String**| Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0. Note that 30d means 1 natual month, not 30 days | [default to 5m] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.ListFuturesCandlesticks(ctx, settle, contract, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesCandlestick**](FuturesCandlestick.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesPremiumIndex > []FuturesPremiumIndex ListFuturesPremiumIndex(ctx, settle, contract, optional) Premium Index K-Line Maximum of 1000 points can be returned in a query. Be sure not to exceed the limit when specifying from, to and interval ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **ListFuturesPremiumIndexOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesPremiumIndexOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **from** | **optional.Int64**| Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | **to** | **optional.Int64**| End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | **limit** | **optional.Int32**| Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [default to 100] **interval** | **optional.String**| Interval time between data points | [default to 5m] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.ListFuturesPremiumIndex(ctx, settle, contract, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesPremiumIndex**](FuturesPremiumIndex.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesTickers > []FuturesTicker ListFuturesTickers(ctx, settle, optional) List futures tickers ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListFuturesTickersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesTickersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListFuturesTickers(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesTicker**](FuturesTicker.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesFundingRateHistory > []FundingRateRecord ListFuturesFundingRateHistory(ctx, settle, contract, optional) Funding rate history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **ListFuturesFundingRateHistoryOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesFundingRateHistoryOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.ListFuturesFundingRateHistory(ctx, settle, contract, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FundingRateRecord**](FundingRateRecord.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesInsuranceLedger > []InsuranceRecord ListFuturesInsuranceLedger(ctx, settle, optional) Futures insurance balance history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListFuturesInsuranceLedgerOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesInsuranceLedgerOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListFuturesInsuranceLedger(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]InsuranceRecord**](InsuranceRecord.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListContractStats > []ContractStat ListContractStats(ctx, settle, contract, optional) Futures stats ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **ListContractStatsOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListContractStatsOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **from** | **optional.Int64**| Start timestamp | **interval** | **optional.String**| | [default to 5m] **limit** | **optional.Int32**| | [default to 30] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.ListContractStats(ctx, settle, contract, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]ContractStat**](ContractStat.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetIndexConstituents > FuturesIndexConstituents GetIndexConstituents(ctx, settle, index) Get index constituents ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **index** | **string**| Index name | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency index := "BTC_USDT" // string - Index name result, _, err := client.FuturesApi.GetIndexConstituents(ctx, settle, index) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesIndexConstituents**](FuturesIndexConstituents.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListLiquidatedOrders > []FuturesLiqOrder ListLiquidatedOrders(ctx, settle, optional) Retrieve liquidation history Interval between `from` and `to` cannot exceeds 3600. Some private fields will not be returned in public endpoints. Refer to field description for detail. ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListLiquidatedOrdersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListLiquidatedOrdersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **from** | **optional.Int64**| Start timestamp | **to** | **optional.Int64**| End timestamp | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListLiquidatedOrders(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesLiqOrder**](FuturesLiqOrder.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListRiskLimitTiers > []FuturesLimitRiskTiers ListRiskLimitTiers(ctx, settle, contract) List risk limit tiers ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.Background() settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.ListRiskLimitTiers(ctx, settle, contract) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesLimitRiskTiers**](FuturesLimitRiskTiers.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesAccounts > FuturesAccount ListFuturesAccounts(ctx, settle) Query futures account ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListFuturesAccounts(ctx, settle) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesAccount**](FuturesAccount.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesAccountBook > []FuturesAccountBook ListFuturesAccountBook(ctx, settle, optional) Query account book If the `contract` field is provided, it can only filter records that include this field after 2023-10-30. ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListFuturesAccountBookOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesAccountBookOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] **from** | **optional.Int64**| Start timestamp | **to** | **optional.Int64**| End timestamp | **type_** | **optional.String**| Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate - bonus_offset: bouns deduction | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListFuturesAccountBook(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesAccountBook**](FuturesAccountBook.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListPositions > []Position ListPositions(ctx, settle, optional) List all positions of a user ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListPositionsOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListPositionsOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **holding** | **optional.Bool**| Return only real positions - true, return all - false. | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListPositions(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetPosition > Position GetPosition(ctx, settle, contract) Get single position ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.GetPosition(ctx, settle, contract) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdatePositionMargin > Position UpdatePositionMargin(ctx, settle, contract, change) Update position margin ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **change** | **string**| Margin change. Use positive number to increase margin, negative number otherwise. | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract change := "0.01" // string - Margin change. Use positive number to increase margin, negative number otherwise. result, _, err := client.FuturesApi.UpdatePositionMargin(ctx, settle, contract, change) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdatePositionLeverage > Position UpdatePositionLeverage(ctx, settle, contract, leverage, optional) Update position leverage ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **leverage** | **string**| New position leverage | **optional** | **UpdatePositionLeverageOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a UpdatePositionLeverageOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **crossLeverageLimit** | **optional.String**| Cross margin leverage(valid only when `leverage` is 0) | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract leverage := "10" // string - New position leverage result, _, err := client.FuturesApi.UpdatePositionLeverage(ctx, settle, contract, leverage, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdatePositionRiskLimit > Position UpdatePositionRiskLimit(ctx, settle, contract, riskLimit) Update position risk limit ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **riskLimit** | **string**| New position risk limit | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract riskLimit := "10" // string - New position risk limit result, _, err := client.FuturesApi.UpdatePositionRiskLimit(ctx, settle, contract, riskLimit) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## SetDualMode > FuturesAccount SetDualMode(ctx, settle, dualMode) Enable or disable dual mode Before setting dual mode, make sure all positions are closed and no orders are open ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **dualMode** | **bool**| Whether to enable dual mode | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency dualMode := true // bool - Whether to enable dual mode result, _, err := client.FuturesApi.SetDualMode(ctx, settle, dualMode) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesAccount**](FuturesAccount.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetDualModePosition > []Position GetDualModePosition(ctx, settle, contract) Retrieve position detail in dual mode ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.GetDualModePosition(ctx, settle, contract) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdateDualModePositionMargin > []Position UpdateDualModePositionMargin(ctx, settle, contract, change, dualSide) Update position margin in dual mode ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **change** | **string**| Margin change. Use positive number to increase margin, negative number otherwise. | **dualSide** | **string**| Long or short position | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract change := "0.01" // string - Margin change. Use positive number to increase margin, negative number otherwise. dualSide := "dual_long" // string - Long or short position result, _, err := client.FuturesApi.UpdateDualModePositionMargin(ctx, settle, contract, change, dualSide) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdateDualModePositionLeverage > []Position UpdateDualModePositionLeverage(ctx, settle, contract, leverage, optional) Update position leverage in dual mode ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **leverage** | **string**| New position leverage | **optional** | **UpdateDualModePositionLeverageOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a UpdateDualModePositionLeverageOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **crossLeverageLimit** | **optional.String**| Cross margin leverage(valid only when `leverage` is 0) | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract leverage := "10" // string - New position leverage result, _, err := client.FuturesApi.UpdateDualModePositionLeverage(ctx, settle, contract, leverage, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## UpdateDualModePositionRiskLimit > []Position UpdateDualModePositionRiskLimit(ctx, settle, contract, riskLimit) Update position risk limit in dual mode ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **riskLimit** | **string**| New position risk limit | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract riskLimit := "10" // string - New position risk limit result, _, err := client.FuturesApi.UpdateDualModePositionRiskLimit(ctx, settle, contract, riskLimit) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]Position**](Position.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListFuturesOrders > []FuturesOrder ListFuturesOrders(ctx, settle, status, optional) List futures orders - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **status** | **string**| Only list the orders with this status | **optional** | **ListFuturesOrdersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListFuturesOrdersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] **lastId** | **optional.String**| Specify list staring point using the `id` of last record in previous list-query results | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency status := "open" // string - Only list the orders with this status result, _, err := client.FuturesApi.ListFuturesOrders(ctx, settle, status, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CreateFuturesOrder > FuturesOrder CreateFuturesOrder(ctx, settle, futuresOrder) Create a futures order - Creating futures orders requires `size`, which is number of contracts instead of currency amount. You can use `quanto_multiplier` in contract detail response to know how much currency 1 size contract represents - Zero-filled order cannot be retrieved 10 minutes after order cancellation. You will get a 404 not found for such orders - Set `reduce_only` to `true` can keep the position from changing side when reducing position size - In single position mode, to close a position, you need to set `size` to 0 and `close` to `true` - In dual position mode, to close one side position, you need to set `auto_size` side, `reduce_only` to true and `size` to 0 - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **futuresOrder** | [**FuturesOrder**](FuturesOrder.md)| | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency futuresOrder := gateapi.FuturesOrder{} // FuturesOrder - result, _, err := client.FuturesApi.CreateFuturesOrder(ctx, settle, futuresOrder) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CancelFuturesOrders > []FuturesOrder CancelFuturesOrders(ctx, settle, contract, optional) Cancel all `open` orders matched Zero-filled order cannot be retrieved 10 minutes after order cancellation ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | **optional** | **CancelFuturesOrdersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a CancelFuturesOrdersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **side** | **optional.String**| All bids or asks. Both included if not specified | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.CancelFuturesOrders(ctx, settle, contract, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetOrdersWithTimeRange > []FuturesOrder GetOrdersWithTimeRange(ctx, settle, optional) List Futures Orders By Time Range ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **GetOrdersWithTimeRangeOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a GetOrdersWithTimeRangeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **from** | **optional.Int64**| Start timestamp | **to** | **optional.Int64**| End timestamp | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.GetOrdersWithTimeRange(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CreateBatchFuturesOrder > []BatchFuturesOrder CreateBatchFuturesOrder(ctx, settle, futuresOrder) Create a batch of futures orders - Up to 10 orders per request - If any of the order's parameters are missing or in the wrong format, all of them will not be executed, and a http status 400 error will be returned directly - If the parameters are checked and passed, all are executed. Even if there is a business logic error in the middle (such as insufficient funds), it will not affect other execution orders - The returned result is in array format, and the order corresponds to the orders in the request body - In the returned result, the `succeeded` field of type bool indicates whether the execution was successful or not - If the execution is successful, the normal order content is included; if the execution fails, the `label` field is included to indicate the cause of the error - In the rate limiting, each order is counted individually ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **futuresOrder** | [**[]FuturesOrder**](FuturesOrder.md)| | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency futuresOrder := []gateapi.FuturesOrder{gateapi.FuturesOrder{}} // []FuturesOrder - result, _, err := client.FuturesApi.CreateBatchFuturesOrder(ctx, settle, futuresOrder) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]BatchFuturesOrder**](BatchFuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetFuturesOrder > FuturesOrder GetFuturesOrder(ctx, settle, orderId) Get a single order - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **orderId** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency orderId := "12345" // string - Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. result, _, err := client.FuturesApi.GetFuturesOrder(ctx, settle, orderId) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## AmendFuturesOrder > FuturesOrder AmendFuturesOrder(ctx, settle, orderId, futuresOrderAmendment) Amend an order ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **orderId** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | **futuresOrderAmendment** | [**FuturesOrderAmendment**](FuturesOrderAmendment.md)| | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency orderId := "12345" // string - Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. futuresOrderAmendment := gateapi.FuturesOrderAmendment{} // FuturesOrderAmendment - result, _, err := client.FuturesApi.AmendFuturesOrder(ctx, settle, orderId, futuresOrderAmendment) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CancelFuturesOrder > FuturesOrder CancelFuturesOrder(ctx, settle, orderId) Cancel a single order ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **orderId** | **string**| Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency orderId := "12345" // string - Order ID returned, or user custom ID(i.e., `text` field). Operations based on custom ID can only be checked when the order is in orderbook. When the order is finished, it can be checked within 60 seconds after the end of the order. After that, only order ID is accepted. result, _, err := client.FuturesApi.CancelFuturesOrder(ctx, settle, orderId) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesOrder**](FuturesOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetMyTrades > []MyFuturesTrade GetMyTrades(ctx, settle, optional) List personal trading history By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/my_trades_timerange`. ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **GetMyTradesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a GetMyTradesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **order** | **optional.Int64**| Futures order ID, return related data only if specified | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] **lastId** | **optional.String**| Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. If you need to iterate through and retrieve more records, we recommend using 'GET /futures/{settle}/my_trades_timerange'. | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.GetMyTrades(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]MyFuturesTrade**](MyFuturesTrade.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetMyTradesWithTimeRange > []MyFuturesTradeTimeRange GetMyTradesWithTimeRange(ctx, settle, optional) List personal trading history by time range ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **GetMyTradesWithTimeRangeOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a GetMyTradesWithTimeRangeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **from** | **optional.Int64**| Start timestamp | **to** | **optional.Int64**| End timestamp | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] **role** | **optional.String**| Query role, maker or taker. | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.GetMyTradesWithTimeRange(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]MyFuturesTradeTimeRange**](MyFuturesTradeTimeRange.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListPositionClose > []PositionClose ListPositionClose(ctx, settle, optional) List position close history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListPositionCloseOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListPositionCloseOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] **from** | **optional.Int64**| Start timestamp | **to** | **optional.Int64**| End timestamp | **side** | **optional.String**| Query side. long or shot | **pnl** | **optional.String**| Query profit or loss | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListPositionClose(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]PositionClose**](PositionClose.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListLiquidates > []FuturesLiquidate ListLiquidates(ctx, settle, optional) List liquidation history ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListLiquidatesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListLiquidatesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **at** | **optional.Int32**| Specify a liquidation timestamp | [default to 0] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListLiquidates(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesLiquidate**](FuturesLiquidate.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListAutoDeleverages > []FuturesAutoDeleverage ListAutoDeleverages(ctx, settle, optional) List Auto-Deleveraging History ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **ListAutoDeleveragesOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListAutoDeleveragesOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **at** | **optional.Int32**| Specify an auto-deleveraging timestamp | [default to 0] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.ListAutoDeleverages(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesAutoDeleverage**](FuturesAutoDeleverage.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CountdownCancelAllFutures > TriggerTime CountdownCancelAllFutures(ctx, settle, countdownCancelAllFuturesTask) Countdown cancel orders When the timeout set by the user is reached, if there is no cancel or set a new countdown, the related pending orders will be automatically cancelled. This endpoint can be called repeatedly to set a new countdown or cancel the countdown. For example, call this endpoint at 30s intervals, each countdown`timeout` is set to 30s. If this endpoint is not called again within 30 seconds, all pending orders on the specified `market` will be automatically cancelled, if no `market` is specified, all market pending orders will be cancelled. If the `timeout` is set to 0 within 30 seconds, the countdown timer will expire and the cacnel function will be cancelled. ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **countdownCancelAllFuturesTask** | [**CountdownCancelAllFuturesTask**](CountdownCancelAllFuturesTask.md)| | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency countdownCancelAllFuturesTask := gateapi.CountdownCancelAllFuturesTask{} // CountdownCancelAllFuturesTask - result, _, err := client.FuturesApi.CountdownCancelAllFutures(ctx, settle, countdownCancelAllFuturesTask) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**TriggerTime**](triggerTime.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetFuturesFee > map[string]FuturesFee GetFuturesFee(ctx, settle, optional) Query user trading fee rates ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **optional** | **GetFuturesFeeOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a GetFuturesFeeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency result, _, err := client.FuturesApi.GetFuturesFee(ctx, settle, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**map[string]FuturesFee**](FuturesFee.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CancelBatchFutureOrders > []FutureCancelOrderResult CancelBatchFutureOrders(ctx, settle, requestBody) Cancel a batch of orders with an ID list Multiple distinct order ID list can be specified。Each request can cancel a maximum of 20 records. ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **requestBody** | [**[]string**](string.md)| | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency requestBody := []string{"requestBody_example"} // []string - result, _, err := client.FuturesApi.CancelBatchFutureOrders(ctx, settle, requestBody) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FutureCancelOrderResult**](FutureCancelOrderResult.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## ListPriceTriggeredOrders > []FuturesPriceTriggeredOrder ListPriceTriggeredOrders(ctx, settle, status, optional) List all auto orders ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **status** | **string**| Only list the orders with this status | **optional** | **ListPriceTriggeredOrdersOpts** | optional parameters | nil if no parameters ### Optional Parameters Optional parameters are passed through a pointer to a ListPriceTriggeredOrdersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contract** | **optional.String**| Futures contract, return related data only if specified | **limit** | **optional.Int32**| Maximum number of records to be returned in a single list | [default to 100] **offset** | **optional.Int32**| List offset, starting from 0 | [default to 0] ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency status := "status_example" // string - Only list the orders with this status result, _, err := client.FuturesApi.ListPriceTriggeredOrders(ctx, settle, status, nil) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CreatePriceTriggeredOrder > TriggerOrderResponse CreatePriceTriggeredOrder(ctx, settle, futuresPriceTriggeredOrder) Create a price-triggered order ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **futuresPriceTriggeredOrder** | [**FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md)| | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency futuresPriceTriggeredOrder := gateapi.FuturesPriceTriggeredOrder{} // FuturesPriceTriggeredOrder - result, _, err := client.FuturesApi.CreatePriceTriggeredOrder(ctx, settle, futuresPriceTriggeredOrder) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**TriggerOrderResponse**](TriggerOrderResponse.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CancelPriceTriggeredOrderList > []FuturesPriceTriggeredOrder CancelPriceTriggeredOrderList(ctx, settle, contract) Cancel all open orders ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **contract** | **string**| Futures contract | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency contract := "BTC_USDT" // string - Futures contract result, _, err := client.FuturesApi.CancelPriceTriggeredOrderList(ctx, settle, contract) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**[]FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## GetPriceTriggeredOrder > FuturesPriceTriggeredOrder GetPriceTriggeredOrder(ctx, settle, orderId) Get a price-triggered order ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **orderId** | **string**| Retrieve the data of the order with the specified ID | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency orderId := "orderId_example" // string - Retrieve the data of the order with the specified ID result, _, err := client.FuturesApi.GetPriceTriggeredOrder(ctx, settle, orderId) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ## CancelPriceTriggeredOrder > FuturesPriceTriggeredOrder CancelPriceTriggeredOrder(ctx, settle, orderId) cancel a price-triggered order ### Required Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **settle** | **string**| Settle currency | **orderId** | **string**| Retrieve the data of the order with the specified ID | ### Example ```golang package main import ( "context" "fmt" "github.com/gateio/gateapi-go/v6" ) func main() { client := gateapi.NewAPIClient(gateapi.NewConfiguration()) // uncomment the next line if your are testing against testnet // client.ChangeBasePath("https://fx-api-testnet.gateio.ws/api/v4") ctx := context.WithValue(context.Background(), gateapi.ContextGateAPIV4, gateapi.GateAPIV4{ Key: "YOUR_API_KEY", Secret: "YOUR_API_SECRET", } ) settle := "usdt" // string - Settle currency orderId := "orderId_example" // string - Retrieve the data of the order with the specified ID result, _, err := client.FuturesApi.CancelPriceTriggeredOrder(ctx, settle, orderId) if err != nil { if e, ok := err.(gateapi.GateAPIError); ok { fmt.Printf("gate api error: %s\n", e.Error()) } else { fmt.Printf("generic error: %s\n", err.Error()) } } else { fmt.Println(result) } } ``` ### Return type [**FuturesPriceTriggeredOrder**](FuturesPriceTriggeredOrder.md) ### Authorization [apiv4](../README.md#apiv4) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)