All URIs are relative to https://localhost/api/v1
Method | HTTP request | Description |
---|---|---|
PositionGet | GET /position | Get your positions. |
PositionIsolateMargin | POST /position/isolate | Enable isolated margin or cross margin per-position. |
PositionTransferIsolatedMargin | POST /position/transferMargin | Transfer equity in or out of a position. |
PositionUpdateLeverage | POST /position/leverage | Choose leverage for a position. |
PositionUpdateRiskLimit | POST /position/riskLimit | Update your risk limit. |
List PositionGet (string filter = null, string columns = null, decimal? count = null)
Get your positions.
See <a href="http://www.onixs.biz/fix-dictionary/5.0.SP2/msgType_AP_6580.html\">the FIX Spec for explanations of these fields.
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class PositionGetExample
{
public void main()
{
var apiInstance = new PositionApi();
var filter = filter_example; // string | Table filter. For example, send {\"symbol\": \"XBT24H\"}. (optional)
var columns = columns_example; // string | Which columns to fetch. For example, send [\"columnName\"]. (optional)
var count = 3.4; // decimal? | Number of rows to fetch. (optional)
try
{
// Get your positions.
List<Position> result = apiInstance.PositionGet(filter, columns, count);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PositionApi.PositionGet: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
filter | string | Table filter. For example, send {"symbol": "XBT24H"}. | [optional] |
columns | string | Which columns to fetch. For example, send ["columnName"]. | [optional] |
count | decimal? | Number of rows to fetch. | [optional] |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position PositionIsolateMargin (string symbol, bool? enabled = null)
Enable isolated margin or cross margin per-position.
On Speculative (DPE-Enabled) contracts, users can switch isolate margin per-position. This function allows switching margin isolation (aka fixed margin) on and off.
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class PositionIsolateMarginExample
{
public void main()
{
var apiInstance = new PositionApi();
var symbol = symbol_example; // string | Position symbol to isolate.
var enabled = true; // bool? | True for isolated margin, false for cross margin. (optional) (default to true)
try
{
// Enable isolated margin or cross margin per-position.
Position result = apiInstance.PositionIsolateMargin(symbol, enabled);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PositionApi.PositionIsolateMargin: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | string | Position symbol to isolate. | |
enabled | bool? | True for isolated margin, false for cross margin. | [optional] [default to true] |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position PositionTransferIsolatedMargin (string symbol, decimal? amount)
Transfer equity in or out of a position.
When margin is isolated on a position, use this function to add or remove margin from the position. Note that you cannot remove margin below the initial margin threshold.
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class PositionTransferIsolatedMarginExample
{
public void main()
{
var apiInstance = new PositionApi();
var symbol = symbol_example; // string | Symbol of position to isolate.
var amount = 3.4; // decimal? | Amount to transfer, in Satoshis. May be negative.
try
{
// Transfer equity in or out of a position.
Position result = apiInstance.PositionTransferIsolatedMargin(symbol, amount);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PositionApi.PositionTransferIsolatedMargin: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | string | Symbol of position to isolate. | |
amount | decimal? | Amount to transfer, in Satoshis. May be negative. |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position PositionUpdateLeverage (string symbol, double? leverage)
Choose leverage for a position.
On Speculative (DPE-Enabled) contracts, users can choose an isolated leverage. This will automatically enable isolated margin.
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class PositionUpdateLeverageExample
{
public void main()
{
var apiInstance = new PositionApi();
var symbol = symbol_example; // string | Symbol of position to adjust.
var leverage = 1.2; // double? | Leverage value. Send a number between 0.01 and 100 to enable isolated margin with a fixed leverage. Send 0 to enable cross margin.
try
{
// Choose leverage for a position.
Position result = apiInstance.PositionUpdateLeverage(symbol, leverage);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PositionApi.PositionUpdateLeverage: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | string | Symbol of position to adjust. | |
leverage | double? | Leverage value. Send a number between 0.01 and 100 to enable isolated margin with a fixed leverage. Send 0 to enable cross margin. |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position PositionUpdateRiskLimit (string symbol, decimal? riskLimit)
Update your risk limit.
Risk Limits limit the size of positions you can trade at various margin levels. Larger positions require more margin. Please see the Risk Limit documentation for more details.
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class PositionUpdateRiskLimitExample
{
public void main()
{
var apiInstance = new PositionApi();
var symbol = symbol_example; // string | Symbol of position to isolate.
var riskLimit = 3.4; // decimal? | New Risk Limit, in Satoshis.
try
{
// Update your risk limit.
Position result = apiInstance.PositionUpdateRiskLimit(symbol, riskLimit);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PositionApi.PositionUpdateRiskLimit: " + e.Message );
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | string | Symbol of position to isolate. | |
riskLimit | decimal? | New Risk Limit, in Satoshis. |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Back to top] [Back to API list] [Back to Model list] [Back to README]