Links

11. Get Funding Fee Rate of an Option Transaction

Description

Get funding fee rate of an option transaction .
TBD: Narratives

Function Description

Item
Description
Contract Address
Underlying asset contract (referenced by Smart Contract Overview section)
Contract Name
UnderlyingAsset.sol
Function
function getFundingFeeRate(ContractType _contractType) public view returns (uint256 _fundingFeeRate)
Function Selector
0xc138aa5f
Invocation Type
Ethereum Call
Passing Parameters
1: CALL, 2: PUT
Return Value
Funding fee rate(multiplied by 1E8)

ABI Description

{
"inputs": [
{
"internalType": "enum ISLDCommon.ContractType",
"name": "_contractType",
"type": "uint8"
}
],
"name": "getFundingFeeRate",
"outputs": [
{
"internalType": "uint256",
"name": "_fundingFeeRate",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}

Examples

Calling Examples

JavaScript
Python
// This example is written by using Web3.js
// More details on Web3.js could be found here - https://web3js.readthedocs.io/
var Web3 = require('web3');
const BigNumber = require('bignumber.js');
// BSC Mainnet: https://bsc-dataseed.binance.org
// BSC Testnet: https://data-seed-prebsc-1-s1.binance.org:8545
const web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545");
const CONTRACT_ADDRESS = "Replace with underlying assets contract address";
const ABI = [{
"inputs": [
{
"internalType": "enum ISLDCommon.ContractType",
"name": "_contractType",
"type": "uint8"
}
],
"name": "getFundingFeeRate",
"outputs": [
{
"internalType": "uint256",
"name": "_fundingFeeRate",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}];
var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);
// CALL
contract.methods.getFundingFeeRate(1).call({
}, function(error, result){
if(!error) {
console.log('Response:', result);
} else {
console.log(error);
}
});
// PUT
contract.methods.getFundingFeeRate(2).call({
}, function(error, result){
if(!error) {
console.log('Response:', result);
} else {
console.log(error);
}
});
# This example is written by using Web3.py
# More details on Web3.py could be found here - https://web3py.readthedocs.io/

HTTP Request Example

post
(BSC Mainnet) https://bsc-dataseed.binance.org
/
Send a call request to get private pool info
Request Body Example:
// CALL
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0x0000000000000000000000000000000000000000",
"to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
"data": "0xc138aa5f0000000000000000000000000000000000000000000000000000000000000001"
},
"latest"
],
"id": 1234
}
// PUT
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0x0000000000000000000000000000000000000000",
"to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
"data": "0xc138aa5f0000000000000000000000000000000000000000000000000000000000000002"
},
"latest"
],
"id": 1234
}
CURL Example:
# CALL
curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0x0000000000000000000000000000000000000000",
"to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
"data": "0xc138aa5f0000000000000000000000000000000000000000000000000000000000000001"
},
"latest"
],
"id": 1234
}'
# PUT
curl --location --request POST 'https://data-seed-prebsc-1-s1.binance.org:8545' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0x0000000000000000000000000000000000000000",
"to": "0x60e2be64528dbe4e5892254d3dad83809a3f6f3a",
"data": "0xc138aa5f0000000000000000000000000000000000000000000000000000000000000002"
},
"latest"
],
"id": 1234
}'