Advanced
Fees
Initialize, collect, and close protocol fee vaults.
Pre-alpha — not production ready
aura-sdk targets Solana devnet only. APIs may change without notice. Do not use for real funds until a stable release and audit are published.
init_fee_vault
Initialize the protocol fee vault for a treasury.
// Build only
let instruction = client.init_fee_vault_instruction(accounts, protocol_fee_recipient, now);
// Build + send
client.init_fee_vault(&owner, accounts, protocol_fee_recipient, now)?;client.init_fee_vault(
&owner,
aura_core::accounts::InitFeeVault {
owner: owner.pubkey(),
treasury,
fee_vault: fee_vault_pda,
system_program: anchor_lang::system_program::ID,
},
protocol_fee_recipient,
now,
)?;collect_fees
Drain accumulated protocol fees from the vault. Only callable by the authorized protocol_authority.
// Build only
let instruction = client.collect_fees_instruction(accounts, now);
// Build + send
client.collect_fees(&protocol_authority, accounts, now)?;client.collect_fees(
&protocol_authority,
aura_core::accounts::CollectFees {
protocol_authority: protocol_authority.pubkey(),
fee_vault: fee_vault_pda,
recipient: recipient_pubkey,
},
now,
)?;close_fee_vault
Close the fee vault and reclaim rent. Only callable by the treasury owner.
// Build only
let instruction = client.close_fee_vault_instruction(accounts);
// Build + send
client.close_fee_vault(&owner, accounts)?;client.close_fee_vault(
&owner,
aura_core::accounts::CloseFeeVault {
owner: owner.pubkey(),
treasury,
fee_vault: fee_vault_pda,
},
)?;