[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
1098 lines (853 loc) · 37 KB

UnifiedApi.md

File metadata and controls

1098 lines (853 loc) · 37 KB

Io.Gate.GateApi.Api.UnifiedApi

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

Method HTTP request Description
ListUnifiedAccounts GET /unified/accounts Get unified account information
ListUnifiedAccountMode GET /unified/account_mode Inquire about unified account mode (deprecated)
SetUnifiedAccountMode POST /unified/account_mode Set unified account mode (deprecated)
GetUnifiedBorrowable GET /unified/borrowable Query about the maximum borrowing for the unified account
GetUnifiedTransferable GET /unified/transferable Query about the maximum transferable for the unified account
ListUnifiedLoans GET /unified/loans List loans
CreateUnifiedLoan POST /unified/loans Borrow or repay
ListUnifiedLoanRecords GET /unified/loan_records Get load records
ListUnifiedLoanInterestRecords GET /unified/interest_records List interest records
GetUnifiedRiskUnits GET /unified/risk_units Retrieve user risk unit details, only valid in portfolio margin mode
GetUnifiedMode GET /unified/unified_mode Query mode of the unified account
SetUnifiedMode PUT /unified/unified_mode Set mode of the unified account
GetUnifiedEstimateRate GET /unified/estimate_rate Get unified estimate rate
ListCurrencyDiscountTiers GET /unified/currency_discount_tiers list currency discount tiers
CalculatePortfolioMargin POST /unified/portfolio_calculator portfolio margin calculator

ListUnifiedAccounts

UnifiedAccount ListUnifiedAccounts (string currency = null)

Get unified account information

The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account. You can refer to the Formula in the documentation

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 ListUnifiedAccountsExample
    {
        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 UnifiedApi(config);
            var currency = "BTC";  // string | Retrieve data of the specified currency (optional) 

            try
            {
                // Get unified account information
                UnifiedAccount result = apiInstance.ListUnifiedAccounts(currency);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.ListUnifiedAccounts: " + 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
currency string Retrieve data of the specified currency [optional]

Return type

UnifiedAccount

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List retrieved -

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

ListUnifiedAccountMode

Dictionary<string, bool> ListUnifiedAccountMode ()

Inquire about unified account mode (deprecated)

cross_margin - Spot full-margin trading, usdt_futures - USDT perpetual futures

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 ListUnifiedAccountModeExample
    {
        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 UnifiedApi(config);

            try
            {
                // Inquire about unified account mode (deprecated)
                Dictionary<string, bool> result = apiInstance.ListUnifiedAccountMode();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.ListUnifiedAccountMode: " + 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

Dictionary<string, bool>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

SetUnifiedAccountMode

Dictionary<string, bool> SetUnifiedAccountMode (UnifiedMode unifiedMode)

Set unified account mode (deprecated)

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 SetUnifiedAccountModeExample
    {
        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 UnifiedApi(config);
            var unifiedMode = new UnifiedMode(); // UnifiedMode | 

            try
            {
                // Set unified account mode (deprecated)
                Dictionary<string, bool> result = apiInstance.SetUnifiedAccountMode(unifiedMode);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.SetUnifiedAccountMode: " + 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
unifiedMode UnifiedMode

Return type

Dictionary<string, bool>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -

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

GetUnifiedBorrowable

UnifiedBorrowable GetUnifiedBorrowable (string currency)

Query about the maximum borrowing for the unified account

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 GetUnifiedBorrowableExample
    {
        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 UnifiedApi(config);
            var currency = "BTC";  // string | Retrieve data of the specified currency

            try
            {
                // Query about the maximum borrowing for the unified account
                UnifiedBorrowable result = apiInstance.GetUnifiedBorrowable(currency);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.GetUnifiedBorrowable: " + 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
currency string Retrieve data of the specified currency

Return type

UnifiedBorrowable

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

GetUnifiedTransferable

UnifiedTransferable GetUnifiedTransferable (string currency)

Query about the maximum transferable for the unified account

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 GetUnifiedTransferableExample
    {
        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 UnifiedApi(config);
            var currency = "BTC";  // string | Retrieve data of the specified currency

            try
            {
                // Query about the maximum transferable for the unified account
                UnifiedTransferable result = apiInstance.GetUnifiedTransferable(currency);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.GetUnifiedTransferable: " + 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
currency string Retrieve data of the specified currency

Return type

UnifiedTransferable

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

ListUnifiedLoans

List<UniLoan> ListUnifiedLoans (string currency = null, int? page = null, int? limit = null, string type = null)

List loans

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 ListUnifiedLoansExample
    {
        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 UnifiedApi(config);
            var currency = "BTC";  // string | Retrieve data of the specified currency (optional) 
            var page = 1;  // int? | Page number (optional)  (default to 1)
            var limit = 100;  // int? | Maximum response items.  Default: 100, minimum: 1, Maximum: 100 (optional)  (default to 100)
            var type = "platform";  // string | Loan type, platform - platform, margin - margin (optional) 

            try
            {
                // List loans
                List<UniLoan> result = apiInstance.ListUnifiedLoans(currency, page, limit, type);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.ListUnifiedLoans: " + 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
currency string Retrieve data of the specified currency [optional]
page int? Page number [optional] [default to 1]
limit int? Maximum response items. Default: 100, minimum: 1, Maximum: 100 [optional] [default to 100]
type string Loan type, platform - platform, margin - margin [optional]

Return type

List<UniLoan>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

CreateUnifiedLoan

void CreateUnifiedLoan (UnifiedLoan unifiedLoan)

Borrow or repay

When borrowing, it is essential to ensure that the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter repaid_all=true

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 CreateUnifiedLoanExample
    {
        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 UnifiedApi(config);
            var unifiedLoan = new UnifiedLoan(); // UnifiedLoan | 

            try
            {
                // Borrow or repay
                apiInstance.CreateUnifiedLoan(unifiedLoan);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.CreateUnifiedLoan: " + 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
unifiedLoan UnifiedLoan

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Operated successfully -

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

ListUnifiedLoanRecords

List<UnifiedLoanRecord> ListUnifiedLoanRecords (string type = null, string currency = null, int? page = null, int? limit = null)

Get load 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 ListUnifiedLoanRecordsExample
    {
        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 UnifiedApi(config);
            var type = "type_example";  // string | The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds (optional) 
            var currency = "BTC";  // string | Retrieve data of the specified currency (optional) 
            var page = 1;  // int? | Page number (optional)  (default to 1)
            var limit = 100;  // int? | Maximum response items.  Default: 100, minimum: 1, Maximum: 100 (optional)  (default to 100)

            try
            {
                // Get load records
                List<UnifiedLoanRecord> result = apiInstance.ListUnifiedLoanRecords(type, currency, page, limit);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.ListUnifiedLoanRecords: " + 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
type string The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds [optional]
currency string Retrieve data of the specified currency [optional]
page int? Page number [optional] [default to 1]
limit int? Maximum response items. Default: 100, minimum: 1, Maximum: 100 [optional] [default to 100]

Return type

List<UnifiedLoanRecord>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

ListUnifiedLoanInterestRecords

List<UniLoanInterestRecord> ListUnifiedLoanInterestRecords (string currency = null, int? page = null, int? limit = null, string type = null)

List interest 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 ListUnifiedLoanInterestRecordsExample
    {
        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 UnifiedApi(config);
            var currency = "BTC";  // string | Retrieve data of the specified currency (optional) 
            var page = 1;  // int? | Page number (optional)  (default to 1)
            var limit = 100;  // int? | Maximum response items.  Default: 100, minimum: 1, Maximum: 100 (optional)  (default to 100)
            var type = "platform";  // string | Loan type, platform - platform, margin - margin (optional) 

            try
            {
                // List interest records
                List<UniLoanInterestRecord> result = apiInstance.ListUnifiedLoanInterestRecords(currency, page, limit, type);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.ListUnifiedLoanInterestRecords: " + 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
currency string Retrieve data of the specified currency [optional]
page int? Page number [optional] [default to 1]
limit int? Maximum response items. Default: 100, minimum: 1, Maximum: 100 [optional] [default to 100]
type string Loan type, platform - platform, margin - margin [optional]

Return type

List<UniLoanInterestRecord>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

GetUnifiedRiskUnits

UnifiedRiskUnits GetUnifiedRiskUnits ()

Retrieve user risk unit details, only valid in portfolio margin mode

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 GetUnifiedRiskUnitsExample
    {
        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 UnifiedApi(config);

            try
            {
                // Retrieve user risk unit details, only valid in portfolio margin mode
                UnifiedRiskUnits result = apiInstance.GetUnifiedRiskUnits();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.GetUnifiedRiskUnits: " + 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

UnifiedRiskUnits

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

GetUnifiedMode

UnifiedModeSet GetUnifiedMode ()

Query mode of the unified account

Unified account mode: - classic: Classic account mode - multi_currency: Multi-currency margin mode - portfolio: Portfolio margin mode

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 GetUnifiedModeExample
    {
        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 UnifiedApi(config);

            try
            {
                // Query mode of the unified account
                UnifiedModeSet result = apiInstance.GetUnifiedMode();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.GetUnifiedMode: " + 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

UnifiedModeSet

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

SetUnifiedMode

void SetUnifiedMode (UnifiedModeSet unifiedModeSet)

Set mode of the unified account

Switching between different account modes requires only passing the parameters n\corresponding to the target account mode. It also supports opening or closing configuration switches for the corresponding account mode when switching- When enabling classic account mode,mode=classic PUT /unified/unified_mode { \"mode\": \"classic\" } - When enabling multi-currency margin mode, mode=multi_currency PUT /unified/unified_mode { \"mode\": \"multi_currency\", \"settings\": { \"usdt_futures\": true } } - When enabling portfolio margin mode,mode=portfolio PUT /unified/unified_mode { \"mode\": \"portfolio\", \"settings\": { \"spot_hedge\": true } }

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 SetUnifiedModeExample
    {
        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 UnifiedApi(config);
            var unifiedModeSet = new UnifiedModeSet(); // UnifiedModeSet | 

            try
            {
                // Set mode of the unified account
                apiInstance.SetUnifiedMode(unifiedModeSet);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.SetUnifiedMode: " + 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
unifiedModeSet UnifiedModeSet

Return type

void (empty response body)

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Success -

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

GetUnifiedEstimateRate

Dictionary<string, string> GetUnifiedEstimateRate (List currencies)

Get unified estimate rate

Due to fluctuations in lending depth, hourly interest rates may vary, and thus, I cannot provide exact rates. When a currency is not supported, the interest rate returned will be an empty string.

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 GetUnifiedEstimateRateExample
    {
        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 UnifiedApi(config);
            var currencies = new List<string>(); // List<string> | Specify the currency names for querying in an array, separated by commas, with a maximum of 10 currencies.

            try
            {
                // Get unified estimate rate
                Dictionary<string, string> result = apiInstance.GetUnifiedEstimateRate(currencies);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.GetUnifiedEstimateRate: " + 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
currencies List<string> Specify the currency names for querying in an array, separated by commas, with a maximum of 10 currencies.

Return type

Dictionary<string, string>

Authorization

apiv4

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

ListCurrencyDiscountTiers

List<UnifiedDiscount> ListCurrencyDiscountTiers ()

list currency discount tiers

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

            try
            {
                // list currency discount tiers
                List<UnifiedDiscount> result = apiInstance.ListCurrencyDiscountTiers();
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.ListCurrencyDiscountTiers: " + 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<UnifiedDiscount>

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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

CalculatePortfolioMargin

UnifiedPortfolioOutput CalculatePortfolioMargin (UnifiedPortfolioInput unifiedPortfolioInput)

portfolio margin calculator

组合保证金计算器 当输入为模拟仓位组合时,每个仓位包括仓位名和持有量,只支持市场范围:BTC、ETH的永续合约、期权、现货 当输入为模拟挂单时,每个挂单包括市场标识、挂单价、挂单量,只支持市场范围:BTC、ETH的永续合约、期权、现货。挂单不包括市价单

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

            try
            {
                // portfolio margin calculator
                UnifiedPortfolioOutput result = apiInstance.CalculatePortfolioMargin(unifiedPortfolioInput);
                Debug.WriteLine(result);
            }
            catch (GateApiException e)
            {
                Debug.Print("Exception when calling UnifiedApi.CalculatePortfolioMargin: " + 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
unifiedPortfolioInput UnifiedPortfolioInput

Return type

UnifiedPortfolioOutput

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successfully retrieved -

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