8000 gateapi-csharp/docs/OptionsApi.md at master · gateio/gateapi-csharp · GitHub
[go: up one dir, main page]

Skip to content
8000

Latest commit

 

History

History
2088 lines (1648 loc) · 75.1 KB

File metadata and controls

2088 lines (1648 loc) · 75.1 KB

Io.Gate.GateApi.Api.OptionsApi

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

Method HTTP request Description
ListOptionsUnderlyings GET /options/underlyings List all underlying assets
ListOptionsExpirations GET /options/expirations List all expiration dates
ListOptionsContracts GET /options/contracts List all contracts for specified underlying and expiration date
GetOptionsContract GET /options/contracts/{contract} Query specified contract details
ListOptionsSettlements GET /options/settlements List settlement history
GetOptionsSettlement GET /options/settlements/{contract} Get specified contract settlement information
ListMyOptionsSettlements GET /options/my_settlements Query personal settlement records
ListOptionsOrderBook GET /options/order_book Query options contract order book
ListOptionsTickers GET /options/tickers Query options market ticker information
ListOptionsUnderlyingTickers GET /options/underlying/tickers/{underlying} Query underlying ticker information
ListOptionsCandlesticks GET /options/candlesticks Options contract market candlestick chart
ListOptionsUnderlyingCandlesticks GET /options/underlying/candlesticks Underlying index price candlestick chart
ListOptionsTrades GET /options/trades Market trade records
ListOptionsAccount GET /options/accounts Query account information
ListOptionsAccountBook GET /options/account_book Query account change history
ListOptionsPositions GET /options/positions List user's positions of specified underlying
GetOptionsPosition GET /options/positions/{contract} Get specified contract position
ListOptionsPositionClose GET /options/position_close List user's liquidation history of specified underlying
ListOptionsOrders GET /options/orders List options orders
CreateOptionsOrder POST /options/orders Create an options order
CancelOptionsOrders DELETE /options/orders Cancel all orders with 'open' status
GetOptionsOrder GET /options/orders/{order_id} Query single order details
CancelOptionsOrder DELETE /options/orders/{order_id} Cancel single order
CountdownCancelAllOptions POST /options/countdown_cancel_all Countdown cancel orders
ListMyOptionsTrades GET /options/my_trades Query personal trading records
GetOptionsMMP GET /options/mmp MMP Query.
SetOptionsMMP POST /options/mmp MMP Settings
ResetOptionsMMP POST /options/mmp/reset MMP Reset

ListOptionsUnderlyings

List<OptionsUnderlying> ListOptionsUnderlyings ()

List all underlying assets

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 ListOptionsUnderlyingsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);

            try
            {
                // List all underlying assets
                List<OptionsUnderlying> result = apiInstance.ListOptionsUnderlyings();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsUnderlyings: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<OptionsUnderlying>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

ListOptionsExpirations

List<long> ListOptionsExpirations (string underlying)

List all expiration dates

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 ListOptionsExpirationsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (Obtained by listing underlying endpoint)

            try
            {
                // List all expiration dates
                List<long> result = apiInstance.ListOptionsExpirations(underlying);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsExpirations: " + 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
underlying string Underlying (Obtained by listing underlying endpoint)

Return type

List

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List expiration dates for specified underlying -

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

ListOptionsContracts

List<OptionsContract> ListOptionsContracts (string underlying, long? expiration = null)

List all contracts for specified underlying and expiration date

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 ListOptionsContractsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (Obtained by listing underlying endpoint)
            var expiration = 1636588800;  // long? | Unix timestamp of expiration date (optional) 

            try
            {
                // List all contracts for specified underlying and expiration date
                List<OptionsContract> result = apiInstance.ListOptionsContracts(underlying, expiration);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsContracts: " + 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
underlying string Underlying (Obtained by listing underlying endpoint)
expiration long? Unix timestamp of expiration date [optional]

Return type

List<OptionsContract>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

GetOptionsContract

OptionsContract GetOptionsContract (string contract)

Query specified contract details

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 GetOptionsContractExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var contract = "BTC_USDT-20211130-65000-C";  // string | 

            try
            {
                // Query specified contract details
                OptionsContract result = apiInstance.GetOptionsContract(contract);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.GetOptionsContract: " + 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
contract string

Return type

OptionsContract

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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

ListOptionsSettlements

List<OptionsSettlement> ListOptionsSettlements (string underlying, int? limit = null, int? offset = null, long? from = null, long? to = null)

List settlement history

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 ListOptionsSettlementsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (Obtained by listing underlying endpoint)
            var limit = 100;  // int? | Maximum number of records returned in a single list (optional)  (default to 100)
            var offset = 0;  // int? | List offset, starting from 0 (optional)  (default to 0)
            var from = 1547706332;  // long? | Start timestamp  Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) 
            var to = 1547706332;  // long? | Termination Timestamp  Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) 

            try
            {
                // List settlement history
                List<OptionsSettlement> result = apiInstance.ListOptionsSettlements(underlying, limit, offset, from, to);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsSettlements: " + 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
underlying string Underlying (Obtained by listing underlying endpoint)
limit int? Maximum number of records returned in a single list [optional] [default to 100]
offset int? List offset, starting from 0 [optional] [default to 0]
from long? Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) [optional]
to long? Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp [optional]

Return type

List<OptionsSettlement>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

GetOptionsSettlement

OptionsSettlement GetOptionsSettlement (string contract, string underlying, long at)

Get specified contract settlement information

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 GetOptionsSettlementExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var contract = "BTC_USDT-20211130-65000-C";  // string | 
            var underlying = "BTC_USDT";  // string | Underlying (Obtained by listing underlying endpoint)
            var at = 56;  // long | 

            try
            {
                // Get specified contract settlement information
                OptionsSettlement result = apiInstance.GetOptionsSettlement(contract, underlying, at);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.GetOptionsSettlement: " + 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
contract string
underlying string Underlying (Obtained by listing underlying endpoint)
at long

Return type

OptionsSettlement

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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

ListMyOptionsSettlements

List<OptionsMySettlements> ListMyOptionsSettlements (string underlying, string contract = null, int? limit = null, int? offset = null, long? from = null, long? to = null)

Query personal settlement records

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 ListMyOptionsSettlementsExample
    {
        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 OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (Obtained by listing underlying endpoint)
            var contract = "BTC_USDT-20210916-5000-C";  // string | Options contract name (optional) 
            var limit = 100;  // int? | Maximum number of records returned in a single list (optional)  (default to 100)
            var offset = 0;  // int? | List offset, starting from 0 (optional)  (default to 0)
            var from = 1547706332;  // long? | Start timestamp  Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) 
            var to = 1547706332;  // long? | Termination Timestamp  Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) 

            try
            {
                // Query personal settlement records
                List<OptionsMySettlements> result = apiInstance.ListMyOptionsSettlements(underlying, contract, limit, offset, from, to);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListMyOptionsSettlements: " + 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
underlying string Underlying (Obtained by listing underlying endpoint)
contract string Options contract name [optional]
limit int? Maximum number of records returned in a single list [optional] [default to 100]
offset int? List offset, starting from 0 [optional] [default to 0]
from long? Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) [optional]
to long? Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp [optional]

Return type

List<OptionsMySettlements>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

ListOptionsOrderBook

FuturesOrderBook ListOptionsOrderBook (string contract, string interval = null, int? limit = null, bool? withId = null)

Query options contract order book

Bids will be sorted by price from high to low, while asks sorted reversely

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 ListOptionsOrderBookExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var contract = "BTC_USDT-20210916-5000-C";  // string | Options contract name
            var interval = "0";  // string | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional)  (default to 0)
            var limit = 10;  // int? | Number of depth levels (optional)  (default to 10)
            var withId = false;  // bool? | Whether to return depth update ID. This ID increments by 1 each time depth changes (optional)  (default to false)

            try
            {
                // Query options contract order book
                FuturesOrderBook result = apiInstance.ListOptionsOrderBook(contract, interval, limit, withId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsOrderBook: " + 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
contract string Options contract name
interval string Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified [optional] [default to 0]
limit int? Number of depth levels [optional] [default to 10]
withId bool? Whether to return depth update ID. This ID increments by 1 each time depth changes [optional] [default to false]

Return type

FuturesOrderBook

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Depth query successful -

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

ListOptionsTickers

List<OptionsTicker> ListOptionsTickers (string underlying)

Query options market ticker information

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 ListOptionsTickersExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (Obtained by listing underlying endpoint)

            try
            {
                // Query options market ticker information
                List<OptionsTicker> result = apiInstance.ListOptionsTickers(underlying);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsTickers: " + 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
underlying string Underlying (Obtained by listing underlying endpoint)

Return type

List<OptionsTicker>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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

ListOptionsUnderlyingTickers

OptionsUnderlyingTicker ListOptionsUnderlyingTickers (string underlying)

Query underlying ticker information

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 ListOptionsUnderlyingTickersExample
    {
        public static void Main()
        {
            Configuration config = new Config
17C7
uration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying

            try
            {
                // Query underlying ticker information
                OptionsUnderlyingTicker result = apiInstance.ListOptionsUnderlyingTickers(underlying);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsUnderlyingTickers: " + 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
underlying string Underlying

Return type

OptionsUnderlyingTicker

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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

ListOptionsCandlesticks

List<OptionsCandlestick> ListOptionsCandlesticks (string contract, int? limit = null, long? from = null, long? to = null, string interval = null)

Options contract market candlestick chart

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 ListOptionsCandlesticksExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var contract = "BTC_USDT-20210916-5000-C";  // string | Options contract name
            var limit = 100;  // int? | Maximum number of records returned in a single list (optional)  (default to 100)
            var from = 1547706332;  // long? | Start timestamp  Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) 
            var to = 1547706332;  // long? | Termination Timestamp  Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) 
            var interval = "5m";  // string | Time interval between data points (optional)  (default to 5m)

            try
            {
                // Options contract market candlestick chart
                List<OptionsCandlestick> result = apiInstance.ListOptionsCandlesticks(contract, limit, from, to, interval);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsCandlesticks: " + 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
contract string Options contract name
limit int? Maximum number of records returned in a single list [optional] [default to 100]
from long? Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) [optional]
to long? Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp [optional]
interval string Time interval between data points [optional] [default to 5m]

Return type

List<OptionsCandlestick>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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

ListOptionsUnderlyingCandlesticks

List<FuturesCandlestick> ListOptionsUnderlyingCandlesticks (string underlying, int? limit = null, long? from = null, long? to = null, string interval = null)

Underlying index price candlestick chart

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 ListOptionsUnderlyingCandlesticksExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (Obtained by listing underlying endpoint)
            var limit = 100;  // int? | Maximum number of records returned in a single list (optional)  (default to 100)
            var from = 1547706332;  // long? | Start timestamp  Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) 
            var to = 1547706332;  // long? | Termination Timestamp  Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) 
            var interval = "5m";  // string | Time interval between data points (optional)  (default to 5m)

            try
            {
                // Underlying index price candlestick chart
                List<FuturesCandlestick> result = apiInstance.ListOptionsUnderlyingCandlesticks(underlying, limit, from, to, interval);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsUnderlyingCandlesticks: " + 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
underlying string Underlying (Obtained by listing underlying endpoint)
limit int? Maximum number of records returned in a single list [optional] [default to 100]
from long? Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) [optional]
to long? Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp [optional]
interval string Time interval between data points [optional] [default to 5m]

Return type

List<FuturesCandlestick>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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

ListOptionsTrades

List<FuturesTrade> ListOptionsTrades (string contract = null, string type = null, int? limit = null, int? offset = null, long? from = null, long? to = null)

Market trade records

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 ListOptionsTradesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.gateio.ws/api/v4";
            var apiInstance = new OptionsApi(config);
            var contract = "BTC_USDT-20210916-5000-C";  // string | Options contract name (optional) 
            var type = "1546935600";  // string | `C` for call, `P` for put (optional) 
            var limit = 100;  // int? | Maximum number of records returned in a single list (optional)  (default to 100)
            var offset = 0;  // int? | List offset, starting from 0 (optional)  (default to 0)
            var from = 1547706332;  // long? | Start timestamp  Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) 
            var to = 1547706332;  // long? | Termination Timestamp  Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) 

            try
            {
                // Market trade records
                List<FuturesTrade> result = apiInstance.ListOptionsTrades(contract, type, limit, offset, from, to);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsTrades: " + 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
contract string Options contract name [optional]
type string `C` for call, `P` for put [optional]
limit int? Maximum number of records returned in a single list [optional] [default to 100]
offset int? List offset, starting from 0 [optional] [default to 0]
from long? Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) [optional]
to long? Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp [optional]

Return type

List<FuturesTrade>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

ListOptionsAccount

OptionsAccount ListOptionsAccount ()

Query account information

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 ListOptionsAccountExample
    {
        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 OptionsApi(config);

            try
            {
                // Query account information
                OptionsAccount result = apiInstance.ListOptionsAccount();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsAccount: " + e.Message);
                Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

OptionsAccount

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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

ListOptionsAccountBook

List<OptionsAccountBook> ListOptionsAccountBook (int? limit = null, int? offset = null, long? from = null, long? to = null, string type = null)

Query account change history

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 ListOptionsAccountBookExample
    {
        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 OptionsApi(config);
            var limit = 100;  // int? | Maximum number of records returned in a single list (optional)  (default to 100)
            var offset = 0;  // int? | List offset, starting from 0 (optional)  (default to 0)
            var from = 1547706332;  // long? | Start timestamp  Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) 
            var to = 1547706332;  // long? | Termination Timestamp  Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) 
            var type = "dnw";  // string | Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L (optional) 

            try
            {
                // Query account change history
                List<OptionsAccountBook> result = apiInstance.ListOptionsAccountBook(limit, offset, from, to, type);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsAccountBook: " + 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
limit int? Maximum number of records returned in a single list [optional] [default to 100]
offset int? List offset, starting from 0 [optional] [default to 0]
from long? Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) [optional]
to long? Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp [optional]
type string Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L [optional]

Return type

List<OptionsAccountBook>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

ListOptionsPositions

List<OptionsPosition> ListOptionsPositions (string underlying = null)

List user's positions of specified underlying

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 ListOptionsPositionsExample
    {
        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 OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (optional) 

            try
            {
                // List user's positions of specified underlying
                List<OptionsPosition> result = apiInstance.ListOptionsPositions(underlying);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsPositions: " + 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
underlying string Underlying [optional]

Return type

List<OptionsPosition>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

GetOptionsPosition

OptionsPosition GetOptionsPosition (string contract)

Get specified contract position

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 GetOptionsPositionExample
    {
        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 OptionsApi(config);
            var contract = "BTC_USDT-20211130-65000-C";  // string | 

            try
            {
                // Get specified contract position
                OptionsPosition result = apiInstance.GetOptionsPosition(contract);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.GetOptionsPosition: " + 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
contract string

Return type

OptionsPosition

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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

ListOptionsPositionClose

List<OptionsPositionClose> ListOptionsPositionClose (string underlying, string contract = null)

List user's liquidation history of specified underlying

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 ListOptionsPositionCloseExample
    {
        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 OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (Obtained by listing underlying endpoint)
            var contract = "BTC_USDT-20210916-5000-C";  // string | Options contract name (optional) 

            try
            {
                // List user's liquidation history of specified underlying
                List<OptionsPositionClose> result = apiInstance.ListOptionsPositionClose(underlying, contract);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsPositionClose: " + 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
underlying string Underlying (Obtained by listing underlying endpoint)
contract string Options contract name [optional]

Return type

List<OptionsPositionClose>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

ListOptionsOrders

List<OptionsOrder> ListOptionsOrders (string status, string contract = null, string underlying = null, int? limit = null, int? offset = null, long? from = null, long? to = null)

List options orders

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 ListOptionsOrdersExample
    {
        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 OptionsApi(config);
            var status = "open";  // string | Query order list based on status
            var contract = "BTC_USDT-20210916-5000-C";  // string | Options contract name (optional) 
            var underlying = "BTC_USDT";  // string | Underlying (optional) 
            var limit = 100;  // int? | Maximum number of records returned in a single list (optional)  (default to 100)
            var offset = 0;  // int? | List offset, starting from 0 (optional)  (default to 0)
            var from = 1547706332;  // long? | Start timestamp  Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) 
            var to = 1547706332;  // long? | Termination Timestamp  Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) 

            try
            {
                // List options orders
                List<OptionsOrder> result = apiInstance.ListOptionsOrders(status, contract, underlying, limit, offset, from, to);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListOptionsOrders: " + 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
status string Query order list based on status
contract string Options contract name [optional]
underlying string Underlying [optional]
limit int? Maximum number of records returned in a single list [optional] [default to 100]
offset int? List offset, starting from 0 [optional] [default to 0]
from long? Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) [optional]
to long? Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp [optional]

Return type

List<OptionsOrder>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

CreateOptionsOrder

OptionsOrder CreateOptionsOrder (OptionsOrder optionsOrder)

Create an options order

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 CreateOptionsOrderExample
    {
        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 OptionsApi(config);
            var optionsOrder = new OptionsOrder(); // OptionsOrder | 

            try
            {
                // Create an options order
                OptionsOrder result = apiInstance.CreateOptionsOrder(optionsOrder);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.CreateOptionsOrder: " + 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
optionsOrder OptionsOrder

Return type

OptionsOrder

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • < 73D9 li>Accept: application/json

HTTP response details

Status code Description Response headers
201 Order detail -

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

CancelOptionsOrders

List<OptionsOrder> CancelOptionsOrders (string contract = null, string underlying = null, string side = null)

Cancel all orders with 'open' status

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 CancelOptionsOrdersExample
    {
        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 OptionsApi(config);
            var contract = "BTC_USDT-20210916-5000-C";  // string | Options contract name (optional) 
            var underlying = "BTC_USDT";  // string | Underlying (optional) 
            var side = "ask";  // string | Specify all bids or all asks, both included if not specified (optional) 

            try
            {
                // Cancel all orders with 'open' status
                List<OptionsOrder> result = apiInstance.CancelOptionsOrders(contract, underlying, side);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.CancelOptionsOrders: " + 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
contract string Options contract name [optional]
underlying string Underlying [optional]
side string Specify all bids or all asks, both included if not specified [optional]

Return type

List<OptionsOrder>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Batch cancellation successful -

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

GetOptionsOrder

OptionsOrder GetOptionsOrder (long orderId)

Query single order details

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 GetOptionsOrderExample
    {
        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 OptionsApi(config);
            var orderId = 12345;  // long | Order ID returned when order is successfully created

            try
            {
                // Query single order details
                OptionsOrder result = apiInstance.GetOptionsOrder(orderId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.GetOptionsOrder: " + 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
orderId long Order ID returned when order is successfully created

Return type

OptionsOrder

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Order detail -

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

CancelOptionsOrder

OptionsOrder CancelOptionsOrder (long orderId)

Cancel single order

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 CancelOptionsOrderExample
    {
        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 OptionsApi(config);
            var orderId = 12345;  // long | Order ID returned when order is successfully created

            try
            {
                // Cancel single order
                OptionsOrder result = apiInstance.CancelOptionsOrder(orderId);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.CancelOptionsOrder: " + 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
orderId long Order ID returned when order is successfully created

Return type

OptionsOrder

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Order detail -

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

CountdownCancelAllOptions

TriggerTime CountdownCancelAllOptions (CountdownCancelAllOptionsTask countdownCancelAllOptionsTask)

Countdown cancel orders

Option order heartbeat detection, when the timeout time set by the user is reached, if the existing countdown is not canceled or a new countdown is set, the related option pending order will be automatically canceled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at intervals of 30 seconds, with each countdown timeout set to 30 (seconds). If this interface is not called again within 30 seconds, all pending orders on the underlying contract you specified will be automatically cancelled. If underlying contract is not specified, user will be automatically cancelled If timeout is set to 0 within 30 seconds, the countdown timer will expire and the automatic order cancellation function will be cancelled.

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 CountdownCancelAllOptionsExample
    {
        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 OptionsApi(config);
            var countdownCancelAllOptionsTask = new CountdownCancelAllOptionsTask(); // CountdownCancelAllOptionsTask | 

            try
            {
                // Countdown cancel orders
                TriggerTime result = apiInstance.CountdownCancelAllOptions(countdownCancelAllOptionsTask);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.CountdownCancelAllOptions: " + 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
countdownCancelAllOptionsTask CountdownCancelAllOptionsTask

Return type

TriggerTime

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Countdown set successfully -

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

ListMyOptionsTrades

List<OptionsMyTrade> ListMyOptionsTrades (string underlying, string contract = null, int? limit = null, int? offset = null, long? from = null, long? to = null)

Query personal trading records

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 ListMyOptionsTradesExample
    {
        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 OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (Obtained by listing underlying endpoint)
            var contract = "BTC_USDT-20210916-5000-C";  // string | Options contract name (optional) 
            var limit = 100;  // int? | Maximum number of records returned in a single list (optional)  (default to 100)
            var offset = 0;  // int? | List offset, starting from 0 (optional)  (default to 0)
            var from = 1547706332;  // long? | Start timestamp  Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional) 
            var to = 1547706332;  // long? | Termination Timestamp  Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional) 

            try
            {
                // Query personal trading records
                List<OptionsMyTrade> result = apiInstance.ListMyOptionsTrades(underlying, contract, limit, offset, from, to);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ListMyOptionsTrades: " + 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
underlying string Underlying (Obtained by listing underlying endpoint)
contract string Options contract name [optional]
limit int? Maximum number of records returned in a single list [optional] [default to 100]
offset int? List offset, starting from 0 [optional] [default to 0]
from long? Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) [optional]
to long? Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp [optional]

Return type

List<OptionsMyTrade>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved successfully -

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

GetOptionsMMP

List<OptionsMMP> GetOptionsMMP (string underlying = null)

MMP Query.

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 GetOptionsMMPExample
    {
        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 OptionsApi(config);
            var underlying = "BTC_USDT";  // string | Underlying (optional) 

            try
            {
                // MMP Query.
                List<OptionsMMP> result = apiInstance.GetOptionsMMP(underlying);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.GetOptionsMMP: " + 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
underlying string Underlying [optional]

Return type

List<OptionsMMP>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Query successful -

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

SetOptionsMMP

OptionsMMP SetOptionsMMP (OptionsMMP optionsMMP)

MMP Settings

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 SetOptionsMMPExample
    {
        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 OptionsApi(config);
            var optionsMMP = new OptionsMMP(); // OptionsMMP | 

            try
            {
                // MMP Settings
                OptionsMMP result = apiInstance.SetOptionsMMP(optionsMMP);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.SetOptionsMMP: " + 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
optionsMMP OptionsMMP

Return type

OptionsMMP

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 MMP Information -

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

ResetOptionsMMP

OptionsMMP ResetOptionsMMP (OptionsMMPReset optionsMMPReset)

MMP Reset

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 ResetOptionsMMPExample
    {
        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 OptionsApi(config);
            var optionsMMPReset = new OptionsMMPReset(); // OptionsMMPReset | 

            try
            {
                // MMP Reset
                OptionsMMP result = apiInstance.ResetOptionsMMP(optionsMMPReset);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling OptionsApi.ResetOptionsMMP: " + 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
optionsMMPReset OptionsMMPReset

Return type

OptionsMMP

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 MMP Information -

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

0