Skip to content

Account Layout

PDA seeds: ["advisory", owner_pubkey]

OffsetSizeFieldType
08Discriminator[u8; 8]
832ownerPubkey
4032advisorPubkey
728proposal_countu64 (LE)
802active_proposalsu16 (LE)
828created_ati64 (LE, Unix timestamp)
902advisor_fee_bpsu16 (LE)
921statusu8 (0=Pending, 1=Active, 2=Revoked)
931bumpu8
9432owner_encryption_key[u8; 32]

PDA seeds: ["proposal", advisory_account_pubkey, proposal_count_le_bytes]

OffsetSizeFieldType
08Discriminator[u8; 8]
832advisory_accountPubkey
4032advisorPubkey
7232ownerPubkey
1048proposal_idu64 (LE)
1121statusu8
1134encrypted_data.len()u32 (LE, Borsh Vec prefix)
117Nencrypted_data[u8; N]

Proposal status values: 0=Pending, 1=Approved, 2=Executed, 3=Rejected, 4=Expired, 5=Cancelled

All offsets below are relative to base = 117 + N where N is the encrypted_data length.

OffsetSizeFieldType
base+08amountu64 (LE)
base+88other_amount_thresholdu64 (LE)
base+161amount_specified_is_inputbool
base+171a_to_bbool
base+1832poolPubkey
base+5032token_mint_aPubkey
base+8232token_mint_bPubkey
base+1141pool_typeu8 (0=Cpmm, 1=Clmm)
base+1158created_ati64 (LE)
base+1238approved_ati64 (LE)
base+1318execution_deadlinei64 (LE)
base+1398executed_ati64 (LE)
base+1471bumpu8

The encrypted_data field contains an encrypted JSON payload with this structure:

{
"rationale": "string — advisor's reasoning for the trade",
"amount": 1000000,
"other_amount_threshold": 5000000,
"amount_specified_is_input": true,
"a_to_b": true,
"pool": "base58 Raydium pool address",
"token_mint_a": "base58 mint address",
"token_mint_b": "base58 mint address",
"pool_type": "cpmm"
}
OffsetSizeField
01Version (0x01=v1, 0x02=v2)
132Sender x25519 public key
3324NaCl nonce
57N+16NaCl box ciphertext (plaintext + 16-byte MAC)

Total overhead: 73 bytes. Max encrypted payload: 512 bytes.

PDA seeds: ["vault", advisory_account_pubkey, token_mint_pubkey]

A standard SPL Token Account owned by the program’s authority PDA (["authority"]). No custom data layout — uses the standard 165-byte token account structure.

PDA seeds: ["program_config"]

OffsetSizeFieldType
08Discriminator[u8; 8]
832adminPubkey
402fee_bpsu16 (LE)
421bumpu8
AccountSeeds
Advisory Account["advisory", owner_pubkey]
Proposal["proposal", advisory_account, proposal_count (8 bytes LE)]
Vault["vault", advisory_account, token_mint]
Authority["authority"]
Program Config["program_config"]
Fee Vault["fee_vault"]