Skip to content

Latest commit

 

History

History

swaps

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Swaps Module

Legacy module which implements Balancer style liquidity pools.

Overview

See the Balancer whitepaper for details.

Terminology

  • Exit: Refers to removing (part of) the liquidity from a liquidity pool in exchange for burning pool shares. Amounts received by the LP are proportional to their ownership of the pool.
  • Join: Refers to adding more liquidity to a pool and receiving pool shares in return. Amounts moved into the pool are proportional to the LP's ownership of the pool.
  • Liquidity provider: A user who owns pool shares indicating their stake in the liquidity pool.
  • Pool Shares: A token indicating the owner's per rate share of the liquidity pool.
  • Single Asset Operation: An operation which combines joining or withdrawing from the pool and selling unwanted tokens. The end result is like entering (resp. leaving) the pool but paying (resp. receiving payment) in a single asset.
  • Swap fees: Part of the collateral paid or received by informants that is moved to a separate account owned by the liquidity providers. They need to be withdrawn using the withdraw_fees extrinsic.

Exact Amounts

Almost all operations come in two variants, one where the assets entering the pool are exact, the other where the assets leaving the pool are exact. Due to the permissionless nature of the pallet, if multiple trades are placed in the same block, the non-exact amount might slip for some of the parties.