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 |
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
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Dictionary<string, bool> ListUnifiedAccountMode ()
Inquire about unified account mode (deprecated)
cross_margin - Spot full-margin trading, usdt_futures - USDT perpetual futures
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);
}
}
}
}
This endpoint does not need any parameter.
Dictionary<string, bool>
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Dictionary<string, bool> SetUnifiedAccountMode (UnifiedMode unifiedMode)
Set unified account mode (deprecated)
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
unifiedMode | UnifiedMode |
Dictionary<string, bool>
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UnifiedBorrowable GetUnifiedBorrowable (string currency)
Query about the maximum borrowing for the unified account
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UnifiedTransferable GetUnifiedTransferable (string currency)
Query about the maximum transferable for the unified account
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
currency | string | Retrieve data of the specified currency |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<UniLoan> ListUnifiedLoans (string currency = null, int? page = null, int? limit = null, string type = null)
List loans
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);
}
}
}
}
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] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
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
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
unifiedLoan | UnifiedLoan |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Operated successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<UnifiedLoanRecord> ListUnifiedLoanRecords (string type = null, string currency = null, int? page = null, int? limit = null)
Get load records
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);
}
}
}
}
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] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<UniLoanInterestRecord> ListUnifiedLoanInterestRecords (string currency = null, int? page = null, int? limit = null, string type = null)
List interest records
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);
}
}
}
}
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] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UnifiedRiskUnits GetUnifiedRiskUnits ()
Retrieve user risk unit details, only valid in portfolio margin mode
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);
}
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
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
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);
}
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
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 } }
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
unifiedModeSet | UnifiedModeSet |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Success | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
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.
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);
}
}
}
}
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. |
Dictionary<string, string>
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<UnifiedDiscount> ListCurrencyDiscountTiers ()
list currency discount tiers
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);
}
}
}
}
This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UnifiedPortfolioOutput CalculatePortfolioMargin (UnifiedPortfolioInput unifiedPortfolioInput)
portfolio margin calculator
组合保证金计算器 当输入为模拟仓位组合时,每个仓位包括仓位名和持有量,只支持市场范围:BTC、ETH的永续合约、期权、现货 当输入为模拟挂单时,每个挂单包括市场标识、挂单价、挂单量,只支持市场范围:BTC、ETH的永续合约、期权、现货。挂单不包括市价单
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);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
unifiedPortfolioInput | UnifiedPortfolioInput |
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]