Routes
Route
We would like to add a second pallet that is able to route orders between different AMM instances or pools. We chose to not make it part of the AMM pallet due to the fact that the AMM pallet can be instantiated many times, and we may want to route orders between all of them (for example we could have a route USDT-KSM-xKSM
).
Trade
The calculation is as follows:
amount_in
being the amount ofbase_token
entering the poolsupply_in
being our supply ofbase_token
tokens in the poolsupply_out
being our supply ofquote_token
tokens in the pool
Last updated