Thursday, September 15, 2022

A tale on the Curve(Finance)

A tale on the @CurveFinance of Avalanche Blockchain.

A story by the el geophf. 

So, in the Loop article, I showed how one could loop an asset to raise LTV in a relatively safe manner. Part of that exercise involved me trading $USDC to $DAI.e to take advantage of $DAI.e's high collateralization. 



But you see that swap was quite disadvantageous. 

It was a disadvantage I was willing to pay however.

Why? 

  • 1000 $USDC: 80% collateral factor = 800 coverage
  • 988 $DAI.e: 85% collateral factor = 839 coverage

Even with the swap-loss, I gained coverage, by a LOT!

But I paid twice for that gain! How?

  1. I lost ~ $75 in swaps from $USDC to $DAI.e, and I'll lose more when I swap back to cover the borrow, someday.
  2. I am now ~ $75 δ- on my stable positions on @BenqiFinance, whereas before the Loop I was ~$10 δ+

Boo! 

What if there were a way to swap from $USDC, which has a high distribution APY on the borrow, to $DAI.e which has the highest collateralization?

What if, indeed!

Enter Sandman, 


... sry, I meant: @CurveFinance. 

What is @CurveFinance? They are a protocol that specialize in the 'triple pool': $USDC - $USDT - $DAI

They have their own protocol token, too: $CRV.

They have their own monarch: the Curve Queen.

If you're looking to swap from one stable to the other, you go to @CurveFinance.

So, I'm ~$75 δ- on my @BenqiFinance stable positions, AND I have some $USDC in hand, ...

Let's rectify my stables to δneutral using @CurveFinance, shall we?

I want to trade $USDC to $DAI.e.

There are several hurdles we have to jump to do that, however.

Let's do this.

The first hurdle is this:

  • @CurveFinance doesn't have $USDC -> $DAI.e swap.



It has $USDC.e -> $DAI.e swap.

But how do we get to $USDC.e? Because:

  • @CurveFinance doesn't have $USDC -> $USDC.e swap.


Hm. 

The way I circumvent this failing on @CurveFinance is to go to one of the Avalanche DEXen, in this case @traderjoe_xyz has the best $USDC -> $USDC.e swap, so I marshal my $USDC.e there, first, THEN go to @CurveFinance 


Now, armed with $USDC.e, I go to @CurveFinance and swap for $DAI.e


The slippage, in all the trades, was $0.05 for $100 swap.

If I had done this from the get-go for the $6,300, my total slippage would've been $3.15, not ~$75!

Holy chicken pot pie! 😱

Welp, good lesson learned!

No comments:

Post a Comment