Functions

This section provides detailed documentation for all functions available in the CoolDEX contract.

Available Functions

  1. Admin Initialize Pool - Creates a new liquidity pool on the DEX

  2. Swap Base In - Swaps tokens by specifying the input amount

  3. Swap Base Out - Swaps tokens by specifying the output amount

  4. Deposit - Adds liquidity to a pool

  5. Withdraw - Removes liquidity from a pool

  6. Withdraw PnL - Withdraws accumulated profit and loss

Each function documentation includes:

  • Parameter descriptions

  • Required accounts

  • Function logic

  • Example usage

Last updated