bancorprotocol / carbon-app

https://app.carbondefi.xyz
MIT License
25 stars 17 forks source link

Add condition to recheck liquidity for when there is no output after removing trading fee #1278

Closed tiagofilipenunes closed 2 months ago

tiagofilipenunes commented 2 months ago

fix #1149

This is a very specific edge case scenario where the trade works in one direction but not the other because of the source/target where the trading fee is taken based on the type of trade AND there is only 1wei liquidity, meaning that the outcome of the trade after removing the tradingFee is 0, which results in an effective rate of 0, and the liquidity is not rechecked.

This means that the buySell component for “Sell BNT for USDT” shows up but the behaviour is unexpected because there is no liquidity recheck.

cloudflare-pages[bot] commented 2 months ago

Deploying carbon-app-sei with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3960025
Status: ✅  Deploy successful!
Preview URL: https://6ca00720.carbon-app-sei.pages.dev
Branch Preview URL: https://issue--1149.carbon-app-sei.pages.dev

View logs

cloudflare-pages[bot] commented 2 months ago

Deploying carbon-app with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3960025
Status: ✅  Deploy successful!
Preview URL: https://6bd76506.carbon-app-csq.pages.dev
Branch Preview URL: https://issue--1149.carbon-app-csq.pages.dev

View logs