gmx_portfolio
Get the account's positions and assets in the Gmx protocol.
Through account_defiPortfolio, you can fetch the account's Pool-Staked, Yield in the Gmx protocol,
accountAddress
is necessary. Using this API, you are able to acknowledge the detailed information like Pool-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 Arbitrum.
Object
- An object with the following fields (required):protocol(string, optional)
-"gmx"
, 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.
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.
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":"gmx",
"accountAddress": "0xbdb910984f263ff8cb96ee765067a8f95e0ed587"
}
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ARB_MAINNET)
// Access the BlockVision DeFi API
bv.getAccountDeFiPortfolio({
protocol: 'gmx',
accountAddress: '0xbdb910984f263ff8cb96ee765067a8f95e0ed587'
}).then(console.log)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"websiteUrl": "https://gmx.io",
"logo": "https://apis.blockvision.org/static/img/logo/gmx.png",
"protocol": "Gmx Finance",
"proxy": "",
"usdAmount": "440532",
"positionInfos": [
{
"logo": "https://apis.blockvision.org/static/img/logo/gmx.png",
"contractAddress": "0xd2D1162512F927a7e282Ef43a362659E4F2a728F",
"symbol": "GMX",
"usdValue": "383471",
"section": "Staked",
"rewardTokens": [
{
"contractAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"symbol": "WETH",
"balance": "0.05",
"usdValue": "54"
},
{
"contractAddress": "0xf42ae1d54fd613c9bb14810b0588faaa09a426ca",
"symbol": "esGMX",
"balance": "0.63",
"usdValue": "1"
}
],
"balanceTokens": [
{
"contractAddress": "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a",
"symbol": "GMX",
"balance": "9692.80",
"usdValue": "383417"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/esgmx.png",
"contractAddress": "0xA75287d2f8b217273E7FCD7E86eF07D33972042E",
"symbol": "esGMX",
"usdValue": "50482",
"section": "Yield",
"rewardTokens": [
{
"contractAddress": "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a",
"symbol": "GMX",
"balance": "1.24",
"usdValue": "49"
}
],
"balanceTokens": [
{
"contractAddress": "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a",
"symbol": "esGMX",
"balance": "1274.94",
"usdValue": "50433"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/glp.png",
"contractAddress": "0x5402B5F40310bDED796c7D0F3FF6683f5C0cFfdf",
"symbol": "GLP",
"usdValue": "3575",
"section": "Staked",
"rewardTokens": [
{
"contractAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"symbol": "WETH",
"balance": "2.98",
"usdValue": "3575"
}
],
"balanceTokens": [
{
"contractAddress": "0x4277f8f2c384827b5273592ff7cebd9f2c1ac258",
"symbol": "GLP",
"balance": "9250356.87",
"usdValue": "0"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/esgmx.png",
"contractAddress": "0x199070DDfd1CFb69173aa2F7e20906F26B363004",
"symbol": "esGMX",
"usdValue": "2778",
"section": "Yield",
"rewardTokens": [
{
"contractAddress": "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a",
"symbol": "GMX",
"balance": "0.06",
"usdValue": "3"
}
],
"balanceTokens": [
{
"contractAddress": "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a",
"symbol": "esGMX",
"balance": "70.17",
"usdValue": "2776"
}
]
},
{
"logo": "https://apis.blockvision.org/static/img/logo/esgmx.png",
"contractAddress": "0xd2D1162512F927a7e282Ef43a362659E4F2a728F",
"symbol": "esGMX",
"usdValue": "226",
"section": "Staked",
"balanceTokens": [
{
"contractAddress": "0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a",
"symbol": "esGMX",
"balance": "5.72",
"usdValue": "226"
}
]
}
]
}
]
}
}
Last modified 3mo ago