Skip to content

Latest commit

 

History

History
1018 lines (810 loc) · 47 KB

BotApi.md

File metadata and controls

1018 lines (810 loc) · 47 KB

Io.Gate.GateApi.Api.BotApi

All URIs are relative to https://api.gateio.ws/api/v4

Method HTTP request Description
GetAIHubStrategyRecommend GET /bot/strategy/recommend Get AIHub strategy recommendations
PostAIHubSpotGridCreate POST /bot/spot-grid/create Create spot grid
PostAIHubMarginGridCreate POST /bot/margin-grid/create Create a lever grid
PostAIHubInfiniteGridCreate POST /bot/infinite-grid/create Create infinite grid
PostAIHubFuturesGridCreate POST /bot/futures-grid/create Create a contract grid
PostAIHubSpotMartingaleCreate POST /bot/spot-martingale/create Create Spot Martin
PostAIHubContractMartingaleCreate POST /bot/contract-martingale/create Create contract martin
GetAIHubPortfolioRunning GET /bot/portfolio/running List running strategies.
GetAIHubPortfolioDetail GET /bot/portfolio/detail Query order policy details
PostAIHubPortfolioStop POST /bot/portfolio/stop Terminate a single running policy
PostAIHubSmartPositionCreate POST /bot/smart-position/create Create rebalance bot
PostAIHubFuturesComboCreate POST /bot/futures-combo/create Create futures-combo bot

GetAIHubStrategyRecommend

AIHubDiscoverSuccessResponse GetAIHubStrategyRecommend (string market = null, string strategyType = null, string direction = null, string investAmount = null, string scene = null, string refreshRecommendationId = null, int? limit = null, string maxDrawdownLte = null, string backtestAprGte = null, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null, string excludeRecommendationId = null)

Get AIHub strategy recommendations

Six real official source types. Exact rebalance asset membership is filtered before ranking. contract_martingale and futures_combo are manual-only. Legacy APR/drawdown and ordinary two-segment refresh remain compatible. Exclusion binds one prior logical candidate before ranking; no alternative returns an empty list without relaxing constraints.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class GetAIHubStrategyRecommendExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var market = "market_example";  // string | Trading pair, such as `BTC_USDT` (optional) 
            var strategyType = "strategyType_example";  // string | Recommended target policy type; `contract_martingale` not allowed (optional) 
            var direction = "direction_example";  // string | Market direction (optional) 
            var investAmount = "investAmount_example";  // string | Context only. No budget eligibility filter; reported unsupported when not consumed. (optional) 
            var scene = "scene_example";  // string | Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic. (optional) 
            var refreshRecommendationId = "refreshRecommendationId_example";  // string | It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type|market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored. (optional) 
            var limit = 56;  // int? | Actual maximum result count, 1–10; defaults to 10. (optional) 
            var maxDrawdownLte = "maxDrawdownLte_example";  // string | Maximum drawdown limit (optional) 
            var backtestAprGte = "backtestAprGte_example";  // string | Backtest annualized lower limit (optional) 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 
            var excludeRecommendationId = "excludeRecommendationId_example";  // string | Refresh-only previous returned identity: type|market|backtest_id, with an optional stable parameter discriminator for colliding source IDs. Ambiguous old identities are rejected; metric-only changes do not produce a new plan. (optional) 

            try
            {
                // Get AIHub strategy recommendations
                AIHubDiscoverSuccessResponse result = apiInstance.GetAIHubStrategyRecommend(market, strategyType, direction, investAmount, scene, refreshRecommendationId, limit, maxDrawdownLte, backtestAprGte, xGateServiceId, xGateAppLang, xRequestId, xTraceId, excludeRecommendationId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.GetAIHubStrategyRecommend: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
market string Trading pair, such as `BTC_USDT` [optional]
strategyType string Recommended target policy type; `contract_martingale` not allowed [optional]
direction string Market direction [optional]
investAmount string Context only. No budget eligibility filter; reported unsupported when not consumed. [optional]
scene string Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic. [optional]
refreshRecommendationId string It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored.
limit int? Actual maximum result count, 1–10; defaults to 10. [optional]
maxDrawdownLte string Maximum drawdown limit [optional]
backtestAprGte string Backtest annualized lower limit [optional]
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]
excludeRecommendationId string Refresh-only previous returned identity: type market

Return type

AIHubDiscoverSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAIHubSpotGridCreate

AIHubCreateSuccessResponse PostAIHubSpotGridCreate (SpotGridCreateRequest spotGridCreateRequest, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Create spot grid

Create a spot grid strategy based on the incoming parameters.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class PostAIHubSpotGridCreateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var spotGridCreateRequest = new SpotGridCreateRequest(); // SpotGridCreateRequest | 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Create spot grid
                AIHubCreateSuccessResponse result = apiInstance.PostAIHubSpotGridCreate(spotGridCreateRequest, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.PostAIHubSpotGridCreate: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
spotGridCreateRequest SpotGridCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubCreateSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAIHubMarginGridCreate

AIHubCreateSuccessResponse PostAIHubMarginGridCreate (MarginGridCreateRequest marginGridCreateRequest, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Create a lever grid

Create a leverage grid strategy based on the passed parameters.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class PostAIHubMarginGridCreateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var marginGridCreateRequest = new MarginGridCreateRequest(); // MarginGridCreateRequest | 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Create a lever grid
                AIHubCreateSuccessResponse result = apiInstance.PostAIHubMarginGridCreate(marginGridCreateRequest, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.PostAIHubMarginGridCreate: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
marginGridCreateRequest MarginGridCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubCreateSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAIHubInfiniteGridCreate

AIHubCreateSuccessResponse PostAIHubInfiniteGridCreate (InfiniteGridCreateRequest infiniteGridCreateRequest, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Create infinite grid

Create an infinite grid strategy based on passed parameters.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class PostAIHubInfiniteGridCreateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var infiniteGridCreateRequest = new InfiniteGridCreateRequest(); // InfiniteGridCreateRequest | 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Create infinite grid
                AIHubCreateSuccessResponse result = apiInstance.PostAIHubInfiniteGridCreate(infiniteGridCreateRequest, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.PostAIHubInfiniteGridCreate: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
infiniteGridCreateRequest InfiniteGridCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubCreateSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAIHubFuturesGridCreate

AIHubCreateSuccessResponse PostAIHubFuturesGridCreate (FuturesGridCreateRequest futuresGridCreateRequest, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Create a contract grid

Create a contract grid strategy based on the incoming parameters.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class PostAIHubFuturesGridCreateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var futuresGridCreateRequest = new FuturesGridCreateRequest(); // FuturesGridCreateRequest | 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Create a contract grid
                AIHubCreateSuccessResponse result = apiInstance.PostAIHubFuturesGridCreate(futuresGridCreateRequest, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.PostAIHubFuturesGridCreate: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
futuresGridCreateRequest FuturesGridCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubCreateSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAIHubSpotMartingaleCreate

AIHubCreateSuccessResponse PostAIHubSpotMartingaleCreate (SpotMartingaleCreateRequest spotMartingaleCreateRequest, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Create Spot Martin

Create a spot martingale strategy from the given parameters. Stop-loss semantics match the app / MartingaleBot: - Use create_params.stop_loss_per_cycle (ratio per round as a decimal string) for creation-side stop-loss; do not use stop_loss_price for creation logic. - Stop-loss prices shown on detail pages are computed per round by the engine; creation accepts optional create_params.trigger_price (trigger price).

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class PostAIHubSpotMartingaleCreateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var spotMartingaleCreateRequest = new SpotMartingaleCreateRequest(); // SpotMartingaleCreateRequest | 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Create Spot Martin
                AIHubCreateSuccessResponse result = apiInstance.PostAIHubSpotMartingaleCreate(spotMartingaleCreateRequest, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.PostAIHubSpotMartingaleCreate: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
spotMartingaleCreateRequest SpotMartingaleCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubCreateSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAIHubContractMartingaleCreate

AIHubCreateSuccessResponse PostAIHubContractMartingaleCreate (ContractMartingaleCreateRequest contractMartingaleCreateRequest, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Create contract martin

Create a contract Martin strategy based on the input parameters.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class PostAIHubContractMartingaleCreateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var contractMartingaleCreateRequest = new ContractMartingaleCreateRequest(); // ContractMartingaleCreateRequest | 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Create contract martin
                AIHubCreateSuccessResponse result = apiInstance.PostAIHubContractMartingaleCreate(contractMartingaleCreateRequest, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.PostAIHubContractMartingaleCreate: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
contractMartingaleCreateRequest ContractMartingaleCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubCreateSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAIHubPortfolioRunning

AIHubPortfolioRunningSuccessResponse GetAIHubPortfolioRunning (string strategyType = null, string market = null, int? page = null, int? pageSize = null, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

List running strategies.

Query the list of AIHub strategies currently running by the user, and support filtering by strategy type, trading pair and paging conditions.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class GetAIHubPortfolioRunningExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var strategyType = "strategyType_example";  // string | Filter by policy type (optional) 
            var market = "market_example";  // string | Filter by trading pair (optional) 
            var page = 1;  // int? | Page number, default 1 (optional)  (default to 1)
            var pageSize = 20;  // int? | Paging size, default 20, maximum 50 (optional)  (default to 20)
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // List running strategies.
                AIHubPortfolioRunningSuccessResponse result = apiInstance.GetAIHubPortfolioRunning(strategyType, market, page, pageSize, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.GetAIHubPortfolioRunning: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
strategyType string Filter by policy type [optional]
market string Filter by trading pair [optional]
page int? Page number, default 1 [optional] [default to 1]
pageSize int? Paging size, default 20, maximum 50 [optional] [default to 20]
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubPortfolioRunningSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAIHubPortfolioDetail

AIHubPortfolioDetailSuccessResponse GetAIHubPortfolioDetail (string strategyId, string strategyType, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Query order policy details

Both strategy_id and strategy_type must be passed in the request, where strategy_type is used to distribute to the underlying detailed implementation by strategy type.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class GetAIHubPortfolioDetailExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var strategyId = "strategyId_example";  // string | Policy ID
            var strategyType = "strategyType_example";  // string | Policy type; used for underlying detail distribution
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Query order policy details
                AIHubPortfolioDetailSuccessResponse result = apiInstance.GetAIHubPortfolioDetail(strategyId, strategyType, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.GetAIHubPortfolioDetail: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
strategyId string Policy ID
strategyType string Policy type; used for underlying detail distribution
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubPortfolioDetailSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAIHubPortfolioStop

AIHubPortfolioStopSuccessResponse PostAIHubPortfolioStop (AIHubPortfolioStopRequest aIHubPortfolioStopRequest, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Terminate a single running policy

Only one policy is allowed to be terminated per request. Risk warning and secondary confirmation are borne by the upper layer of OpenClaw; this interface is only responsible for executing stop.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class PostAIHubPortfolioStopExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var aIHubPortfolioStopRequest = new AIHubPortfolioStopRequest(); // AIHubPortfolioStopRequest | 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Terminate a single running policy
                AIHubPortfolioStopSuccessResponse result = apiInstance.PostAIHubPortfolioStop(aIHubPortfolioStopRequest, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.PostAIHubPortfolioStop: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
aIHubPortfolioStopRequest AIHubPortfolioStopRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubPortfolioStopSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAIHubSmartPositionCreate

AIHubCreateSuccessResponse PostAIHubSmartPositionCreate (AIHubRebalanceCreateRequest aIHubRebalanceCreateRequest, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Create rebalance bot

Typed AIHub adapter; authenticated owner comes only from trusted gateway context.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class PostAIHubSmartPositionCreateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var aIHubRebalanceCreateRequest = new AIHubRebalanceCreateRequest(); // AIHubRebalanceCreateRequest | 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Create rebalance bot
                AIHubCreateSuccessResponse result = apiInstance.PostAIHubSmartPositionCreate(aIHubRebalanceCreateRequest, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.PostAIHubSmartPositionCreate: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
aIHubRebalanceCreateRequest AIHubRebalanceCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubCreateSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostAIHubFuturesComboCreate

AIHubCreateSuccessResponse PostAIHubFuturesComboCreate (AIHubFuturesComboCreateRequest aIHubFuturesComboCreateRequest, string xGateServiceId = null, string xGateAppLang = null, string xRequestId = null, string xTraceId = null)

Create futures-combo bot

Typed AIHub adapter; authenticated owner comes only from trusted gateway context.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;

namespace Example
{
    public class PostAIHubFuturesComboCreateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");

            var apiInstance = new BotApi(config);
            var aIHubFuturesComboCreateRequest = new AIHubFuturesComboCreateRequest(); // AIHubFuturesComboCreateRequest | 
            var xGateServiceId = "xGateServiceId_example";  // string | Call source identifier; injected by APIv4 if necessary (optional) 
            var xGateAppLang = "xGateAppLang_example";  // string | Language context, such as `zh-CN` / `en-US` (optional) 
            var xRequestId = "xRequestId_example";  // string | Request link ID; caller can transmit transparently (optional) 
            var xTraceId = "xTraceId_example";  // string | trace header; can be generated uniformly by APIv4 (optional) 

            try
            {
                // Create futures-combo bot
                AIHubCreateSuccessResponse result = apiInstance.PostAIHubFuturesComboCreate(aIHubFuturesComboCreateRequest, xGateServiceId, xGateAppLang, xRequestId, xTraceId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling BotApi.PostAIHubFuturesComboCreate: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
aIHubFuturesComboCreateRequest AIHubFuturesComboCreateRequest
xGateServiceId string Call source identifier; injected by APIv4 if necessary [optional]
xGateAppLang string Language context, such as `zh-CN` / `en-US` [optional]
xRequestId string Request link ID; caller can transmit transparently [optional]
xTraceId string trace header; can be generated uniformly by APIv4 [optional]

Return type

AIHubCreateSuccessResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Unified business response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]