atlas icon indicating copy to clipboard operation
atlas copied to clipboard

Amm market can be close right after activation

Open WRadoslaw opened this issue 1 year ago • 2 comments

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.

Private Zenhub Image

WRadoslaw avatar Nov 17 '23 15:11 WRadoslaw

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.

dmtrjsg avatar Nov 20 '23 13:11 dmtrjsg

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.

dmtrjsg avatar Nov 24 '23 09:11 dmtrjsg