Skip to content

Program Instructions

Program ID: 8A3VegJ9k5mcXr1AeXgGD4Zr6XrAdyWnNiCK1AUTidey (mainnet)

Sets up the global ProgramConfig with the protocol fee rate. Admin-only.

ParameterTypeDescription
fee_bpsu16Protocol fee in basis points (max 100)

Signer: Admin


Creates a new advisory account linking an owner to an advisor.

ParameterTypeDescription
owner_encryption_key[u8; 32]Owner’s x25519 public key

Signer: Owner PDA: ["advisory", owner_pubkey] Initial status: Pending


Advisor accepts a pending invitation and sets their fee.

ParameterTypeDescription
advisor_fee_bpsu16Advisor commission (0-100 bps)

Signer: Advisor (must match advisory account’s advisor field) Status transition: Pending -> Active


Owner revokes the advisor relationship. No new proposals can be created.

Signer: Owner Status transition: Active -> Revoked


Closes the advisory account and returns rent to the owner.

Signer: Owner Prerequisite: All proposals must be in terminal state


Updates the owner’s x25519 public key on-chain.

ParameterTypeDescription
owner_encryption_key[u8; 32]New x25519 public key

Signer: Owner


Advisor creates an encrypted trade proposal.

ParameterTypeDescription
encrypted_dataVec<u8>Encrypted ProposalPayload (max 512 bytes)

Signer: Advisor PDA: ["proposal", advisory_account, proposal_count] Prerequisite: Advisory account must be Active Initial status: Pending


Owner decrypts, reviews, and approves a proposal with execution parameters.

ParameterTypeDescription
execution_window_secondsi64Time advisor has to execute (60-86400s)
amountu64Input token amount (before fees)
other_amount_thresholdu64Slippage protection (min output)
amount_specified_is_inputboolTrue if amount is input
a_to_bboolSwap direction
poolPubkeyRaydium pool address
token_mint_aPubkeyToken A mint
token_mint_bPubkeyToken B mint
pool_typeenumCpmm or Clmm

Signer: Owner Status transition: Pending -> Approved


Owner rejects a proposal.

Signer: Owner Status transition: Pending -> Rejected


Closes a proposal and reclaims rent. Allowed when proposal is in a terminal state (Executed, Rejected, Expired, Cancelled) or past its execution deadline.

Signer: Owner or Advisor


Executes an approved swap via Raydium CP-Swap (CPMM).

Signer: Advisor Prerequisite: Proposal status Approved, within execution deadline Status transition: Approved -> Executed

Fee deduction:

program_fee = (amount * program_fee_bps) / 10_000
advisor_fee = (amount * advisor_fee_bps) / 10_000
swap_amount = amount - program_fee - advisor_fee

Same as executeProposal but routes through Raydium CLMM (concentrated liquidity).

Signer: Advisor Additional accounts: 3 tick array PDAs for the swap direction


Initializes a token vault for a specific mint under an advisory account.

Signer: Any (payer) PDA: ["vault", advisory_account, token_mint]


Owner deposits tokens into a vault. Creates the vault if it doesn’t exist.

ParameterTypeDescription
amountu64Token amount (must be > 0)

Signer: Owner


Owner withdraws tokens from a vault.

ParameterTypeDescription
amountu64Token amount

Signer: Owner


Advisor withdraws accumulated advisor fees.

Signer: Advisor