Story of a trade

David Ma
2 min readOct 12, 2020

--

This was first posted on Twitter.

Mid last month, I accidentally stumbled on an arbitrage opportunity: CREAM’s yUSD-USDC swap was mispriced by a few %. Wow. Did I just find $20 on the floor? Yes. Yes I did.

My guess for why that arb existed was because that pool’s farming incentives had just finished, and farmers were pulling out their liquidity. However, unlike Uniswap, the contract and UI allowed LPs to withdraw liquidity in an unbalanced fashion, which produces slippage. Naturally, some inexperienced farmers would withdraw in 100% yUSD or 100% USDC, creating an arbitrage opportunity.

Over the next few hours I hurried, learned a minimal amount of web3, and hacked up a script to alert me when another $20 dropped. And it worked! I would manually make the trade when it beeped every now and then.

After a day or two, I decided to automate the bare-bone script to also size and execute.

I decide to leave it running on my laptop while I take my planned vacation week. Cuz yolo why not, I’m a chad.

Then, on my first day, flight landing, I look at my phone, volume surged, and almost all my yUSD was converted to USDC. Fuck. Did I misprice? Bug? Run some calcs. Nope. It’s the market that is wrong. Or is it? I didn’t know yet, but I was forced to close the arb loop to rebalance because otherwise my shitty script would keep sending invalid transactions and drain my gas.

It turned out Uniswap just created a yUSD swap and its price was even higher. I was probably the second leg for somebody else’s uniswap-cream arb bot. That explanation reassured me. We can share profits.

Lesson here: when your positions get imbalanced, you start doubting yourself (and should be). Even when the strategy is a rock solid simple arb. Always be aware of where your alpha is coming from. Is it: speed, access, private knowledge, risk premium? If you don’t know, you might be on the wrong side.

That price dislocation on Uniswap only lasted half a day. I’m guessing some buyers didn’t understand how to convert USD into yUSD and simply bought in when that swap was created.

I was thrilled. Finding alpha feels really fucking good. But it’s a short term drug.

Next day, it made a few trades, but… PnL is down? I pull up Etherscan on my phone to investigate. Some other bot is eating my lunch. It’s faster than me. My script had a really slow gas calculation and I couldn’t fix it remotely. So, I sadly had to pull the plug.

And that’s how I found an arb, traded it, and stopped trading it, within 5 days.

Thanks to that bot, I was able to just enjoy the rest of my PTO week. Albeit with some bitterness.

Remember, trading is not life.

--

--

Responses (1)