The YieldTokenPosition account tracks a user’s deposited YT balance and accrued yield (interest and emissions) for a specific vault. Each user has one yield position per vault, derived as a PDA.Documentation Index
Fetch the complete documentation index at: https://v2-docs.exponent.finance/llms.txt
Use this file to discover all available pages before exploring further.
YieldTokenPosition
YieldTokenTracker
Generic tracker used for both interest and emission yield accrual.Fields
YieldTokenPosition
| Field | Type | Description |
|---|---|---|
owner | Pubkey | Address that owns this position |
vault | Pubkey | Vault this position belongs to |
yt_balance | u64 | Amount of YT deposited in this position |
interest | YieldTokenTracker | Tracks accrued SY interest |
emissions | Vec<YieldTokenTracker> | Tracks accrued emission rewards (one per emission token) |
YieldTokenTracker
| Field | Type | Description |
|---|---|---|
last_seen_index | Number | Last observed per-share index for this tracker |
staged | u64 | Amount of tokens staged and available for collection |
How Yield Accrual Works
-
Deposit YT — User deposits YT into the position. The
yt_balanceincreases and the tracker’slast_seen_indexis set to the vault’s current rate. -
Stage Yield — When
stageYtYieldis called, the position calculates earned interest since the last staging:- Interest earned = change in exchange rate applied to the YT balance (converted to SY equivalent)
- Emission rewards = change in emission indexes applied to the total SY balance
- Earned amounts are added to the
stagedfield of each tracker
-
Collect — The
stagedamount can be withdrawn viacollectInterestorcollectEmission. Thestagedfield is decremented by the collected amount.
Interest Calculation
Interest is computed based on the vault’sfinal_sy_exchange_rate (which freezes at maturity). If the current rate exceeds the final rate (post-maturity), earned SY is scaled down proportionally: