galacticcouncil / Basilisk-node

Basilisk - cross-chain liquidity protocol on Kusama
Apache License 2.0
67 stars 20 forks source link

Move funds on end of LBP to XYK #247

Open mrq1911 opened 2 years ago

mrq1911 commented 2 years ago

discord thread

Roznovjak commented 2 years ago

@lumir-mrkva Do we want to also create XYK pool at the end of LBP if the pool doesn't exist?

Roznovjak commented 2 years ago

@lumir-mrkva I have some questions. What if XYK pool already exists before LBP? (I thing there is nothing we can do to prevent it). Do we want to create XYK pool immediately at the end of LBP or when remove_liquidity is called? (In the former case, pool creation needs to be somehow automated/scheduled).

I have also discussed architectural design with Martin, and we like the idea of creating a new pallet for it.

Roznovjak commented 2 years ago

The second part of the task was already solved by this PR.

mrq1911 commented 2 years ago

you shouldn't be able to create LBP if the XYK pool already exists

Roznovjak commented 2 years ago

@lumir-mrkva ability to create XYK at the end of LBP and transfer funds there should be configurable in the config or in the create_pool method? In other words, configurable for all LBP pools without an exception or configurable individually for each pool?

jak-pan commented 2 years ago

@lumir-mrkva ability to create XYK at the end of LBP and transfer funds there should be configurable in the config or in the create_pool method? In other words, configurable for all LBP pools without an exception or configurable individually for each pool?

This should be decision of the team conducting the LBP. There are different use-cases that you might do with LBP including just distributing / sale of tokens instead of initializing liquidity. If I'd tackle this I would look at the close / end function and do the logic there where it can be an option if final weights are 50/50.

Optionally the close function could create only partial pool and transfer the rest to the owner.