hLP and yield
Instructions for single-sided hLP deposits and withdrawals, yield accounts, harvesting and the junior tranche.
Updated Nov 3, 2026
The hedged vaults, the yield accounts every LP token pays through, the recovery paths a stressed vault can take, and the junior tranche: conversions between srLP and jrLP, the permanent seed, income checkpoints and income-book epochs. See Single-sided liquidity, Two-sided liquidity, Senior and junior tranches and Leverage and hedging.
The table below is generated from the IDL in the SDK this build pins, which matches the program deployed on devnet.
deposit_single_sided
Deposit one asset into its hLP vault and receive hLP shares against the vault's net asset value.
Accrued funding is settled atomically across both hLP vaults, subject to cash, coverage, custody, slippage and existing-holder value checks. The SDK supplies the canonical settlement prefix and creates missing yield accounts; raw callers must supply that prefix.
- Caller
- Any depositor
- In the app
- Earn
- Discriminator
050e95aab767e169
Arguments
args: DepositSingleSidedArgs
| Field | Type | Notes |
|---|---|---|
| deposit_amount | u64 | Target-asset atoms to deposit. |
| min_hlp_amount | u64 | Minimum hLP shares to receive. |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | writable | ||
| futarchy_authority | |||
| owner | writable · signer | ||
| base_mint | |||
| quote_mint | |||
| srlp_mint | writable | ||
| target_hlp_mint | writable | ||
| base_reserve_vault | writable | ||
| quote_reserve_vault | writable | ||
| owner_target_account | writable | ||
| owner_hlp_account | writable | ||
| hlp_srlp_account | writable | authority are all validated before any market mutation. A System-owned empty PDA is initialized inline by the deposit handler. | |
| base_yield_account | writable | ||
| quote_yield_account | writable | ||
| token_program | Tokenkeg…Q5DA | ||
| token_2022_program | TokenzQd…xuEb | ||
| system_program | 11111111…1111 | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
withdraw_single_sided
Burn hLP shares: the vault removes proportional srLP, repays funding debt, realizes interest and returns the target asset.
- Caller
- The hLP holder
- In the app
- Earn · Portfolio
- Discriminator
f354e4637a93fc3e
Arguments
args: WithdrawSingleSidedArgs
| Field | Type | Notes |
|---|---|---|
| hlp_amount | u64 | hLP shares to burn. |
| min_target_amount_out | u64 | Minimum target-asset atoms returned. |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | writable | ||
| futarchy_authority | |||
| owner | writable · signer | ||
| base_mint | |||
| quote_mint | |||
| srlp_mint | writable | ||
| target_hlp_mint | writable | ||
| base_reserve_vault | writable | ||
| quote_reserve_vault | writable | ||
| borrowed_interest_vault | writable | ||
| owner_target_account | writable | ||
| owner_hlp_account | writable | ||
| hlp_srlp_account | writable | PDA ["hlp_ylp_vault", market, target_hlp_mint, srlp_mint] | |
| base_yield_account | writable | ||
| quote_yield_account | writable | ||
| token_program | Tokenkeg…Q5DA | ||
| token_2022_program | TokenzQd…xuEb | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
preview_hlp_deposit_capacity
Read-only: how much a vault can admit right now and which constraint binds.
- Caller
- Any client, by simulation
- Discriminator
b70414bc94c181c3
Arguments
None.
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | |||
| futarchy_authority | |||
| base_mint | |||
| quote_mint | |||
| target_hlp_mint |
preview_hlp_order_trigger
Read-only: the NAV per share and the twelve-hour funding average an hLP order would be judged against.
- Caller
- Any client, by simulation
- Discriminator
6272cc7ccef50439
Arguments
args: PreviewHlpOrderTriggerArgs
| Field | Type | Notes |
|---|---|---|
| target_asset | u8 | |
| hlp_amount | u64 |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | writable | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] |
preview_hlp_flash
Read-only: quote the target collateral released and fixed net borrowed-token payment for atomic hLP hedge recovery.
- Caller
- Any client, by simulation
- Discriminator
1aa47654e7569db0
Arguments
| Argument | Type | Notes |
|---|---|---|
| target_asset | u8 |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | |||
| futarchy_authority | |||
| target_mint | |||
| borrowed_mint |
begin_hlp_flash
Release hLP target collateral into an atomic session that must be settled later in the same top-level transaction.
The caller may use any external route or its own inventory. The instruction binds the exact settlement instruction and fixed payment; no routing program is privileged.
- Caller
- Any keeper or route executor
- Discriminator
29cff767b43a830d- Emits
- HlpFlashStarted
Arguments
args: BeginHlpFlashArgs
| Field | Type | Notes |
|---|---|---|
| target_asset | u8 | |
| max_payment | u64 | |
| allow_full | bool | |
| max_socialized_loss | u64 | |
| max_collateral_debit | u64 | |
| min_collateral_credit | u64 | |
| settle_index | u16 |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| accounts.market | writable | ||
| accounts.futarchy_authority | |||
| accounts.buyer | writable · signer | ||
| accounts.target_mint | |||
| accounts.borrowed_mint | |||
| accounts.target_reserve | writable | ||
| accounts.borrowed_reserve | writable | ||
| accounts.buyer_collateral_account | writable | ||
| accounts.buyer_refund_account | writable | ||
| accounts.token_program | Tokenkeg…Q5DA | ||
| accounts.token_2022_program | TokenzQd…xuEb | ||
| accounts.borrowed_token_program | |||
| session | writable | ||
| repayment_vault | writable | PDA ["hlp-flash-payment", session] | |
| instructions | Sysvar1n…1111 | ||
| system_program | 11111111…1111 | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
settle_hlp_flash
Verify the fixed borrowed-token payment, close the atomic hLP session and restore the vault's opposite-token hedge.
- Caller
- The same atomic transaction that began the hLP flash
- Discriminator
d77c9968c35b76d1
Arguments
None.
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| accounts.market | writable | ||
| accounts.futarchy_authority | |||
| accounts.buyer | writable · signer | ||
| accounts.target_mint | |||
| accounts.borrowed_mint | |||
| accounts.target_reserve | writable | ||
| accounts.borrowed_reserve | writable | ||
| accounts.buyer_collateral_account | writable | ||
| accounts.buyer_refund_account | writable | ||
| accounts.token_program | Tokenkeg…Q5DA | ||
| accounts.token_2022_program | TokenzQd…xuEb | ||
| accounts.borrowed_token_program | |||
| session | writable | ||
| repayment_vault | writable | PDA ["hlp-flash-payment", session] | |
| instructions | Sysvar1n…1111 | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
close_insolvent_hlp
Terminal closeout of a vault that unpaid funding interest has exhausted: retires its srLP, applies junior-first then senior loss socialization, pays a caller bounty.
Only insolvency attributable to unpaid funding interest qualifies; a principal shortfall rejects.
- Caller
- Any keeper
- Discriminator
9eac308679a1c2a8
Arguments
args: CloseInsolventHlpArgs
| Field | Type | Notes |
|---|---|---|
| target_asset | u8 | |
| max_socialized_loss | u64 | |
| min_caller_bounty_out | u64 |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | writable | ||
| futarchy_authority | |||
| caller | writable · signer | ||
| borrowed_mint | |||
| borrowed_reserve_vault | writable | ||
| borrowed_interest_vault | writable | ||
| caller_bounty_account | writable | ||
| srlp_mint | writable | ||
| target_hlp_srlp_vault | writable | ||
| token_program | Tokenkeg…Q5DA | ||
| token_2022_program | TokenzQd…xuEb | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
rotate_hlp_cohort
Retire a fully liquidated hLP receipt mint and create a fresh receipt cohort so deposits can resume.
Old receipts keep only their already funded yield entitlement; the new cohort starts with no claim on the retired vault principal.
- Caller
- Any payer after terminal hLP settlement
- Discriminator
a342ba5b2883c2eb- Emits
- HlpCohortRotated
Arguments
args: RotateHlpCohortArgs
| Field | Type | Notes |
|---|---|---|
| target_asset | u8 | |
| metadata | InitializeLpMetadataArgs |
InitializeLpMetadataArgs
| Field | Type | Notes |
|---|---|---|
| name | string | |
| symbol | string | |
| uri | string |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| payer | writable · signer | ||
| market | writable | ||
| old_hlp_mint | |||
| new_hlp_mint | writable | ||
| old_cohort | writable | PDA ["hlp_cohort", market, old_hlp_mint] | |
| new_token_metadata | writable | PDA ["metadata", "0x0b7065b1e3d17c45389d527f6b04c3cd58b86c731aa0fdb549b6d1bc03f82946", new_hlp_mint] | |
| sysvar_instructions | Sysvar1n…1111 | ||
| token_2022_program | TokenzQd…xuEb | ||
| token_metadata_program | metaqbxx…8x1s | ||
| system_program | 11111111…1111 | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
burn_retired_hlp_receipt
Burn receipt tokens from a retired hLP cohort after checkpointing any funded yield still owed to their holder.
- Caller
- The retired receipt holder
- Discriminator
ba914c8d201e3f5f
Arguments
args: BurnRetiredHlpReceiptArgs
| Field | Type | Notes |
|---|---|---|
| amount | u64 |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] | ||
| owner | writable · signer | ||
| retired_mint | writable | ||
| cohort | writable | PDA ["hlp_cohort", market, retired_mint] | |
| owner_hlp_account | writable | ||
| base_yield_account | writable | ||
| quote_yield_account | writable | ||
| token_2022_program | TokenzQd…xuEb | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
fund_interest
Move available cash into the public-interest vaults, cover hLP funding gaps from hLP income and publish the funded remainder as holder yield.
Unfunded accrued interest remains recorded and out of swap pricing. The instruction uses only available cash, so normal swaps do not have to settle all accrued interest first.
- Caller
- Anyone
- Discriminator
6c9452e0e734563b
Arguments
args: FundInterestArgs
| Field | Type | Notes |
|---|---|---|
| max_base_gross | u64 | Gross public interest to fund, including the frozen protocol allocation. |
| max_quote_gross | u64 |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | writable | ||
| futarchy_authority | |||
| caller | signer | ||
| base_mint | |||
| quote_mint | |||
| base_reserve_vault | writable | ||
| quote_reserve_vault | writable | ||
| base_interest_vault | writable | ||
| quote_interest_vault | writable | ||
| token_program | Tokenkeg…Q5DA | ||
| token_2022_program | TokenzQd…xuEb | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
initialize_yield_accounts
Create the per-owner, per-market yield accounts that track claimable swap fees and interest for an LP mint.
Permissionless and idempotent; safe to prepend to a first deposit.
- Caller
- Any payer
- Discriminator
ecac441b09a5b504
Arguments
args: InitializeYieldAccountsArgs
| Field | Type | Notes |
|---|---|---|
| owner | pubkey | |
| token_kind | YieldTokenKind |
YieldTokenKind
| Variant | Fields |
|---|---|
| Srlp | unit |
| Hlp | unit |
| Junior | unit |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| payer | writable · signer | ||
| market | writable | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] | |
| futarchy_authority | PDA ["futarchy_authority"] | ||
| lp_mint | |||
| base_mint | |||
| quote_mint | |||
| base_yield_account | writable | ||
| quote_yield_account | writable | ||
| system_program | 11111111…1111 | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
grow_yield_account
Extend an existing yield account to the current layout size after a program upgrade.
- Caller
- Any payer
- Discriminator
cb9da8db3bf6ff86
Arguments
None.
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| payer | writable · signer | ||
| yield_account | writable | read this account, so a typed account here would fail the very case this instruction exists to repair. | |
| system_program | 11111111…1111 |
harvest
Pay a yield account's claimable balance to its recipient's canonical associated token account.
The caller may be the LP owner, the designated recipient or the harvest authority; anyone else fails with InvalidSigner. Payout is never routed elsewhere.
- Caller
- Owner, recipient or harvest authority
- In the app
- Portfolio · Claim
- Discriminator
e4f11fb635a93bc7- Emits
- YieldClaimed
Arguments
args: HarvestArgs
| Field | Type | Notes |
|---|---|---|
| token_kind | YieldTokenKind | 0 for srLP, 1 for hLP, 2 for jrLP. |
YieldTokenKind
| Variant | Fields |
|---|---|
| Srlp | unit |
| Hlp | unit |
| Junior | unit |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | writable | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] | |
| futarchy_authority | PDA ["futarchy_authority"] | ||
| owner | LP holder identity. Its signature is not required when the designated recipient or harvest authority signs instead. | ||
| caller | signer | The LP holder, designated recipient, or harvest authority. Checked in validation. | |
| asset_mint | |||
| lp_mint | |||
| owner_lp_account | writable | ||
| reserve_vault | writable | ||
| interest_vault | writable | ||
| recipient_asset_account | writable | ||
| yield_account | writable | ||
| token_program | Tokenkeg…Q5DA | ||
| token_2022_program | TokenzQd…xuEb | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
set_yield_recipient
Change where a yield account's claims are paid.
- Caller
- The LP owner
- Discriminator
b2d3500a8a34bc16
Arguments
args: SetYieldRecipientArgs
| Field | Type | Notes |
|---|---|---|
| token_kind | YieldTokenKind | |
| recipient | pubkey |
YieldTokenKind
| Variant | Fields |
|---|---|
| Srlp | unit |
| Hlp | unit |
| Junior | unit |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] | ||
| owner | writable · signer | ||
| asset_mint | |||
| lp_mint | |||
| yield_account | writable | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
set_harvest_authority
Name, rotate or revoke a key allowed to trigger harvest without being able to redirect it.
- Caller
- The LP owner
- Discriminator
3bb595a363946a85
Arguments
args: SetHarvestAuthorityArgs
| Field | Type | Notes |
|---|---|---|
| token_kind | YieldTokenKind | |
| harvest_authority | Option<pubkey> | `None` revokes the independent caller; the recipient is unchanged. |
YieldTokenKind
| Variant | Fields |
|---|---|
| Srlp | unit |
| Hlp | unit |
| Junior | unit |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] | ||
| owner | writable · signer | ||
| asset_mint | |||
| lp_mint | |||
| yield_account | writable | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
initialize_lp_transfer_hook
Create the transfer-hook validation account an LP mint needs before its tokens can move.
- Caller
- Any payer, usually at market creation
- Discriminator
cf39da68b39c16c4
Arguments
None.
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| payer | writable · signer | ||
| market | |||
| lp_mint | |||
| validation_account | writable | against `lp_mint` and owned by Dusk after initialization. | |
| system_program | 11111111…1111 |
initialize_junior
Create the market's active jrLP mint, permanent seed claim and first junior cohort.
The seed starts the junior income ledger at market launch so junior APY is observable before an external underwriter joins. After a wipeout, the same instruction retires the wiped cohort and opens the next generation's mint.
- Caller
- Anyone; the launch flow opens the first generation
- Discriminator
b3ef7964584a0c42
Arguments
args: InitializeJuniorArgs
| Field | Type | Notes |
|---|---|---|
| generation | u64 | |
| metadata | InitializeLpMetadataArgs |
InitializeLpMetadataArgs
| Field | Type | Notes |
|---|---|---|
| name | string | |
| symbol | string | |
| uri | string |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| payer | writable · signer | ||
| market | writable | ||
| junior_mint | writable | PDA ["junior_mint", market, args.args.generation] | |
| cohort | writable | PDA ["junior_cohort", market, junior_mint] | |
| previous_cohort | writable · optional | ||
| token_metadata | writable | ||
| sysvar_instructions | Sysvar1n…1111 | ||
| token_metadata_program | metaqbxx…8x1s | ||
| token_2022_program | TokenzQd…xuEb | ||
| system_program | 11111111…1111 | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
fund_junior_seed
Move the permanent junior seed's collected interest from the interest vault into reserve fee custody, ready to be compounded.
- Caller
- Anyone
- Discriminator
f5c6dce860403347- Emits
- JuniorSeedFunded
Arguments
None.
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | writable | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] | |
| asset_mint | |||
| reserve_vault | writable | ||
| interest_vault | writable | ||
| token_program | Tokenkeg…Q5DA | ||
| token_2022_program | TokenzQd…xuEb | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
compound_junior_seed
Compound the permanent seed's earned income back into junior reserve shares.
The caller sets no slippage bound, so it runs only while the spot price is within 1 bp of the curve's centre average.
- Caller
- Anyone
- Discriminator
9178f42c0025f324- Emits
- JuniorSeedCompounded
Arguments
None.
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | writable | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] | |
| futarchy_authority | PDA ["futarchy_authority"] | ||
| junior_mint | |||
| event_authority | PDA ["__event_authority"] | ||
| program |
convert_tranche
Convert srLP into first-loss jrLP, or manage a noticed junior exit back into srLP.
Entry is immediate. Exit requests burn jrLP into a live junior claim that keeps taking losses and earning junior income through a notice of seven days plus up to three more by queue share, then a two-day exercise window. The fixed 50 bps request fee goes to the permanent seed. Cancel at any time to keep junior; changing or restarting an exit requires cancellation and a fresh nonzero request with a full notice and fee.
- Caller
- The LP holder
- In the app
- Liquidity · Risk & yield
- Discriminator
c0da84caf7174be6- Emits
- TrancheConverted
Arguments
action: TrancheAction
| Variant | Fields |
|---|---|
| Enter | senior_amount: u64, minimum_junior: u64 |
| RequestExit | junior_amount: u64 |
| ConvertExit | minimum_senior: u64 |
| CancelExit | unit |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| owner | writable · signer | ||
| market | writable | ||
| futarchy_authority | PDA ["futarchy_authority"] | ||
| senior_mint | writable | ||
| junior_mint | writable | ||
| owner_senior | writable | ||
| owner_junior | writable | ||
| exit | writable | PDA ["junior_exit", market, owner, junior_mint] | |
| senior_base_yield | writable | ||
| senior_quote_yield | writable | ||
| junior_base_yield | writable | ||
| junior_quote_yield | writable | ||
| token_2022_program | TokenzQd…xuEb | ||
| system_program | 11111111…1111 | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
burn_retired_junior
Burn a receipt from a retired junior cohort after preserving its historical income claim.
- Caller
- The retired jrLP holder
- Discriminator
b4198b922f14a887- Emits
- RetiredJuniorBurned
Arguments
args: BurnRetiredJuniorArgs
| Field | Type | Notes |
|---|---|---|
| amount | u64 |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] | ||
| owner | signer | ||
| retired_mint | writable | ||
| cohort | PDA ["junior_cohort", market, retired_mint] | ||
| owner_junior | writable | ||
| base_yield | writable | ||
| quote_yield | writable | ||
| exit | writable · optional | ||
| token_2022_program | TokenzQd…xuEb | ||
| event_authority | PDA ["__event_authority"] | ||
| program |
checkpoint_income
Checkpoint one holder's senior or junior income before its eligible balance changes.
- Caller
- Anyone; it cannot redirect or redeem the income
- Discriminator
3067fa41c964b2ed
Arguments
args: CheckpointIncomeArgs
| Field | Type | Notes |
|---|---|---|
| source | u8 |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| market | PDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash] | ||
| lp_mint | |||
| owner_lp | |||
| yield_account | writable |
roll_income_epoch
Close a paid-income epoch and open the next immutable receivable accounting period.
Once a book's unpaid balance has been paid down to zero, it cannot book new interest until it is rolled, so the market's next interest accrual fails until someone calls this.
- Caller
- Anyone
- Discriminator
04d9e4876150ae64
Arguments
args: RollIncomeEpochArgs
| Field | Type | Notes |
|---|---|---|
| book_index | u8 | |
| epoch | u64 |
Accounts
| Account | Flags | Resolution | Notes |
|---|---|---|---|
| payer | writable · signer | ||
| market | writable | ||
| income_epoch | writable | ||
| system_program | 11111111…1111 |