๐ Initialize new DEX flow
Deploy and initialization of DEX pool from factory performs in 2 steps. This is required because of the complexity of the contract itself and the size of stored lambda functions in it, so one-operation deployment exceeds gas limits.
Step 1
QUIPU token should be approved (updated operators) before calling this method.
In first step, the contract deploys the main body of DEX, with copied admin and token lambdas and "frozen" flag, and charges QUIPU tokens as deploy fees, if the sender is not whitelisted.
add_poolStep 2
Underlying tokens should be approved (updated operators) before calling this method.
Step two do three operations: copy dex lambdas (as largest by size), "unfreezes" DEX, and call invest with balanced values of all underlying tokens. As the DEX pool contract had not received any investments yet, this investment is initial and equal to investing when performed add_pool(Standalone version).
start_dexLast updated