Router

The Router smart contract serves as the primary interface for interacting with the PumpSpace decentralized exchange. It handles token swaps, adding/removing liquidity, and routing logic through the Factory and Pair contracts.

Address

0xE8A55f6b4EE94D2DBe02e724bC23228E15a59946

๐Ÿ“ The contract is verified on Avalanche C-Chain Explorer, and its source code can be publicly viewed there.


Functions

addLiquidity

Adds liquidity to a token pair pool. If the pool does not exist, it is created via the Factory.

function addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);

addLiquidityETH

Adds liquidity to a token-ETH pool. If the pool doesn't exist, it is created via the Factory.

removeLiquidity

Removes liquidity from a token pair pool, returning the underlying tokens.

removeLiquidityETH

Removes liquidity from a token-ETH pool, returning both token and ETH to the user.


swapExactTokensForTokens

Swaps an exact amount of tokens for another token through one or more pools.

swapExactETHForTokens

Swaps an exact amount of ETH for as many output tokens as possible.

swapExactTokensForETH

Swaps an exact amount of tokens for as much ETH as possible.


getAmountsOut

Given an input amount and token path, returns the expected output amounts at each swap step.

getAmountsIn

Given a desired output amount and token path, returns the required input amounts at each swap step.