protofire / omen-exchange

Omen exchange
https://omen.eth.link/
GNU Affero General Public License v3.0
66 stars 77 forks source link

Underflow error when scalar market has lower and upper bound values less then 0.001 #2159

Closed Mi-Lan closed 3 years ago

Mi-Lan commented 3 years ago

Describe the bug Unhandled Rejection (Error): underflow occurred (operation="division", fault="underflow", version=4.0.46) Occurs when wanting to input on scalar market that has values lower than 0.001 on both upper bound and lower bound

To Reproduce Steps to reproduce the behavior:

  1. Create scalar market which has 0.001 lowerBound value and 0.005 upperBound value
  2. Click on buy
  3. Input some value in collateralFiled
  4. See error

Expected behavior App shouldn't crash and you can buy/sell/deposit/withdraw/bond/reedem outcomes on a given market

Screenshots Screenshot 2021-08-06 at 17 16 42