Query Vault Info for Latest Round

Description

Query latest round quotation details for MVault.

User Interface

TODO(Snapshots)

Function Description

Contract Address
MVault Factory contract (referenced by General Info section)
Contract Name
MVaultFactory.sol
Function
function getLatestRoundInfo() public view returns (
uint256 strikePrice,
uint256 APY,
uint256 maxVolume,
uint256 filledVolume,
uint256 minDeposit,
uint256 startTime,
uint256 endTime,
uint256 settledPrice,
uint256 settledAmount,
bool settled )
Function Selector
0x2016e80b
Invocation Type
Ethereum Call
Passing Parameters
None
Return Value
uint256 strikePrice: strike price for MVault, actual number multiplied by 1E18
uint256 APY: APY for MVault, actual number multiplied by 1E18(1e18 means 100%)
uint256 maxVolume: Maximum volume for MVault, actual number multiplied by 1E(token precision)
uint256 filledVolume: Filled volume for MVault, actual number multiplied by 1E(token precision)
uint256 minDeposit: Minimum deposit amount for user, actual number multiplied by 1E(token precision)
uint256 startTime: Start Timestamp for current round MVault
uint256 endTime: End Timestamp for current round MVault uint256 settledPrice: Settled price for this round, actual number multiplied by 1E18(Only update when this round is settled) uint256 settledAmount: Settled order amount for this round(Only update when this round is settled) bool settled: Whether this round is settled (Only update when this round is settled)

ABI Description

{
"inputs": [],
"name": "getLatestRoundInfo",
"outputs": [
{
"internalType": "uint256",
"name": "strikePrice",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "APY",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxVolume",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "filledVolume",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minDeposit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "startTime",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "settledPrice",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "settledAmount",
"type": "uint256"
},
{
"internalType": "bool",
"name": "settled",
"type": "bool"
}
],
"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");
// Need MVault Factory contract address
const CONTRACT_ADDRESS = "Replace with MVault Factory contract address";
const ABI = [ {
"inputs": [],
"name": "getLatestRoundInfo",
"outputs": [
{
"internalType": "uint256",
"name": "strikePrice",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "APY",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxVolume",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "filledVolume",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minDeposit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "startTime",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "settledPrice",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "settledAmount",
"type": "uint256"
},
{
"internalType": "bool",
"name": "settled",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}];
var contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);
contract.methods.getLatestRoundInfo().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
/
Query Vault Info for latest round quotation
Request Body Example:
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0x0000000000000000000000000000000000000000",
"to": "0xF8b9B1a5B23c74eb95FA00256A434c25CA89E049",
"data": "0x2016e80b"
},
"latest"
],
"id": 1234
}
CURL Example:
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": "0xf8b9b1a5b23c74eb95fa00256a434c25ca89e049",
"data": "0x2016e80b"
},
"latest"
],
"id": 1234
}'
Copy link
Outline
Description
User Interface
Function Description
ABI Description
Examples
Calling Examples
HTTP Request Example
post
Query Vault Info for latest round quotation