An alternative way to complete Level 2: Gyrobatics
We’ve had reports that sometimes the Kovan UI for Balancer is a little buggy for the old Balancer V1 code. So here I describe another way you can complete the arbitrage loop in Level 2.
Original Level 2 post here.
TL;DR: rather than swapping the USDC for GYD in step 1, add USDC as liquidity to the pool and withdraw GYD.
Here’s how:
Step 1
Add USDC to the pool. On the USDC-GYD Balancer pool, click “Add Liquidity” on the top right.
Step 2
Select “Single asset”, and then add some USDC to the pool. Below, I added 905 USDC.
Click “I agree” on the warning, followed by “setup proxy” and confirm the transaction that appears on MetaMask.
Step 3
Remove the liquidity you just added, but all in GYD (not USDC). Refresh the page for good measure, then click “remove liquidity” on the top right, followed by “single asset” as before. Choose to withdraw the maximum GYD you can.
Below you can see that for the 905 USDC deposited, the pool allows 925.658 GYD to be withdrawn. Press “Remove liquidity” and confirm the MetaMask transaction.
Now, for every USDC you deposited, you should have ended up with >1 GYD.
Step 4
Go to the P-AMM and redeem the amount of GYD you just withdrew from the pool (in my case, 925) for USDC by going to the redeem tab and it in the USDC field.
Once the transaction completes, you should end up with a new, higher balance of USDC than the amount you started the loop with. In my case, I started with 905 USDC and through arbitrage earned 20 USDC, taking my final balance to 925 USDC.
Step 5
To verify the arbitrage loop, select the transaction hashes in metamask. The TX1 hash is given by Step 2 above and TX2 by Step 4.