YtPosition class represents a user’s yield position for a specific vault. It tracks deposited YT balance, accrued interest, and emission rewards.
Loading a Position
By address
By owner
Multiple positions for one owner
Reading Position State
Available Properties
| Property | Type | Description |
|---|---|---|
ytBalance | bigint | Amount of YT deposited in the position |
owner | PublicKey | Owner of the yield position |
stagedInterest | bigint | Interest that has been staged for collection |
selfAddress | PublicKey | The yield position PDA address |
vault | Vault | The associated vault instance |
Refreshing State
Serialization
YtPositionJson object with:
owner— Owner public key as stringytBalance— YT balance as stringinterest— Interest tracker withlastSeenIndexandstagedclaimableInterest— Calculated claimable interest amountemissions— Array of emission trackersvault— Serialized vault state