BitShares Forum

Main => Technical Support => Topic started by: jackingyang on January 29, 2019, 09:30:16 AM

Title: Assert Exception: min_to_receive.amount > 0:
Post by: jackingyang on January 29, 2019, 09:30:16 AM
There is an exception When call Market.sell()
Assert Exception: min_to_receive.amount > 0:

I will sell 0.0002 usd
Title: Re: Assert Exception: min_to_receive.amount > 0:
Post by: pc on January 29, 2019, 01:28:33 PM
It means your order gets rounded down to zero. What are you trying to sell this for?
Title: Re: Assert Exception: min_to_receive.amount > 0:
Post by: btspp on January 29, 2019, 01:38:45 PM
Quote from: jackingyang on January 29, 2019, 09:30:16 AM
There is an exception When call Market.sell()
Assert Exception: min_to_receive.amount > 0:

I will sell 0.0002 usd

【买入的】资产数量不能为0,卖出的usd价格太低,可以得到的BTSor其他?资产数量为0了,故报错。
Title: Re: Assert Exception: min_to_receive.amount > 0:
Post by: litepresence on February 14, 2019, 08:53:42 PM
on the backend there are no decimals in prices OR amounts

everything is integers in this format:

(amount_to_sell / 10^precision_of_asset1)
(min_to_receive / 10^precision_of_asset2)

each asset has a precision... if you get too close to its precision... ie trying to sell dust then this will get rounded to zero and rejected.
Title: Re: Assert Exception: min_to_receive.amount > 0:
Post by: jackingyang on February 15, 2019, 01:28:24 PM
Fix it