I´ve spotted a price difference arbitrage opportunity between two DEXs (both fork Uniswap) and use AAVE as flashloan. Swapping the 1 ETH flashloan borrowed amount to USDC on higher priced DEX comes out ok but when I convert the USDC swapped amount back into ETH on the cheaper exchange in order to yield an ETH token profit, which I know is one, it spits out the above error VM Exception while processing transaction: reverted with reason string 'Redeem failed' when executing uniRouter.swapExactTokensForTokens.
Chronology of events
I used a pricing JS bot to identify the arbitrage between the exchanges automatically.
It had correctly identified one and allowed the trx to go through into the smart contract in the back-end to perform the actual swap.
I was expecting the arbitrage to complete with a profit > 1 ETH for this transaction which hasn´t materialized given the above issue generated in the final swap on the cheaper DEX via execution of uniRouter.swapExactTokensForTokens
I´ve also checked the reserves were sufficient for both incoming/swapped tokens on the cheaper DEX which indeed was the case, before proceeding with the final swap.
Any ideas where I´m going wrong would be appreciated?
I´ve spotted a price difference arbitrage opportunity between two DEXs (both fork Uniswap) and use AAVE as flashloan. Swapping the 1 ETH flashloan borrowed amount to USDC on higher priced DEX comes out ok but when I convert the USDC swapped amount back into ETH on the cheaper exchange in order to yield an ETH token profit, which I know is one, it spits out the above error VM Exception while processing transaction: reverted with reason string 'Redeem failed' when executing uniRouter.swapExactTokensForTokens.
Chronology of events
I used a pricing JS bot to identify the arbitrage between the exchanges automatically.
It had correctly identified one and allowed the trx to go through into the smart contract in the back-end to perform the actual swap.
I was expecting the arbitrage to complete with a profit > 1 ETH for this transaction which hasn´t materialized given the above issue generated in the final swap on the cheaper DEX via execution of uniRouter.swapExactTokensForTokens
I´ve also checked the reserves were sufficient for both incoming/swapped tokens on the cheaper DEX which indeed was the case, before proceeding with the final swap.
Any ideas where I´m going wrong would be appreciated?
Thank you