quipuswap-sdk icon indicating copy to clipboard operation
quipuswap-sdk copied to clipboard

Inverted price results

Open claudebarde opened this issue 3 years ago • 0 comments

I am using the following code inside a loop to fetch the prices of multiple tokens:

const dex = await findDex(Tezos, factories, token);
const dexStorage = await dex.contract.storage();
const tokenValue = 1 * 10 ** tokenInfo.decimals;
const inTezValue = estimateTezInToken(dexStorage, tokenValue);
const inTokenValue = estimateTokenInTez(dexStorage, 1_000_000);

This piece of code returns the right prices for the tokens except for STKR, ETHtz and hDAO where the price in inTezValue is the expected price for inTokenValue and vice-versa.

claudebarde avatar Jun 08 '21 05:06 claudebarde