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

FieldTypeNotes
deposit_amountu64Target-asset atoms to deposit.
min_hlp_amountu64Minimum hLP shares to receive.

Accounts

AccountFlagsResolutionNotes
marketwritable
futarchy_authority
ownerwritable · signer
base_mint
quote_mint
srlp_mintwritable
target_hlp_mintwritable
base_reserve_vaultwritable
quote_reserve_vaultwritable
owner_target_accountwritable
owner_hlp_accountwritable
hlp_srlp_accountwritableauthority are all validated before any market mutation. A System-owned empty PDA is initialized inline by the deposit handler.
base_yield_accountwritable
quote_yield_accountwritable
token_programTokenkeg…Q5DA
token_2022_programTokenzQd…xuEb
system_program11111111…1111
event_authorityPDA ["__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

FieldTypeNotes
hlp_amountu64hLP shares to burn.
min_target_amount_outu64Minimum target-asset atoms returned.

Accounts

AccountFlagsResolutionNotes
marketwritable
futarchy_authority
ownerwritable · signer
base_mint
quote_mint
srlp_mintwritable
target_hlp_mintwritable
base_reserve_vaultwritable
quote_reserve_vaultwritable
borrowed_interest_vaultwritable
owner_target_accountwritable
owner_hlp_accountwritable
hlp_srlp_accountwritablePDA ["hlp_ylp_vault", market, target_hlp_mint, srlp_mint]
base_yield_accountwritable
quote_yield_accountwritable
token_programTokenkeg…Q5DA
token_2022_programTokenzQd…xuEb
event_authorityPDA ["__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

AccountFlagsResolutionNotes
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

FieldTypeNotes
target_assetu8
hlp_amountu64

Accounts

AccountFlagsResolutionNotes
marketwritablePDA ["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

ArgumentTypeNotes
target_assetu8

Accounts

AccountFlagsResolutionNotes
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

Arguments

args: BeginHlpFlashArgs

FieldTypeNotes
target_assetu8
max_paymentu64
allow_fullbool
max_socialized_lossu64
max_collateral_debitu64
min_collateral_creditu64
settle_indexu16

Accounts

AccountFlagsResolutionNotes
accounts.marketwritable
accounts.futarchy_authority
accounts.buyerwritable · signer
accounts.target_mint
accounts.borrowed_mint
accounts.target_reservewritable
accounts.borrowed_reservewritable
accounts.buyer_collateral_accountwritable
accounts.buyer_refund_accountwritable
accounts.token_programTokenkeg…Q5DA
accounts.token_2022_programTokenzQd…xuEb
accounts.borrowed_token_program
sessionwritable
repayment_vaultwritablePDA ["hlp-flash-payment", session]
instructionsSysvar1n…1111
system_program11111111…1111
event_authorityPDA ["__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

AccountFlagsResolutionNotes
accounts.marketwritable
accounts.futarchy_authority
accounts.buyerwritable · signer
accounts.target_mint
accounts.borrowed_mint
accounts.target_reservewritable
accounts.borrowed_reservewritable
accounts.buyer_collateral_accountwritable
accounts.buyer_refund_accountwritable
accounts.token_programTokenkeg…Q5DA
accounts.token_2022_programTokenzQd…xuEb
accounts.borrowed_token_program
sessionwritable
repayment_vaultwritablePDA ["hlp-flash-payment", session]
instructionsSysvar1n…1111
event_authorityPDA ["__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

FieldTypeNotes
target_assetu8
max_socialized_lossu64
min_caller_bounty_outu64

Accounts

AccountFlagsResolutionNotes
marketwritable
futarchy_authority
callerwritable · signer
borrowed_mint
borrowed_reserve_vaultwritable
borrowed_interest_vaultwritable
caller_bounty_accountwritable
srlp_mintwritable
target_hlp_srlp_vaultwritable
token_programTokenkeg…Q5DA
token_2022_programTokenzQd…xuEb
event_authorityPDA ["__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

Arguments

args: RotateHlpCohortArgs

FieldTypeNotes
target_assetu8
metadataInitializeLpMetadataArgs
InitializeLpMetadataArgs
FieldTypeNotes
namestring
symbolstring
uristring

Accounts

AccountFlagsResolutionNotes
payerwritable · signer
marketwritable
old_hlp_mint
new_hlp_mintwritable
old_cohortwritablePDA ["hlp_cohort", market, old_hlp_mint]
new_token_metadatawritablePDA ["metadata", "0x0b7065b1e3d17c45389d527f6b04c3cd58b86c731aa0fdb549b6d1bc03f82946", new_hlp_mint]
sysvar_instructionsSysvar1n…1111
token_2022_programTokenzQd…xuEb
token_metadata_programmetaqbxx…8x1s
system_program11111111…1111
event_authorityPDA ["__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

FieldTypeNotes
amountu64

Accounts

AccountFlagsResolutionNotes
marketPDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash]
ownerwritable · signer
retired_mintwritable
cohortwritablePDA ["hlp_cohort", market, retired_mint]
owner_hlp_accountwritable
base_yield_accountwritable
quote_yield_accountwritable
token_2022_programTokenzQd…xuEb
event_authorityPDA ["__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

FieldTypeNotes
max_base_grossu64Gross public interest to fund, including the frozen protocol allocation.
max_quote_grossu64

Accounts

AccountFlagsResolutionNotes
marketwritable
futarchy_authority
callersigner
base_mint
quote_mint
base_reserve_vaultwritable
quote_reserve_vaultwritable
base_interest_vaultwritable
quote_interest_vaultwritable
token_programTokenkeg…Q5DA
token_2022_programTokenzQd…xuEb
event_authorityPDA ["__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

FieldTypeNotes
ownerpubkey
token_kindYieldTokenKind
YieldTokenKind
VariantFields
Srlpunit
Hlpunit
Juniorunit

Accounts

AccountFlagsResolutionNotes
payerwritable · signer
marketwritablePDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash]
futarchy_authorityPDA ["futarchy_authority"]
lp_mint
base_mint
quote_mint
base_yield_accountwritable
quote_yield_accountwritable
system_program11111111…1111
event_authorityPDA ["__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

AccountFlagsResolutionNotes
payerwritable · signer
yield_accountwritableread this account, so a typed account here would fail the very case this instruction exists to repair.
system_program11111111…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

Arguments

args: HarvestArgs

FieldTypeNotes
token_kindYieldTokenKind0 for srLP, 1 for hLP, 2 for jrLP.
YieldTokenKind
VariantFields
Srlpunit
Hlpunit
Juniorunit

Accounts

AccountFlagsResolutionNotes
marketwritablePDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash]
futarchy_authorityPDA ["futarchy_authority"]
ownerLP holder identity. Its signature is not required when the designated recipient or harvest authority signs instead.
callersignerThe LP holder, designated recipient, or harvest authority. Checked in validation.
asset_mint
lp_mint
owner_lp_accountwritable
reserve_vaultwritable
interest_vaultwritable
recipient_asset_accountwritable
yield_accountwritable
token_programTokenkeg…Q5DA
token_2022_programTokenzQd…xuEb
event_authorityPDA ["__event_authority"]
program

set_yield_recipient

Change where a yield account's claims are paid.

Caller
The LP owner
Discriminator
b2d3500a8a34bc16

Arguments

args: SetYieldRecipientArgs

FieldTypeNotes
token_kindYieldTokenKind
recipientpubkey
YieldTokenKind
VariantFields
Srlpunit
Hlpunit
Juniorunit

Accounts

AccountFlagsResolutionNotes
marketPDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash]
ownerwritable · signer
asset_mint
lp_mint
yield_accountwritable
event_authorityPDA ["__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

FieldTypeNotes
token_kindYieldTokenKind
harvest_authorityOption<pubkey>`None` revokes the independent caller; the recipient is unchanged.
YieldTokenKind
VariantFields
Srlpunit
Hlpunit
Juniorunit

Accounts

AccountFlagsResolutionNotes
marketPDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash]
ownerwritable · signer
asset_mint
lp_mint
yield_accountwritable
event_authorityPDA ["__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

AccountFlagsResolutionNotes
payerwritable · signer
market
lp_mint
validation_accountwritableagainst `lp_mint` and owned by Dusk after initialization.
system_program11111111…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

FieldTypeNotes
generationu64
metadataInitializeLpMetadataArgs
InitializeLpMetadataArgs
FieldTypeNotes
namestring
symbolstring
uristring

Accounts

AccountFlagsResolutionNotes
payerwritable · signer
marketwritable
junior_mintwritablePDA ["junior_mint", market, args.args.generation]
cohortwritablePDA ["junior_cohort", market, junior_mint]
previous_cohortwritable · optional
token_metadatawritable
sysvar_instructionsSysvar1n…1111
token_metadata_programmetaqbxx…8x1s
token_2022_programTokenzQd…xuEb
system_program11111111…1111
event_authorityPDA ["__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

Arguments

None.

Accounts

AccountFlagsResolutionNotes
marketwritablePDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash]
asset_mint
reserve_vaultwritable
interest_vaultwritable
token_programTokenkeg…Q5DA
token_2022_programTokenzQd…xuEb
event_authorityPDA ["__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

Arguments

None.

Accounts

AccountFlagsResolutionNotes
marketwritablePDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash]
futarchy_authorityPDA ["futarchy_authority"]
junior_mint
event_authorityPDA ["__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

Arguments

action: TrancheAction

VariantFields
Entersenior_amount: u64, minimum_junior: u64
RequestExitjunior_amount: u64
ConvertExitminimum_senior: u64
CancelExitunit

Accounts

AccountFlagsResolutionNotes
ownerwritable · signer
marketwritable
futarchy_authorityPDA ["futarchy_authority"]
senior_mintwritable
junior_mintwritable
owner_seniorwritable
owner_juniorwritable
exitwritablePDA ["junior_exit", market, owner, junior_mint]
senior_base_yieldwritable
senior_quote_yieldwritable
junior_base_yieldwritable
junior_quote_yieldwritable
token_2022_programTokenzQd…xuEb
system_program11111111…1111
event_authorityPDA ["__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

Arguments

args: BurnRetiredJuniorArgs

FieldTypeNotes
amountu64

Accounts

AccountFlagsResolutionNotes
marketPDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash]
ownersigner
retired_mintwritable
cohortPDA ["junior_cohort", market, retired_mint]
owner_juniorwritable
base_yieldwritable
quote_yieldwritable
exitwritable · optional
token_2022_programTokenzQd…xuEb
event_authorityPDA ["__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

FieldTypeNotes
sourceu8

Accounts

AccountFlagsResolutionNotes
marketPDA ["market_v2", market.base_side.asset_mint, market.quote_side.asset_mint, market.params_hash]
lp_mint
owner_lp
yield_accountwritable

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

FieldTypeNotes
book_indexu8
epochu64

Accounts

AccountFlagsResolutionNotes
payerwritable · signer
marketwritable
income_epochwritable
system_program11111111…1111