Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Not compute correctly WETH unlock value when WETH is the base #595

Open
JoaoCampos89 opened this issue Mar 31, 2020 · 0 comments
Open

Not compute correctly WETH unlock value when WETH is the base #595

JoaoCampos89 opened this issue Mar 31, 2020 · 0 comments

Comments

@JoaoCampos89
Copy link

On Weth related to stable coins, it is normal to use Weth as the base. The getWrapEthStepIfNeeded does not handle these cases when WETH is used as base. My workaround was:

Create an isQuote flag and then on the step:

let wethAmountNeeded = isQuote ? amount.multipliedBy(price) : amount;

Before calling the step we need to check if Weth is the quote or base, could be used the following function:

const isWethQuote = isWeth(quoteToken.symbol.toLowerCase()) ? true : false;

At the moment I recommend warning users about this issue saying Weth is not supported as a base token on the config.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant