Skip to main content

Pool creation

create_pool takes token IDs, fee, Q128.128 initial square-root price, spacing, and initial tick. It sorts the token IDs, returns the pool key and signer, and initializes the pool through its finalizer.

Position creation

mint takes a private nonce, two token records, a private owner recipient, a private immutable withdrawal address, a public MintPositionRequest, public token IDs, and three pairs of freezelist non-inclusion proofs. It returns a public token ID, a PositionNFT, two change records, a MintComplianceRecord, and a finalizer.

Position management

increase_liquidity consumes a PositionNFT and two token records. It returns a replacement NFT and two change records. decrease_liquidity consumes a PositionNFT. Principal becomes public tokens_owed accounting until collect. collect consumes a PositionNFT, validates non-inclusion proofs for its owner and immutable withdrawal address, and sends two token records to that withdrawal address. The caller cannot select a new payout recipient. burn requires zero liquidity, zero owed balances, and no active freeze. It removes the public position and consumes the NFT.

Trading

swap performs one pool swap. swap_multi_hop performs two or three connected pool swaps. Both use a fresh factor and public confidential address, create an investigator-owned compliance record, and write the same SwapOutput shape. claim_swap_output settles both swap paths. It validates freezelist non-inclusion for the signer, sends the output and any remaining original input to encrypted token records, and removes the pending mapping entry.

Wrapped assets

Use shield_swap_router.aleo when a swap input, output, or refund crosses a wrapper boundary. Use shield_swap_lp_router.aleo when mint, increase, collect, or protocol-fee collection crosses that boundary. Read the deployment asset registry before choosing a core or router function. See Entry-point signatures for the current function inventory.