Links

makerdao_portfolio

Get the account's positions and assets in the MakerDao protocol.
Through account_defiPortfolio, you can fetch the account's Supplied, Borrowed, Staked, Reward in the MakerDao protocol, accountAddress is necessary. Using this API, you are able to acknowledge the detailed information like Supplied, Borrowed, Staked infos and USD amount of each token as well as the sections. Some DeFi investigation and strategies can be made by calling this API.
Supported on Ethereum.

Parameters

Object - An object with the following fields (required):
  • protocol(string, optional) - "makerdao", If you don't specify the protocol, the API can return position data for all supported DeFi protocols.
  • accountAddress(hex string, required) - The account you intend to check.

Returns

Object - An object with the following fields:
  • id(integer number) - json-rpc id.
  • jsonrpc(string) - json-rpc version.
  • result(object) - an object with the following fields:
    • data(array of object, defined below) - response datas of the portfolioItemObject, click to view the detailed object description.

Example

Request

curl
TypeScript
curl --location --request POST 'https://apis.blockvision.org/v1/<api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"jsonrpc": "2.0",
"method": "account_defiPortfolio",
"params": {
"protocol":"makerdao",
"accountAddress": "0x8fd589aa8bfa402156a6d1ad323fec0ecee50d9d"
}
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
​
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_MAINNET)
​
// Access the BlockVision DeFi API
bv.getAccountDeFiPortfolio({
protocol: 'makerdao',
accountAddress: '0x8fd589aa8bfa402156a6d1ad323fec0ecee50d9d'
}).then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"websiteUrl": "https://makerdao.com",
"logo": "https://apis.blockvision.org/static/img/logo/mkr.png",
"protocol": "makerdao",
"healthRate": "2.15",
"usdAmount": "107620083",
"dsProxy": "0x85AC35B41A72800895c189f44972BD3dB46F7F1B",
"positionInfos": [
{
"logo": "https://apis.blockvision.org/static/img/logo/wbtc.png",
"contractAddress": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"symbol": "WBTC",
"balance": "7758.76",
"usdValue": "157708807",
"section": "Supplied",
"balanceTokens": [
{
"contractAddress": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"symbol": "WBTC",
"balance": "7758.76",
"usdValue": "157708807"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/dai.png",
"contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"symbol": "DAI",
"balance": "50071705.29",
"usdValue": "50088724",
"section": "Borrowed",
"balanceTokens": [
{
"contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"symbol": "DAI",
"balance": "50071705.29",
"usdValue": "50088724"
}
]
}
]
}
]
}
}