Uniswap V2 Pallet Extrinsics

Create

create

Create a new pool.

Emits PoolCreated even when successful.

Buy

buy

Execute a buy order on a pool.

The base_amount always represent the base asset amount (A/B => A).

Emits Swapped event when successful.

Sell

sell

Execute a sell order on a pool.

The base_amount always represent the base asset amount (A/B => A).

Emits Swapped event when successful.

Swap

swap

Execute a specific swap operation.

Buy operation if the pair is the original pool pair (A/B). Sell operation if the pair is the original pool pair swapped (B/A).

The quote_amount is always the quote asset amount (A/B => B), (B/A => A).

Emits Swapped event when successful.

Add Liquidity

add_liquidity

Add liquidity to a constant_product pool.

Emits LiquidityAdded event when successful.

Remove Liquidity

remove_liquidity

Remove liquidity from constant_product pool.

Emits LiquidityRemoved event when successful.