open_perp=true, which
simultaneously opens the matching SOL short to keep the vault delta-neutral.
1. Resolve PDAs
2. Post the oracle (required for the spot leg)
Same pattern as the perp guide, Hermes fetch +PythSolanaReceiver.buildPostPriceUpdateInstructions.
3. Deposit
What happens on chain
Mint shares
Shares minted to
userShareAta:
sharesOut = amount × totalShares / NAV (or amount on the first deposit).Claim funding
Accrued funding is not live, it only updates NAV when someone cranksclaim_funding. Anyone can do this. The vault auto-settles via CPI:
Withdraw
closePerp=true, the vault buys back a share-weighted portion of the perp
short and swaps the corresponding wSOL back to USDC before returning funds.
