A Simple AMM and Order Book Trading Engine in Rust. It provides functionalities for liquidity provision, token swaps, and order matching for trading various tokens.
The AMM feature allows users to provide liquidity to the pool and swap tokens based on a constant product model, such as Uniswap. It supports the following functionalities:
- Add liquidity for pairs of tokens
- Swap one token for another
- Multi-token swaps for more complex trading scenarios
The Order Book feature provides a traditional trading mechanism based on buy and sell orders. It supports the following functionalities:
- Add buy and sell orders to the order book
- Match buy and sell orders based on price-time priority
To use the AMM feature:
- Create a new AMM pool.
- Add liquidity for pairs of tokens using the
add_liquidity_pair
function. - Swap tokens using the
multi_token_swap
function.
To use the Order Book feature:
- Create a new Order Book.
- Add buy and sell orders using the
add_order
function. - Match buy and sell orders using the
match_orders
function.