Protocol Overview
Introduction
aeSwap is an innovative decentralized exchange (DEX) operating on the Archethic Public Blockchain, leveraging the Automated Market Maker (AMM) model to facilitate on-chain asset swaps, liquidity provision, and yield farming opportunities. Built with the goal of enhancing the decentralized finance (DeFi) ecosystem, aeSwap emphasizes security, decentralization, and low transaction costs, offering a robust platform for DeFi activities without the need for trusted intermediaries.
The AMM Model
At the core of aeSwap is the AMM model, which enables the automatic trading of digital assets using liquidity pools rather than traditional market orders. Each liquidity pool on aeSwap contains reserves of two tokens and operates according to a set formula to ensure liquidity and facilitate trades.
Participating in aeSwap
- Liquidity Providers (LPs) can add their tokens to the liquidity pools, receiving LP tokens in return. These LP tokens represent their share of the pool and entitle them to a portion of the trading fees generated by the pool's activity.
- Traders use aeSwap to swap between different tokens. Each trade incurs a nominal fee, part of which is added to the pool reserves, thus benefiting the liquidity providers.
- Developers can integrate aeSwap's functionalities into their applications, utilizing its open-source smart contracts and APIs for building decentralized apps on the Archethic Public Blockchain.
Ensuring Fair and Secure Trading
aeSwap utilizes a unique algorithm to determine the price of tokens in each pool, ensuring that trades are executed close to the market rates. This system also provides protection against significant price impacts, ensuring a stable DeFi environment.
Rewards and Yield Farming
Participants can earn rewards through yield farming by providing liquidity to selected pools. aeSwap's design encourages long-term liquidity provision and sustainable yield generation, with rewards distributed in UCO tokens, the native cryptocurrency of the Archethic Public Blockchain.
The Mathematics of AMM and Constant Product Formula
aeSwap, based on the Uniswap v2 model, employs the constant product formula to maintain pool liquidity and determine prices. This formula is represented as x * y = k
, where:
x
andy
are the quantities of the two tokens in the liquidity pool.k
is a constant value.
The constant product formula ensures that the total value in the pool remains constant after a trade, excluding fees. When a trade is executed, the product of the quantities of the two tokens stays the same, allowing the AMM to provide liquidity at any price level.
Example Calculation
If a liquidity pool contains Token A and Token B with amounts a
and b
respectively, and a trader wants to swap an amount Δa
of Token A for Token B, the constant product formula ab = k
must still hold post-trade. The amount of Token B received, Δb
, can be calculated by rearranging the formula to find the new balance of Token B that maintains k
.
Price Impact and Slippage
The constant product mechanism also inherently limits the price impact of trades, ensuring that larger trades have a proportionally higher impact on price. This helps protect against market manipulation and ensures fair trading conditions.
Conclusion and Further Exploration
aeSwap represents a significant advancement in the DeFi space, offering a decentralized platform for trading, liquidity provision, and yield farming on the Archethic Public Blockchain. Its innovative use of the AMM model, combined with a focus on security and user experience, positions aeSwap as a key player in the decentralized finance ecosystem.
For a deeper understanding of aeSwap's functionalities and to start participating in the Archethic DeFi ecosystem, refer to our detailed [Usage Guides](/participate/dex/Guide Usage/usage_overview).