PS-Docs
  • 🚀Hello! PumpSpace
  • PumpSpace
    • 📊Bonding Curve
    • 👫How to Participate?
    • 👑How to Launch?
    • 💵Protocol Fees
    • 💰PumpSpace Reward
  • AquaSpace
    • ⏳Tokenomics
    • 👮‍♂️Audit Report
    • 📖Content Policy
    • 📚Terms and Conditions
  • Contract
    • Token
    • Factory
    • Router
    • Pair
  • 👥 Resources
    • PumpSpace (Website)
    • X (Twitter)
    • Telegram
    • BlueWhale (Website)
    • BlueWhale (Telegram)
Powered by GitBook
On this page
  1. Contract

Pair

The Pair contract represents a liquidity pool for a specific token pair. It manages token balances, tracks reserves, and handles the logic for token swaps within the PumpSpace protocol.

Each Pair is uniquely created by the Factory and is responsible for maintaining the state and rules of a single trading pair.


Functions

token0

  • Returns the address of the first token in the pair (sorted by address).

function token0() external view returns (address);

token1

  • Returns the address of the second token in the pair (sorted by address).

function token1() external view returns (address);

getReserves

  • Returns the current reserves of token0 and token1, along with the timestamp of the last block in which the reserves were updated.

function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);

swap

  • Swaps tokens within the pair contract. Either amount0Out or amount1Out must be non-zero. Used internally during trades initiated via the Router.

function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;

PreviousRouter

Last updated 2 months ago