Sailfish Swap is our automated market maker (AMM) which facilitates swaps between pairs of tokens. We follow a constant-product formula to maintain an equal weight of each token in a pair. Liquidity providers can deposit any pair of tokens into the liquidity pool to start making markets and earning trading commissions. Traders can swap between any token pair that exists in the liquidity pool.
All functions are batch operations. Batches are not atomic, meaning that requests will be executed sequentially until one fails. Individual requests, however, are atomic.
Any pair of asset can be deposited into the liquidity pool. If that market doesn't exist, it will be created. In return, a new Sailfish LP Token is minted and issued to the depositor. The LP token is a claim the assets inside the pool, along with fees earned from traders. LP Tokens can be freely transferred and traded, and be redeemed at any time by calling the
Each individual market (eg. ICPT/CYCLE) has its own LP Token.
The total number of LP Tokens per market is variable. Each deposit or withdraw will mint or burn LP tokens, respectively.
You can calculate your percentage ownership of a liquidity pool by dividing your number of tokens by the total.
LP Tokens can be redeemed for the underlying tokens along with earned fees.
This function burns LP Tokens and transfers all underlying tokens to the owner.
Swaps one token for another, assuming that the market exists.
Gets the latest quote. For the desired pair and amount, return the expected swap amounts and average price.
Retrieves information for specified or all liquidity pools. Returns token balances, LP Token data, and fee data.
Get All Tokens
Retrieves the list of all unique tokens deposited.