Synthetixio / kwenta

DEPRECATED. Please use: https://github.com/Kwenta/kwenta
MIT License
11 stars 20 forks source link

Error 500 is thrown while trying to convert "max" amount of asset #350

Closed drptbl closed 3 years ago

drptbl commented 3 years ago

Description: Error 500 is thrown while trying to convert "max" amount of asset. It's caused because there is some rounding issue inside "From" input field when swapping assets.

https://api.1inch.exchange/v3.0/1/swap?fromTokenAddress=0x956f47f50a910163d8bf957cf5846d573e7f87ca&toTokenAddress=0x57ab1ec28d129707052df4df418d58a2d46d5f51&amount=129636893229830630000&fromAddress=0x8dd7b3223b9c2f18b0f4b4108ed2a506f824b1ce&slippage=0.1

Screenshot 2021-04-22 at 13 04 44

Prerequisites:

Reproduction steps:

  1. Go to Kwenta "Convert" page (https://dev.kwenta.io/dashboard/convert)
  2. Connect your wallet
  3. Select any ERC-20 asset (for example "FEI") inside "From" drop-down
  4. Click on your asset balance to fill maximum amount to swap
  5. Submit your order

Current behavior:

Expected behavior:

Screenshots:

Screenshot 2021-04-22 at 12 42 23

Desktop (please complete the following information):