Skip to content

Latest commit

 

History

History
206 lines (154 loc) · 7.38 KB

FundingApi.md

File metadata and controls

206 lines (154 loc) · 7.38 KB

FundingApi

All URIs are relative to https://api-testnet.bybit.com

Method HTTP request Description
fundingGetRate GET /open-api/funding/prev-funding Funding settlement occurs every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC. The current interval's fund fee settlement is based on the previous interval's fund rate. For example, at 16:00, the settlement is based on the fund rate generated at 8:00. The fund rate generated at 16:00 will be used at 0:00 on the next day.
fundingPredicted GET /open-api/funding/predicted-funding Get predicted funding rate and funding fee.
fundingPredictedRate GET /open-api/funding/prev-funding-rate Get predicted funding rate and funding fee.

fundingGetRate

Object fundingGetRate(symbol)

Funding settlement occurs every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC. The current interval's fund fee settlement is based on the previous interval's fund rate. For example, at 16:00, the settlement is based on the fund rate generated at 8:00. The fund rate generated at 16:00 will be used at 0:00 on the next day.

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.FundingApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apiKey
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: apiSignature
ApiKeyAuth apiSignature = (ApiKeyAuth) defaultClient.getAuthentication("apiSignature");
apiSignature.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.setApiKeyPrefix("Token");

// Configure API key authorization: timestamp
ApiKeyAuth timestamp = (ApiKeyAuth) defaultClient.getAuthentication("timestamp");
timestamp.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.setApiKeyPrefix("Token");

FundingApi apiInstance = new FundingApi();
String symbol = "symbol_example"; // String | Contract type.
try {
    Object result = apiInstance.fundingGetRate(symbol);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling FundingApi#fundingGetRate");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
symbol String Contract type.

Return type

Object

Authorization

apiKey, apiSignature, timestamp

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

fundingPredicted

Object fundingPredicted(symbol)

Get predicted funding rate and funding fee.

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.FundingApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apiKey
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: apiSignature
ApiKeyAuth apiSignature = (ApiKeyAuth) defaultClient.getAuthentication("apiSignature");
apiSignature.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.setApiKeyPrefix("Token");

// Configure API key authorization: timestamp
ApiKeyAuth timestamp = (ApiKeyAuth) defaultClient.getAuthentication("timestamp");
timestamp.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.setApiKeyPrefix("Token");

FundingApi apiInstance = new FundingApi();
String symbol = "symbol_example"; // String | Contract type.
try {
    Object result = apiInstance.fundingPredicted(symbol);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling FundingApi#fundingPredicted");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
symbol String Contract type.

Return type

Object

Authorization

apiKey, apiSignature, timestamp

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json

fundingPredictedRate

Object fundingPredictedRate(symbol)

Get predicted funding rate and funding fee.

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.FundingApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apiKey
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: apiSignature
ApiKeyAuth apiSignature = (ApiKeyAuth) defaultClient.getAuthentication("apiSignature");
apiSignature.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.setApiKeyPrefix("Token");

// Configure API key authorization: timestamp
ApiKeyAuth timestamp = (ApiKeyAuth) defaultClient.getAuthentication("timestamp");
timestamp.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//timestamp.setApiKeyPrefix("Token");

FundingApi apiInstance = new FundingApi();
String symbol = "symbol_example"; // String | Contract type.
try {
    Object result = apiInstance.fundingPredictedRate(symbol);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling FundingApi#fundingPredictedRate");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
symbol String Contract type.

Return type

Object

Authorization

apiKey, apiSignature, timestamp

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json