Updates the global platform base token restriction. Only the program upgrade authority may call this.
Accounts
authority(signer): upgrade authorityconfig(PDA): platform configsystem_programprogram_data(upgradeable loader data)
Updates the platform-wide fee in basis points. Only the program upgrade authority may call this.
Accounts
authority(signer): upgrade authorityconfig(PDA): platform config
Updates the platform fee beneficiary. Only the program upgrade authority may call this.
Accounts
authority(signer): upgrade authorityconfig(PDA): platform config
Creates a new pool for mint_a/mint_b with virtual liquidity and custom fees. Requires funding initial_token_b_reserves only.
Accounts
payer(signer)owner(signer)token_wallet_authority(signer)mint_a,mint_btoken_wallet_b(token account)pool(PDA)vault_a,vault_b(PDAs)token_program_a,token_program_bsystem_program,rentconfig(platform config)
Swaps token A for token B (user buys token B). Fees are charged in token A.
Swaps token B for token A (user sells token B). Fees are charged in token A.
Return deterministic swap results without moving tokens.
authority: Pubkeyfee_beneficiary: Pubkeybase_token: Pubkeyplatform_fee_bps: u16bump: u8
enabled: boolowner: Pubkeymint_a: Pubkeymint_b: Pubkeytoken_a_reserves: u128token_b_reserves: u128shift: u128fee_beneficiary_count: u8fee_beneficiaries: [FeeBeneficiary; 5]bump: u8
wallet: Pubkeyshare_bps: u16
pool:PDA("pool", owner, mint_a, mint_b)vault_a:PDA(pool, mint_a)vault_b:PDA(pool, mint_b)config:PDA("config")
await program.methods
.create({
shift: new anchor.BN(1_000_000),
initialTokenBReserves: 100_000,
feeBeneficiaries: [
{ wallet: beneficiaryOne, shareBps: 200 },
{ wallet: beneficiaryTwo, shareBps: 300 },
],
})
.accounts({ /* ... */ })
.rpc();await program.methods
.buy({ amount: 10_000, limit: 1 })
.accounts({ /* ... */ })
.rpc();shift adds virtual liquidity to token A reserves. Pricing uses
token_a_reserves + shift as the effective reserve, allowing pools to launch without
initial token A deposits.