Creates the position, escrows margin and two keeper fees, reserves open interest
execute_open
none
Anyone
Fills a PendingOpen at the first signed price at or after the target
cancel_open
none
Anyone (refund goes to the owner)
Returns margin and both keeper fees to the owner once fill_target + fill_max_gap_secs + cancel_grace_secs has passed
request_close
none
Trader
Moves an Open position to PendingClose and sets its fill_target; takes owner, config, position
execute_close
none
Anyone
Fills the close, pays or queues a win, records a loss for emission
liquidate
none
Anyone
Busts a position past its trigger and pays the liquidator's reward
harvest
none
Anyone
Pays the head of the payout queue from pool cash
Prices
Instruction
Arguments
Signer
Effect
post_price
feed_id: [u8; 32], publish_time: i64
Anyone (pays the rent)
Writes one market's signed price for one second into PriceUpdate (PDA ["price", feed_id, publish_time i64 LE]). The instruction right before it must be an ed25519 check carrying oracle_threshold signatures from the signer set over the 108-byte message
close_price
none
The payer
Closes a used price account and returns its rent
The signed message is "RKLSPX01", the program id, the feed id, price: i64, conf: u64, exponent: i32, publish_time: i64 and prev_publish_time: i64, little endian, 108 bytes. The ed25519 instruction holds exactly oracle_threshold signatures. It lists the offset entries first, then each key followed by its signature, then the message, with every instruction index set to u16::MAX.
Ownership
Instruction
Arguments
Signer
Effect
close_epoch
remaining accounts: every market and its price, in index order
Anyone
Marks the pool to market and fixes the epoch's tokens
claim_emission
none
Anyone pays (payer), tokens go to the owner
Mints an AwaitingMint position's share of its closed epoch's tokens, then closes the position and returns its rent to the owner
stake
amount: u64
Staker
Moves venue tokens into the stake vault
unstake
amount: u64
Staker
Returns tokens after unstake_cooldown_secs
claim_rewards
none
Staker
Pays accrued USDC rewards
close_stake
none
Staker
Closes an empty stake account and returns its rent
sweep_surplus
none
Anyone
Moves pool cash above pool_soft_cap to stakers while the queue is empty
buyback_burn
none
Anyone
Spends the buyback bucket on the venue token through the configured pool and burns it
Admin
Instruction
Arguments
Effect
initialize
params: Params
Creates Config and the venue mint; only the upgrade authority may call it
finish_setup
none
Creates the emission ledger, the USDC vault, the stake vault and the buyback account