This repository contains an Automated Market Maker (AMM) Liquidity Pool implementation designed for decentralized exchanges on the Aptos blockchain.
- AMM Functionality: Facilitates automated trading between cryptocurrency pairs.
- Liquidity Pool: Users can contribute to liquidity pools and earn fees from trades.
- Aptos Integration: Specifically designed to work with the Aptos blockchain.
- Custom Fee Structure: Allows configuring different fee structures for trades.
- Efficient Algorithms: Uses efficient algorithms for trade execution and liquidity management.
- Aptos CLI
- Move Language support
- Clone the repository:
git clone https://github.com/alhonaut/amm-liquidity-pool.git cd amm-liquidity-pool
- Build and deploy the contract:
aptos move compile aptos move publish
To add liquidity, call the add_liquidit
y function with the appropriate parameters. Ensure you specify the token pair and the amounts to be added.
To remove liquidity, call the remove_liquidity
function. You need to specify the liquidity token amount to be removed.
To swap tokens, call the swap
function specifying the input and output token types and amounts. Ensure you check the slippage and set appropriate limits.
- Move unit testing framework
- Navigate to the project directory:
cd amm-liquidity-pool
- Run the tests:
aptos move test
- Check the coverage report:
aptos move test --coverage
- Create test cases in the tests directory.
- Ensure each function has corresponding unit tests.
- Use mock data for testing edge cases and performance.
- Thanks to the Aptos and Overmind community for their support and contributions.
- Inspired by various decentralized exchange protocols.