Open crypto456 opened 4 years ago
Yeah, I've also noticed this. There's also the case where an arbitrage happens:
Swap 1 ETH for 1 LINK on Uniswap
Swap 1 LINK for 1 USDC on Balancer
Swap 1 USDC for 1 USDT on Balancer
Swap 1 USDT fo 1 LINK on Balancer
Swap 1 LINK for 1 ETH on Uniswap
in this case, we should consider both the initial buy and the final sell vs. just treating this as a buy as it'll throw off the next transaction.
I'm working on refactoring the code to make it more manageable then see if I can leverage the amounts in each reserve token to calculate the pricer more correctly. I need to dig more into Uniswap's documentation on how the midPrice
and nextExecutionPrice
are handled in V2.
Thanks for bringing this u!
I just installed it and ran: $ yarn start ETH USDC Every hour the prices are sometimes wrong... You can easily tell by the % change. It appears that it gives wrong output only when showing a complex, multi-swap transaction using 1inch.exchange or similar.
2 Feature Requests:
Other than this price problem it works great 👍👍
Example when it's wrong:
$ yarn start ETH USDC
---> 25.56931 ETH: https://etherscan.io/tx/0x3251ff67be0408bcbd1afd53ef15f061270a33c328d9f1d1f258a1b2fee3e508/
uniswap.info's transaction table when I viewed the transaction live: Swap ETH for USDC total value: $9,750 token amount: 25.56931 ETH token amount: 9,750 USDC