createMarketAccrueEmissionInstruction
Builds a raw instruction to accrue farm emissions for a liquidity provider position. This updates the internal accounting for all active farm emissions that the position is entitled to, based on the LP’s share of liquidity and time elapsed since the last accrual.This instruction must be called before collecting emissions to ensure all pending rewards are calculated.
Usage
Accounts
| Name | Type | Signer | Writable | Description |
|---|---|---|---|---|
owner | PublicKey | Yes | Yes | LP position owner |
market | PublicKey | No | Yes | The CLMM market account |
ticks | PublicKey | No | Yes | The market tick array account |
lpPosition | PublicKey | No | Yes | LP position account |
addressLookupTable | PublicKey | No | No | Market address lookup table |
syProgram | PublicKey | No | No | SY program |
systemProgram | PublicKey | No | No | System program |
eventAuthority | PublicKey | No | No | Event authority PDA |
program | PublicKey | No | No | CLMM program ID |
Args
This instruction takes no arguments.Behavior
The instruction:- Fetches the current state of all active farm emissions in the market
- Calculates time-weighted emissions accrued since last update
- Updates the LP position’s internal trackers for each emission token
- Stages the accrued tokens for collection
- LP position’s share of liquidity in the active tick range
- Time elapsed since last accrual
- Emission rates for each active farm
- Current tick position relative to LP position bounds
Returns
Returns aMarketAccrueEmissionEvent containing:
TransactionInstruction — a transaction instruction ready to be added to a transaction.