atlas
atlas copied to clipboard
Amm market can be close right after activation
Currently, in the designs we show that there is some kind of requirement for closing a market, which seems that is not true since I was able to close the market right after activating it.
There's a threshold percentage value which regulates the business logic:
The creator can close the AMM only when the amount_minted_by_amm <= threshould * token_supply This is to allow the creator to close the AMM even when the amount is negligeable.
Otherwise if the supply is say 100mln units but there's still one token minted by the AMM that has not been returned to it it wouldn't be possible for the creator to call deactivate_amm successfully
If you want to force the above behaviour you can set threshold = Permill::from_percent(0) in the chainspec.
The value for threshold should be updated by a council proposal.
Precentage treshold is not set to 1% so if 10 tokens minted on the market and 2 purchased you cannot close it before selling 1 to the AMM.