API
The Venus Protocol API providing access to indexed protocol data.
Venus Protocol API provides two groups of endpoints
Market Data - Endpoints relating to lending markets
Activity - Endpoints relating to user interactions with markets
Governance - Endpoints providing information about proposals and voter activity
Base URL
The API is available without authentication for testnet and mainnet.
mainnet: https://api.venus.io testnet: https://testnetapi.venus.io
Versioning
Endpoints are versioned using the accept-version header. The values for this header can be stable or next. By default the stable version is returned. When a next version is available, a Warning - 299 header will be added to the stable version with a message of breaking changes. To receive this new version the accept-version header can be set to next.
When the latest next version is made stable and the previous stable version is deprecated, both values for accept-version will return the latest version. Using the next header at this point will add a Warning - 299 header alerting the client to remove accept-version: next to avoid receiving unexpected changes in the future.
Versioning Choreography
These steps describe the process of upgrading endpoints to new versions as they are released
A
nextversion is made available, accessible with theaccept-version: nextheader. AWarning - 299header is added to the stable version with details about breaking changes.Clients will be given adequate time to upgrade to use the next version.
The previous stable version will be deprecated, the next version becomes stable and using the
accept-version: nextheader will add a warning to remove the header or use the stable version.Clients remove the
accept-version: nextheader to avoid receiving unexpected changes.The endpoint is now ready to release another version.
Pool Endpoints
Returns pool data for all listed pools, optionally filterable by the pool's comptroller address.
Blockchain Id used to filter results to a specific chain
Pool address
Filter by pool name
Array of columns to order results. Default sort is descending. If '+' is prepended to a column it will be sorted ascending.
Limit used for pagination
20Page number to fetch
0Returns Pool data for all listed pools.
Malformed Query
GET /pools HTTP/1.1
Host:
Accept: */*
{
"limit": 1,
"page": 1,
"total": 1,
"result": [
{
"chainId": "text",
"address": "text",
"name": "text",
"description": "text",
"priceOracleAddress": "text",
"closeFactorMantissa": "text",
"liquidationIncentiveMantissa": "text",
"minLiquidatableCollateralMantissa": "text"
}
]
}Market Endpoints
Returns market data for listed markets, optionally filterable by asset address, name, symbol, underlying address, underlying name or underlying symbol.
Blockchain Id used to filter results to a specific chain
Filter by vToken address
Filter by asset symbol
Filter by asset name
Filter by underlying address
Filter by underlying name
Filter by underlying symbol
Array of columns to order results. Default sort is descending. If '+' is prepended to a column it will be sorted ascending.
Limit used for pagination
20Page number to fetch
0Returns Market data for all listed markets.
Malformed Query
GET /markets HTTP/1.1
Host:
Accept: */*
{
"limit": 1,
"page": 1,
"total": 1,
"result": [
{
"address": "text",
"symbol": "text",
"name": "text",
"underlyingAddress": "text",
"underlyingName": "text",
"underlyingSymbol": "text",
"underlyingDecimal": 1,
"borrowerDailyXvsMantissa": "text",
"supplierDailyXvsMantissa": "text",
"venusBorrowIndex": "text",
"venusSupplyIndex": "text",
"borrowRatePerBlock": "text",
"supplyRatePerBlock": "text",
"exchangeRateMantissa": "text",
"underlyingPriceMantissa": "text",
"totalBorrowsMantissa": "text",
"totalSupplyMantissa": "text",
"cashMantissa": "text",
"totalReservesMantissa": "text",
"reserveFactorMantissa": "text",
"collateralFactorMantissa": "text",
"borrowApy": "text",
"supplyApy": "text",
"borrowXvsApy": "text",
"supplyXvsApy": "text",
"borrowXvsApr": "text",
"supplyXvsApr": "text",
"liquidityCents": "text",
"tokenPriceCents": "text",
"supplyCapsMantissa": "text",
"borrowCapsMantissa": "text",
"borrowerCount": 1,
"supplierCount": 1
}
]
}Fetch an array of daily snapshots of supply and borrow totals and supply and borrow apy over the previous 365 days for a given asset.
Blockchain Id used to filter results to a specific chain
Filter by vToken address
yearPossible values: Returns historical data for the requested asset.
Unexpected error
GET /markets/history HTTP/1.1
Host:
Accept: */*
{
"result": {
"asset": "text",
"updateAt": "text",
"data": [
{
"blockNumber": 1,
"blockTimestamp": 1,
"supplyApy": "text",
"borrowApy": "text",
"totalSupplyUsd": "text",
"totalBorrowUsd": "text"
}
]
}
}Governance Endpoints
Get vote summary for a given proposal, includes sums of for, against, abstain and total votes.
Proposal Id for fetching a detailed proposal
Proposal vote summary
Unexpected error
GET /governance/proposals/{proposalId}/voteSummary HTTP/1.1
Host:
Accept: */*
{
"for": "text",
"against": "text",
"abstain": "text",
"total": "text"
}Retrieve a summary of an account's voter profile.
Account address
A summary of an account's voter profile including latest governance transactions.
Unexpected error
GET /governance/voters/{address}/summary HTTP/1.1
Host:
Accept: */*
{
"delegateCount": 1,
"votes": "text",
"balance": "text",
"delegates": "text",
"txs": [
{
"category": "vtoken",
"event": "text",
"transactionHash": "text",
"from": "text",
"to": "text",
"tokenAddress": "text",
"amountMantissa": 1,
"blockNumber": 1,
"timestamp": "text",
"logIndex": 1
}
]
}Retrieve the history of proposals a given account has voted on
Account address
Array of proposals in which the given account has voted
Unexpected error
GET /governance/voters/{address}/history HTTP/1.1
Host:
Accept: */*
{
"page": 1,
"limit": 1,
"total": 1,
"result": [
{
"proposalId": 1,
"description": "text",
"createdBlock": 1,
"createdTxHash": "text",
"createdTimestamp": 1,
"startBlock": 1,
"startTimestamp": 1,
"cancelBlock": 1,
"cancelTxHash": "text",
"cancelTimestamp": 1,
"endBlock": 1,
"endTimestamp": 1,
"queuedBlock": 1,
"queuedTxHash": "text",
"queuedTimestamp": 1,
"executedBlock": 1,
"executedTxHash": "text",
"executedTimestamp": 1,
"proposer": "text",
"eta": 1,
"forVotes": "text",
"againstVotes": "text",
"canceled": true,
"executed": true,
"state": 1,
"voterCount": 1,
"abstainedVotes": "text",
"governorName": "text",
"proposalType": 1
}
]
}Query voter accounts ordered by votes.
Limit used for pagination
20Page number to fetch
0Returns an array of voter accounts ordered by votes
Unexpected error
GET /governance/voters HTTP/1.1
Host:
Accept: */*
{
"offset": 1,
"limit": 1,
"total": 1,
"result": [
{
"address": "text",
"proposalsVoted": 1,
"votesMantissa": "text",
"stakedVotesMantissa": "text"
}
]
}Returns paginated array of proposals.
Filter by proposal ID
Filter by proposal state
Array of columns to order results. Default sort is descending. If '+' is prepended to a column it will be sorted ascending.
Limit used for pagination
20Page number to fetch
0Returns an array of proposals.
Unexpected error
GET /governance/proposals HTTP/1.1
Host:
Accept: */*
{
"offset": 1,
"limit": 1,
"total": 1,
"result": [
{
"proposalId": 1,
"description": "text",
"createdBlock": 1,
"createdTxHash": "text",
"createdTimestamp": 1,
"startBlock": 1,
"startTimestamp": 1,
"cancelBlock": 1,
"cancelTxHash": "text",
"cancelTimestamp": 1,
"endBlock": 1,
"endTimestamp": 1,
"queuedBlock": 1,
"queuedTxHash": "text",
"queuedTimestamp": 1,
"executedBlock": 1,
"executedTxHash": "text",
"executedTimestamp": 1,
"proposer": "text",
"eta": 1,
"forVotes": "text",
"againstVotes": "text",
"canceled": true,
"executed": true,
"state": 1,
"voterCount": 1,
"abstainedVotes": "text",
"governorName": "text",
"proposalType": 1
}
]
}Get voter details for a given proposal.
Filter by proposal ID
Account address
Array of columns to order results. Default sort is descending. If '+' is prepended to a column it will be sorted ascending.
Limit used for pagination
20Page number to fetch
0Pagination object with paginated voter activity and a summary of proposal votes.
Unexpected error
GET /governance/proposals/votes HTTP/1.1
Host:
Accept: */*
{
"offset": 1,
"limit": 1,
"total": 1,
"result": [
{
"address": "text",
"support": 1,
"blockNumber": 1,
"blockTimestamp": 1,
"votesMantissa": "text",
"reason": "text"
}
]
}Returns paginated array of proposals. It takes an optional array of proposal ids to filter by.
Proposal Id for fetching a detailed proposal
Returns an array of proposals.
Unexpected error
GET /governance/proposals/{proposalId} HTTP/1.1
Host:
Accept: */*
{
"proposalId": 1,
"description": "text",
"createdBlock": 1,
"createdTxHash": "text",
"createdTimestamp": 1,
"startBlock": 1,
"startTimestamp": 1,
"cancelBlock": 1,
"cancelTxHash": "text",
"cancelTimestamp": 1,
"endBlock": 1,
"endTimestamp": 1,
"queuedBlock": 1,
"queuedTxHash": "text",
"queuedTimestamp": 1,
"executedBlock": 1,
"executedTxHash": "text",
"executedTimestamp": 1,
"proposer": "text",
"eta": 1,
"forVotes": "text",
"againstVotes": "text",
"canceled": true,
"executed": true,
"state": 1,
"voterCount": 1,
"abstainedVotes": "text",
"governorName": "text",
"proposalType": 1,
"proposalActions": [
{
"proposalId": 1,
"actionIndex": 1,
"target": "text",
"value": "text",
"signature": "text",
"calldata": "text"
}
]
}Last updated

