I want to create dex pallet(without using pallet-contracts) with functionality like uniswap with pools of liquidity, this dex gonna work with my multi-token-pallet. So now I'm thinking about how to propperly implement that. So for exmple every pool of liquidity will be some struct in double storrage map, in my multi-token-pallet tokens are associated with AccountId but how can I transfer them to dex pallet, does it have AccountId? Maybe I can create fake signed accounts to deal with multi-token-pallet? Can somone give some ideas how to implement that?
-
Checkout Acala implementation, But just look at pallet asset and you can derive any logic with that pallet– Mrisho LukambaOct 4, 2022 at 19:21
-
Please review the kinds of questions which are supported on this forum: substrate.stackexchange.com/help/dont-ask– Shawn Tabrizi ♦Oct 4, 2022 at 22:38
1 Answer
Adam Wierzbicki has created just this. It is based on Uniswap V1. You can find his pallet here: https://github.com/Wiezzel/substrate-dex.
The pallet is not production ready, but is very useful for learning.