getYieldPosition
Gets a wallet account’s share balance and asset value in an Earn vault. Reads on-chain, so the result always reflects the vault’s current state.shares and assets are raw, undecimalized on-chain units — divide by the
vault’s assetDecimals (from
getYieldDetails) before
displaying them.Usage
Parameters
Returns
Promise<YieldVaultPosition> - The wallet’s share balance and asset value in the vault.
Examples
Format a position for display
React
useGetYieldPosition is a query hook that stays disabled until walletAccount is defined — safe to render before a wallet is connected.
Related
getYieldDetails- Vault details, includingassetDecimalsgetYieldRewards- The wallet’s accrued rewards in this vaultwithdrawFromYieldVault- Withdraw from this vault