Skip to main content

· 5 min read
Azard·D·Scarlet

AnimeSwap v1 is a protocol of decentralized exchange (DEX) and automated market maker (AMM) runs on Move Virtual Machine. Anyone could interact with the protocol for swaping coins and earn coins.

AnimeSwap protocol has three basic usages:

  • Swap: create a completely free trading experience for everyone.
  • Earn: earn with automated market maker in a easiest way, more profit, less loss.
  • Build: as a public protocol that every DApp, every tools and every one could connect, as a infrastructure to improve on-chain liquidity.

The Model

x * y = k

AnimeSwap not including multiple model in one protocol, only using one model, and the model is the core of the protocol.

x * y = k AMM model is widely used because of Uniswap v2, its a very generic AMM model and amolst suitable for all scenarios.

Each trade pair including exactly two coins in order of address alphabet. On the other hand, each two coins has match one exactly trade pair if the pair has been created.

Some special scenario such as two different USD stable coins, its price is more relatively and in most time 1:1. Other models like Curve and Uniswap v3 can provide higher liquidity efficiency.

But for early Aptos network, relative pair is not very important and not widely used, so AnimeSwap v1 choose the only one model to keep simple and uniform.

Swap model contract open source code and documents check here.

Anyone Can Create Pool

Another very important feature of AnimeSwap v1 is that anyone can create a pool.

Learning from Uniswap's success, one of the key feature is permisionless. Which means thousands of trade pairs can be created by anyone, and if the pair has been added liquidity by anyone it could swap.

AnimeSwap Labs only developing the protocol, not managing the protocol, keeping AnimeSwap protocol decentralized.

Swap Fee and DAO

Liquidity providers need incentives, they provide tokens (lock value) and may bear impermanent loss, swap fee to reward liquidity providers is AMM basic loop and feature.

AnimeSwap v1 swap fee is 0.3%, which is the same as Uniswap v2, More specific:

  • 0.25% swap fee distributed to liquidity providers as reward via adding LP token value directly.
  • 0.05% swap fee distributed to AnimeSwap DAO and locked into pairs as LP token.

AnimeSwap v1 Swap fee maybe change in the future if that can improve the protocol, all changes will be voted by AnimeSwap DAO.

AnimeSwap has no IDO, all intial ANI token airdrop. AnimeSwap DAO is used to better building the AnimeSwap protocol via rewarding builders. If DAO fee accumulated too much and not used, it will be keep lock as LP token to provide liquidity or buyback ANI and burn.

For more details about DAO usages check here.

Flash Swap

AnimeSwap supports Flash Swap, here is Flash Swap example.

Flash Swap is a very important feature of AMM, it could be used for arbitrage, liquidation, and other scenarios.

A person can use pool funds to arbitrage or repay loans in a single transaction without additional principal.

Simply put, it can better improve the efficiency of liquidity utilization and provide liquidity providers with higher rewards.

Here is a good article about flash swap: All About DeFi Flash Loans.

info

Flash Loans is another name of Flash Swap, they are the same thing.

Route

Give a simple scenario, there are three pools (pairs): A<>B, B<>C, C<>D, and the user wants to swap A to D.

For some contracts has no route supports, user need make three transactions or make one big transactions to wrap three step transactions, it cost high gas fee.

AnimeSwap supports inline route ABI for such scenario to make simple route swap and cost less gas fee.

What's more, AnimeSwap interface has a visualization of route swap. For more about route comparison and AnimeSwap advences, read Aptos Dex Gas and Feature Comparison.

GAS Friendly

AnimeSwap Labs spents a lot of time to optimize the Move contract and make AnimeSwap v1 protocol the most GAS friendly protocol.

AnimeSwap v1 protocol core contract has become the best example for learning the Move contract

For more about GAS comparison and AnimeSwap advences, read Aptos Dex Gas and Feature Comparison.

Future Upgrade

DeFi is fast evolving, and AnimeSwap will keep evolving. If there are better direction for ecosystem growth, AnimeSwap Labs will create and deploy AnimeSwap v2 protocol as upgrade, all decisions making via vote-and-governance.

Anyway, AnimeSwap v1 has been deploy on Aptos mainnet and it will live as long as Aptos network.

From the time this article was written, AnimeSwap Labs is working on Holder Pool and has a basic plan to supports other Move contract chains.

AnimeSwap keep evolving and will be better and better.

Update 20230309: AnimeSwap already deployed on Sui Devnet.

· 4 min read
zzzkky

TL;DR: AnimeSwap saves your gas and supports most features.

Gas Units Cost Comparison

Lower is better. 1k costs 0.001 APT gas fee at the lowest gas unit price.

OperationAnimeSwapLiquidswap[1]AuxPancakeSwapLiquidswap Stable[2]
Swap1.4k4.3k1.4k9k110k
Add LP[3]2.7k or 3.2k3.4k2.4k or 3.2k3.5k-
Remove LP2.6k1.7k1.4k2.4k-
info
  • [1] Uncorrelated curve. Common case.
  • [2] Stable curve.
  • [3] Some Dex has different gas cost for adding LP under different situations.

Analysis

  • Swap is the most common use-case, over 95% of all transactions. AnimeSwap and Aux are the most gas-saving dexes in this situation. 3.1x better than Liquidswap. 6.4x better than PancakeSwap.
  • Liquidswap Stable is Heavily gas-consuming, each tx takes at least 0.1 APT gas fee in the lowest gas unit price.
  • Add/Remove LP cost almost the same gas among these dexes.

Gas Conclusion

AnimeSwap and Aux are the most gas-saving dexes.

Features Comparison

FeatureAnimeSwapLiquidswapAuxPancakeSwapAptoswap
Open source✔️ link✔️ link✔️ link✔️ link✔️ link
SwapExactCoinToCoin✔️✔️✔️✔️✔️
SwapCoinToExactCoin✔️✔️✔️✔️
Gas-saving✔️✔️✔️
Custom Pairs✔️✔️✔️
Flash Swap✔️✔️✔️
Stable Curve✔️[4]
Oracle✔️✔️
Route✔️
info
  • [4] Support, but gas-consuming. Already explained in the above section.

Analysis

  • Open source: All the dexes are open-sourced. You can check the source code with link above.
  • SwapExactCoinToCoin: This is the basic feature.
  • SwapCoinToExactCoin: SwapCoinToExactCoin means whether uses can get exact output amount. For example, loan liquidators want to get exact amount coin with minimal input coin. Most dexes support this feature, while Aptoswap not. SwapCoinToExactCoin
  • Gas-saving: We have already explained in the above section. AnimeSwap, Aux and Aptoswap are the most gas-saving dexes.
  • Custom Pairs: Custom pairs means whether users can create new coin pairs. AnimeSwap, Liquidswap and PancakeSwap have this feature. You can add custom pair herecreate pair
  • Flash Swap: Flash swap allows you to borrow any available amount of assets without putting up any collateral, as long as the liquidity is returned to the protocol within one block transaction. This is the example for AnimeSwap Flash Swap
  • Stable Curve: Unfortunately, we do not support this feature. Only Liquidswap support it, but has gas problem.
  • Oracle: Orcale means support price oracle for other dapp. AnimeSwap and Liquidswap support this feature. This is the resources reference for AnimeSwap Oracle
  • Route: With route, you can swap any coin to any coin in one tx, among multiple pairs. Only AnimeSwap support a build-in router. router

Feature Conclusion

AnimeSwap and Liquidswap support most features.

Conclusion

AnimeSwap saves your gas and supports most features.