Skip to content

Conversation

@sakulstra
Copy link
Collaborator

@sakulstra sakulstra commented May 11, 2022

Resolves some issues with the current repay with collateral implementation:

  • Excludes pools which are returning 500 errors for swaps involving certain assets (LINK, TUSD)
  • Improve slippage estimation for input amounts
@sakulstra
Copy link
Collaborator Author

@defispartan there still seems to be an issue - which weirdly i can only reproduce on ethereum where the flashAmount for some reason is smaller then then maxAmountToPay (reproducible via tenderly).

No idea where it's coming from exactly.

@sakulstra sakulstra marked this pull request as draft May 12, 2022 08:08
@github-actions
Copy link

@github-actions
Copy link

github-actions bot commented May 13, 2022

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 484.68 KB (🟡 +72 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@defispartan
Copy link
Collaborator

I think the same logic is needed for price impact as well. One thing I didn't know until researching further is that price impact and slippage are not the same thing: https://doc.paraswap.network/price-impact-slippage.

When you test a swap with high slippage, you can see that the expected input amount is calculated before price impact is taken into account:

rwc

@sirsoth
Copy link

sirsoth commented May 13, 2022

Im able to replicate errors on a position with LINK as collateral, unable to repay USDT or DAI

@sirsoth
Copy link

sirsoth commented May 13, 2022

Just Error getting txParams

@bojanaave
Copy link
Contributor

There is one case where "Error getting txParams" is visible - it happens when a user wants to swap ETH -> to any other assets. Here are the reproduction steps:
So here are the reproduction steps:

This API POST Request throws error 500 - https://api.paraswap.io/transactions/1/?ignoreChecks=true

  1. Supply some amount of ETH
  2. Click on the SWAP
  3. As Amount type eg. "1" and wait few sec
@foodaka
Copy link
Collaborator

foodaka commented May 16, 2022

is this also related to this issue #786 ?

@sirsoth
Copy link

sirsoth commented May 16, 2022

Looks to me to be the same error

@github-actions
Copy link

@github-actions
Copy link

@defispartan defispartan marked this pull request as ready for review May 26, 2022 18:10
@foodaka
Copy link
Collaborator

foodaka commented May 27, 2022

Thanks @defispartan for investigating and running this down

@foodaka foodaka merged commit 948f22c into main May 27, 2022
@foodaka foodaka deleted the fix/fix-repay-with-collateral branch May 27, 2022 08:45
foodaka added a commit that referenced this pull request May 27, 2022
@defispartan defispartan linked an issue Jun 2, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants