Balances
The StakeKit API offers multiple endpoints to retrieve an address balance, including yield-related balances and available token balances.
Yield Balances
Endpoints
Endpoints related to yield balances require an address, a network, and in some cases, validator address(es) or Yield IDs. (See API Referencefor more details)
To scan for yield balances given an address:
curl --request POST \
--url https://api.stakek.it/v1/yields/balances/scan \
--header 'accept: application/json' \
--header 'authorization: Bearer INSERT_YOUR_TOKEN' \
--header 'content-type: application/json' \
--data '
{
"addresses": {
"address": "0xB6c5273e79E2aDD234EBC07d87F3824e0f94B2F7"
},
"network": "ethereum"
}
'
This will return the following response:
[
{
"integrationId": "ethereum-eth-lido-staking",
"balances": [
{
"type": "staked",
"amount": "0.109871139090150026",
"pricePerShare": "0.999253559516919067",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Lido Staked Ether",
"decimals": 18,
"address": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
"symbol": "stETH",
"logoURI": "https://assets.stakek.it/tokens/steth.svg"
}
},
{
"type": "unstaking",
"amount": "0.000000000000000000",
"pricePerShare": "0.999253559516919067",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Lido Staked Ether",
"decimals": 18,
"address": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
"symbol": "stETH",
"logoURI": "https://assets.stakek.it/tokens/steth.svg"
}
},
{
"type": "unstaked",
"amount": "0.010000000000000000",
"pricePerShare": "0.999253559516919067",
"pendingActions": [
{
"type": "CLAIM_UNSTAKED",
"passthrough": "eyJhZGRyZXNzZXMiOnsiYWRkcmVzcyI6IjB4QjZjNTI3M2U3OUUyYUREMjM0RUJDMDdkODdGMzgyNGUwZjk0QjJGNyJ9fQ=="
}
],
"token": {
"network": "ethereum",
"name": "Lido Staked Ether",
"decimals": 18,
"address": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
"symbol": "stETH",
"logoURI": "https://assets.stakek.it/tokens/steth.svg"
}
}
]
},
{
"integrationId": "ethereum-eth-stakewise-staking",
"balances": [
{
"type": "staked",
"amount": "0.013410000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "StakeWise Staked ETH2",
"symbol": "SETH2",
"decimals": 18,
"network": "ethereum",
"address": "0xfe2e637202056d30016725477c5da089ab0a043a",
"logoURI": "https://assets.stakek.it/tokens/steth2.svg"
}
},
{
"type": "rewards",
"amount": "0.000225590020720390",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "StakeWise Reward ETH2",
"symbol": "RETH2",
"decimals": 18,
"network": "ethereum",
"address": "0x20bc832ca081b91433ff6c17f85701b6e92486c5",
"logoURI": "https://assets.stakek.it/tokens/reth.svg"
}
}
]
},
{
"integrationId": "ethereum-matic-liquid-staking",
"balances": [
{
"type": "staked",
"amount": "15.770163364970402837",
"pricePerShare": "1.094254124577853",
"pendingActions": [],
"token": {
"name": "Lido Staked Matic",
"symbol": "stMATIC",
"decimals": 18,
"network": "ethereum",
"address": "0x9ee91f9f426fa633d227f7a9b000e28b9dfd8599",
"logoURI": "https://assets.stakek.it/tokens/stmatic.svg"
}
}
]
},
{
"integrationId": "ethereum-usdc-yvusdc-0.4.3-ec5cdf-yearn-vault",
"balances": [
{
"type": "staked",
"amount": "2.274497000000000000",
"pricePerShare": "1.048001000000000000",
"pendingActions": [],
"token": {
"address": "0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE",
"name": "yvUSDC 0.4.3",
"network": "ethereum",
"symbol": "yvUSDC",
"decimals": 6,
"logoURI": "https://rawcdn.githack.com/yearn/yearn-assets/192375774a16b2d5980fc130f208b9ccb4381443/icons/multichain-tokens/1/0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE/logo-128.png"
}
}
]
},
{
"integrationId": "ethereum-ape-parax-staking",
"balances": [
{
"type": "staked",
"amount": "0.150382471702411442",
"pricePerShare": "1.5453986031133964577",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "ParaX Compound APE",
"symbol": "cAPE",
"decimals": 18,
"address": "0xC5c9fB6223A989208Df27dCEE33fC59ff5c26fFF",
"logoURI": "https://assets.stakek.it/tokens/ape.svg"
}
}
]
},
{
"integrationId": "ethereum-grt-native-staking",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x7ca0ee4a792f4da7b6aaf4c082b234259de61112"
},
{
"type": "unstaked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x7ca0ee4a792f4da7b6aaf4c082b234259de61112"
},
{
"type": "staked",
"amount": "4.641699583612782005",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x7ab4cf25330ed7277ac7ab59380b68eea68abb0e"
},
{
"type": "unstaked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x7ab4cf25330ed7277ac7ab59380b68eea68abb0e"
},
{
"type": "staked",
"amount": "23.139185847876286139",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x6125ea331851367716bee301ecde7f38a7e429e7"
},
{
"type": "unstaked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x6125ea331851367716bee301ecde7f38a7e429e7"
},
{
"type": "staked",
"amount": "51.418142289650501215",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x6ac85b9d834b51b14a7b0ed849bb5199e04c05c5"
},
{
"type": "unstaked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x6ac85b9d834b51b14a7b0ed849bb5199e04c05c5"
},
{
"type": "staked",
"amount": "1.990190786058568568",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x1a99dd7d916117a523f3ce6510dcfd6bceab11e7"
},
{
"type": "unstaked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"validatorAddress": "0x1a99dd7d916117a523f3ce6510dcfd6bceab11e7"
}
]
},
{
"integrationId": "ethereum-matic-native-staking",
"balances": [
{
"type": "staked",
"amount": "33.302910779676220500",
"pricePerShare": "1.00898",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0xb929b89153fc2eed442e81e5a1add4e2fa39028f"
},
{
"type": "rewards",
"amount": "0.299464653557822569",
"pricePerShare": "1.00898",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0xb929b89153fc2eed442e81e5a1add4e2fa39028f"
},
{
"type": "unstaked",
"amount": "0.000000000000000000",
"pendingActions": [],
"pricePerShare": "1",
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0xb929b89153fc2eed442e81e5a1add4e2fa39028f"
},
{
"type": "staked",
"amount": "1.000000000000000000",
"pricePerShare": "1.01103",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0x56d783ca8e0b998c57a428bf1c26a8baca50524e"
},
{
"type": "rewards",
"amount": "0.013203450033146182",
"pricePerShare": "1.01103",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0x56d783ca8e0b998c57a428bf1c26a8baca50524e"
},
{
"type": "unstaked",
"amount": "0.000000000000000000",
"pendingActions": [],
"pricePerShare": "1",
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0x56d783ca8e0b998c57a428bf1c26a8baca50524e"
},
{
"type": "staked",
"amount": "25.476339936256409160",
"pricePerShare": "1.00097",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0x857679d69fe50e7b722f94acd2629d80c355163d"
},
{
"type": "rewards",
"amount": "0.027592285604241315",
"pricePerShare": "1.00097",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0x857679d69fe50e7b722f94acd2629d80c355163d"
},
{
"type": "unstaked",
"amount": "0.000000000000000000",
"pendingActions": [],
"pricePerShare": "1",
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0x857679d69fe50e7b722f94acd2629d80c355163d"
},
{
"type": "staked",
"amount": "3.000000000000000000",
"pricePerShare": "1.01253",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0xf30cf4ed712d3734161fdaab5b1dbb49fd2d0e5c"
},
{
"type": "rewards",
"amount": "0.037620561860433213",
"pricePerShare": "1.01253",
"pendingActions": [],
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0xf30cf4ed712d3734161fdaab5b1dbb49fd2d0e5c"
},
{
"type": "unstaked",
"amount": "0.000000000000000000",
"pendingActions": [],
"pricePerShare": "1",
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"validatorAddress": "0xf30cf4ed712d3734161fdaab5b1dbb49fd2d0e5c"
}
]
},
{
"integrationId": "ethereum-ape-native-staking",
"balances": [
{
"type": "staked",
"amount": "10.174242580941855069",
"pricePerShare": "1",
"token": {
"network": "ethereum",
"name": "Ape Coin",
"symbol": "APE",
"decimals": 18,
"address": "0x4d224452801aced8b2f0aebe155379bb5d594381",
"coinGeckoId": "apecoin",
"logoURI": "https://assets.stakek.it/tokens/ape.svg"
},
"pendingActions": []
},
{
"type": "rewards",
"amount": "0.001230719702931384",
"pricePerShare": "1",
"token": {
"network": "ethereum",
"name": "Ape Coin",
"symbol": "APE",
"decimals": 18,
"address": "0x4d224452801aced8b2f0aebe155379bb5d594381",
"coinGeckoId": "apecoin",
"logoURI": "https://assets.stakek.it/tokens/ape.svg"
},
"pendingActions": [
{
"type": "CLAIM_REWARDS",
"passthrough": "eyJhZGRyZXNzZXMiOnsiYWRkcmVzcyI6IjB4QjZjNTI3M2U3OUUyYUREMjM0RUJDMDdkODdGMzgyNGUwZjk0QjJGNyJ9fQ=="
}
]
}
]
},
{
"integrationId": "ethereum-DAI-morpho-aave-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "Aave DAI",
"symbol": "ADAI",
"decimals": 18,
"network": "ethereum",
"address": "0x028171bca77440897b824ca71d1c56cac55b68a3",
"logoURI": "https://assets.stakek.it/tokens/adai.svg"
}
}
]
},
{
"integrationId": "ethereum-WETH-morpho-aave-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "Aave WETH",
"symbol": "AWETH",
"decimals": 18,
"network": "ethereum",
"address": "0x030ba81f1c18d280636f32af80b9aad02cf0854e",
"logoURI": "https://assets.stakek.it/tokens/aweth.svg"
}
}
]
},
{
"integrationId": "ethereum-USDC-morpho-aave-lending",
"balances": [
{
"type": "staked",
"amount": "7.943881000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "Aave USDC",
"symbol": "AUSDC",
"decimals": 6,
"network": "ethereum",
"address": "0xbcca60bb61934080951369a648fb03df4f96263c",
"logoURI": "https://assets.stakek.it/tokens/ausdc.svg"
}
}
]
},
{
"integrationId": "ethereum-USDT-morpho-aave-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "Aave USDT",
"symbol": "AUSDT",
"decimals": 6,
"network": "ethereum",
"address": "0x3ed3b47dd13ec9a98b44e6204a523e766b225811",
"logoURI": "https://assets.stakek.it/tokens/ausdt.svg"
}
}
]
},
{
"integrationId": "ethereum-stETH-morpho-aave-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "Aave Interest Bearing STETH",
"symbol": "ASTETH",
"decimals": 18,
"network": "ethereum",
"address": "0x1982b2f5814301d4e9a8b0201555376e62f82428",
"logoURI": "https://assets.stakek.it/tokens/asteth.svg"
}
}
]
},
{
"integrationId": "ethereum-CRV-morpho-aave-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "Aave CRV",
"symbol": "ACRV",
"decimals": 18,
"network": "ethereum",
"address": "0x8dae6cb04688c62d939ed9b68d32bc62e49970b1",
"logoURI": "https://assets.stakek.it/tokens/acrv.svg"
}
}
]
},
{
"integrationId": "ethereum-DAI-morpho-compound-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "cDAI",
"symbol": "CDAI",
"decimals": 8,
"network": "ethereum",
"address": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
"logoURI": "https://assets.stakek.it/tokens/cdai.svg"
}
}
]
},
{
"integrationId": "ethereum-COMP-morpho-compound-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "cCOMP",
"symbol": "CCOMP",
"decimals": 8,
"network": "ethereum",
"address": "0x70e36f6bf80a52b3b46b3af8e106cc0ed743e8e4",
"logoURI": "https://assets.stakek.it/tokens/ccomp.svg"
}
}
]
},
{
"integrationId": "ethereum-WETH-morpho-compound-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "cETH",
"symbol": "CETH",
"decimals": 8,
"network": "ethereum",
"address": "0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5",
"logoURI": "https://assets.stakek.it/tokens/ceth.svg"
}
}
]
},
{
"integrationId": "ethereum-FEI-morpho-compound-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "Compound Fei USD",
"symbol": "cFEI",
"decimals": 18,
"network": "ethereum",
"address": "0x7713dd9ca933848f6819f38b8352d9a15ea73f67",
"logoURI": "https://assets.stakek.it/tokens/cfei.svg"
}
}
]
},
{
"integrationId": "ethereum-UNI-morpho-compound-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "cUNI",
"symbol": "CUNI",
"decimals": 8,
"network": "ethereum",
"address": "0x35a18000230da775cac24873d00ff85bccded550",
"logoURI": "https://assets.stakek.it/tokens/cuni.svg"
}
}
]
},
{
"integrationId": "ethereum-USDC-morpho-compound-lending",
"balances": [
{
"type": "staked",
"amount": "1.104583000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "cUSDC",
"symbol": "CUSDC",
"decimals": 8,
"network": "ethereum",
"address": "0x39aa39c021dfbae8fac545936693ac917d5e7563",
"logoURI": "https://assets.stakek.it/tokens/cusdc.svg"
}
}
]
},
{
"integrationId": "ethereum-USDT-morpho-compound-lending",
"balances": [
{
"type": "staked",
"amount": "0.000000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "cUSDT",
"symbol": "CUSDT",
"decimals": 8,
"network": "ethereum",
"address": "0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9",
"logoURI": "https://assets.stakek.it/tokens/cusdt.svg"
}
}
]
}
]
Types
For consistency, all yield balances use the following interface:
export interface YieldBalanceDto {
/** What state the balance is in. "staked" is the only balance earning yields */
type: BalanceTypes;
/** The balance amount */
amount: string;
/** Date */
date?: string;
/** The price of the reward token as a multiple of the underlying token. Used when dealing with index based yields where the reward asset appreciates in value over time. */
pricePerShare: string;
/** A list of pending actions that is related to the balance. Can for example be "CLAIM_REWARDS" for balances of type "rewards" */
pendingActions: PendingActionDto[];
/** The token associated with the balance */
token: TokenDto;
/** The validator associated with the balance */
validatorAddress?: string;
}
The Type is an important enum that describes what state the balance is currently in:
export enum BalanceTypes {
Available = 'available',
Staked = 'staked',
Unstaking = 'unstaking',
Unstaked = 'unstaked',
Preparing = 'preparing',
Rewards = 'rewards',
Locked = 'locked',
Unlocking = 'unlocking',
}
Balances can also contain Pending Actions (such as "Claim Rewards", "Withdraw", "Unlock", and "Restake"):
export interface PendingActionDto {
/** The pending action type */
type: ActionTypes;
/** A server generated passthrough that must passed back when pulling the transactions for a given pending action */
passthrough: string;
/** Any user chosen options for the pending action. Possible options can be for example validator address, duration, etc */
args?: ActionArgumentOptionsDto;
}
export enum ActionTypes {
STAKE = 'STAKE',
UNSTAKE = 'UNSTAKE',
CLAIM_REWARDS = 'CLAIM_REWARDS',
RESTAKE_REWARDS = 'RESTAKE_REWARDS',
WITHDRAW = 'WITHDRAW',
RESTAKE = 'RESTAKE',
CLAIM_UNSTAKED = 'CLAIM_UNSTAKED',
UNLOCK_LOCKED = 'UNLOCK_LOCKED',
UNLOCK_LOCKED_LEGACY = 'UNLOCK_LOCKED_LEGACY',
STAKE_LOCKED = 'STAKE_LOCKED',
}
The Pending Action related to the balance on line 512 in the example response above can be initiated using the following request:
curl --request POST \
--url https://api.stakek.it/v1/actions/pending \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"type": "CLAIM_REWARDS",
"integrationId": "ethereum-ape-native-staking",
"passthrough": "eyJhZGRyZXNzZXMiOnsiYWRkcmVzcyI6IjB4QjZjNTI3M2U3OUUyYUREMjM0RUJDMDdkODdGMzgyNGUwZjk0QjJGNyJ9fQ=="
}
'
This will return the action and unsigned transactions needed to sign and submit to perform the action. More details about pending actions can be found here.
Yield Balances Breakdown
Staked Balance
The staked balance is the amount that is currently earning user rewards. It returns the staked amount, the asset metadata, and the validator address. For a single yield, a user can have multiple staked balances depending on how many different validators the user has staked with. Staked balances do not usually have Pending Actions.
{
"type": "staked",
"amount": "5.100000000000000000",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "Cosmos",
"network": "cosmos",
"decimals": 6,
"symbol": "ATOM",
"logoURI": "https://assets.stakek.it/tokens/atom.svg",
"coinGeckoId": "cosmos"
},
"validatorAddress": "cosmosvaloper1gpx52r9h3zeul45amvcy2pysgvcwddxrgx6cnv"
},
Unstaking Balance
Unstaking periods vary depending on the asset or yield opportunity. During an unstaking period, users do not have access to the tokens being staked – the tokens either become available automatically after the lockup period or have to be claimed through a Pending Action once unstaking period concludes. This balance includes the time at which the assets become available. The below example demonstrates ATOM unstaking data, including the amount being unstaked, the date when the unstaking period ends, the asset metadata, and the validator address.
{
"type": "unstaking",
"amount": "0.100000000000000000",
"date": "2023-12-01T13:56:09.000Z",
"pricePerShare": "1",
"pendingActions": [],
"token": {
"name": "Cosmos",
"network": "cosmos",
"decimals": 6,
"symbol": "ATOM",
"logoURI": "https://assets.stakek.it/tokens/atom.svg">,
"coinGeckoId": "cosmos"
},
"validatorAddress": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3"
},
Unstaked Balance
Some yields require users to manually withdraw unstaked assets once the unstaking period is over. The example below shows an unstaked balance amount and the associated "Withdraw" Pending Actions.
....{
"type": "unstaked",
"amount": "0.200000000000000000",
"pendingActions":\[
{
"type": "WITHDRAW",
"passthrough": "..."
}....
Locked Balance
When it comes to staking flows such as that of CELO native staking, users make three transactions that need to be signed and submitted: account creation, locking CELO, and delegating CELO. If the final transaction fails, the user will have a locked CELO balance. Users are able to adjust their locked position by utilizing the “Stake Locked” or “Unstake Locked” Pending Actions. If the locked balance is 0, the Pending Actions aren’t available. Here is an example of a locked balance after calling the balances endpoint:
{
"type": "locked",
"amount": "1.000000000000000000",
"pendingActions": [],
"token": {
"name": "Celo",
"symbol": "CELO",
"decimals": 18,
"address": "0x471EcE3750Da237f93B8E339c536989b8978a438",
"network": "celo",
"coinGeckoId": "celo",
"logoURI": "https://assets.stakek.it/tokens/celo.svg"
},
"pricePerShare": "1"
}
Unlocking Balance
On Celo, there are three transactions that need to be signed and submitted when staking: account creation, locking CELO, and delegating CELO. If the final transaction fails, the user will have a locked CELO balance. If a user decides to adjust their locked position by utilizing the “Unlock Locked” Pending Action, they will have an “unlocking balance” until the process is finished.
Rewards Balance
You can retrieve the rewards balance for each available yield. For yields where there are multiple validators, the rewards balance is shown for each validator, not combined per yield. If the reward balances are above the minimum claimable amount, they will include Pending Actions as well. The example below shows the amount of accrued rewards and two possible Pending Actions ("Claim Rewards" and "Restake Rewards"):
....{
"type": "rewards",
"amount": "0.000023920678712104",
"pricePerShare": "1",
"pendingActions": \[
{
"type": "CLAIM_REWARDS",
"passthrough": "..."
},
{
"type": "RESTAKE_REWARDS",
"passthrough": "..."
}....
Preparing Balance
In staking flows of the likes of Celo native staking, there is a period where the votes are pending. The process of activating a stake on Solana is another example of this. For that, it takes three days before the user can begin to earn rewards. During such periods, the balance type will be “preparing”.
{
"type": "preparing",
"amount": "1.000000000000000000",
"validatorAddress": "0x01b2b83fdf26afc3ca7062c35bc68c8dde56db04",
"pendingActions": [],
"pricePerShare": "1",
"token": {
"name": "Celo",
"symbol": "CELO",
"decimals": 18,
"address": "0x471EcE3750Da237f93B8E339c536989b8978a438",
"network": "celo",
"coinGeckoId": "celo",
"logoURI": "https://assets.stakek.it/tokens/celo.svg"
},
"date": "2023-11-15T19:03:29.579Z"
},
Token Balances
Endpoints
There are two primary endpoints to retrieve token balances. See API Referencefor more details).
The first is: /token/balances/scan
This endpoint scans the network for tokens with a balance and returns it to the user. See request below. Please note that it only retrieves balances across networks and yields that our platform supports.
curl --request POST \
--url https://api.stakek.it/v1/token/balances/scan \
--header 'accept: application/json' \
--header 'authorization: Bearer INSERT_YOUR_TOKEN' \
--header 'content-type: application/json' \
--data '
{
"addresses": {
"address": "0xB6c5273e79E2aDD234EBC07d87F3824e0f94B2F7"
},
"network": "ethereum"
}
'
The response will include both the available balances and the yield integrations that the end user can enter into, which is beneficial when combined with the Yield Metadata.
[
{
"token": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"network": "ethereum",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://assets.stakek.it/tokens/usdc.svg"
},
"amount": "345.676630000000000000",
"availableYields": [
"ethereum-USDC-morpho-aave-lending",
"ethereum-USDC-morpho-compound-lending",
"ethereum-usdc-yvusdc-0.2.2-fbce41-yearn-vault",
"ethereum-usdc-yvusdc-0.3.0-20f1cb-yearn-vault",
"ethereum-usdc-yvusdc-0.4.3-ec5cdf-yearn-vault",
"ethereum-usdc-compound-v3-lending"
]
},
{
"token": {
"network": "ethereum",
"name": "Ethereum",
"symbol": "ETH",
"decimals": 18,
"coinGeckoId": "ethereum",
"logoURI": "https://assets.stakek.it/tokens/eth.svg"
},
"amount": "0.158470564159791889",
"availableYields": [
"ethereum-eth-lido-staking",
"ethereum-eth-stakewise-staking",
"ethereum-eth-reth-staking"
]
},
{
"token": {
"network": "ethereum",
"name": "Lido Staked Ether",
"decimals": 18,
"address": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
"symbol": "stETH",
"logoURI": "https://assets.stakek.it/tokens/steth.svg"
},
"amount": "0.109871139090150026",
"availableYields": [
"ethereum-stETH-morpho-aave-lending"
]
},
{
"token": {
"address": "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2",
"network": "ethereum",
"name": "SushiToken",
"symbol": "SUSHI",
"decimals": 18,
"logoURI": "https://assets.stakek.it/tokens/sushi.svg"
},
"amount": "15.480172060521205344",
"availableYields": [
"ethereum-sushi-yvsushi-0.4.3-4caade-yearn-vault"
]
},
{
"token": {
"name": "The Graph",
"symbol": "GRT",
"address": "0xc944E90C64B2c07662A292be6244BDf05Cda44a7",
"decimals": 18,
"network": "ethereum",
"coinGeckoId": "the-graph",
"logoURI": "https://assets.stakek.it/tokens/grt.svg"
},
"amount": "59.737133804007902726",
"availableYields": [
"ethereum-grt-native-staking"
]
},
{
"token": {
"network": "ethereum",
"name": "Ape Coin",
"symbol": "APE",
"decimals": 18,
"address": "0x4d224452801aced8b2f0aebe155379bb5d594381",
"coinGeckoId": "apecoin",
"logoURI": "https://assets.stakek.it/tokens/ape.svg"
},
"amount": "3.314352670315161075",
"availableYields": [
"ethereum-ape-native-staking",
"ethereum-ape-parax-staking"
]
},
{
"token": {
"network": "ethereum",
"name": "Polygon",
"decimals": 18,
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"logoURI": "https://assets.stakek.it/tokens/matic.svg"
},
"amount": "1.773583465275122120",
"availableYields": [
"ethereum-matic-native-staking",
"ethereum-matic-liquid-staking"
]
}
]
Types
Token balances use the following type:
interface BalanceDto {
amount: string;
token: Token;
availableYields: string[];
}
Updated about 1 year ago