edicted Blog Banner

edicted

CONVERSION ROLLBACK!

rollbackrollbackwrongbacktrack.png

Take it back ten seconds...

Obviously my grasp of how HIVE >> HBD conversions work is still fledgling at best... because I'm pretty sure everything I claimed in my last post was yet again wrong. Very sad. Apologies issued to @dalz who tried to warn me but I wouldn't listen. I will now go into even more of a deep dive in this post on this tiny detail that has very little relevance to the vast majority of the Hive userbase.

I'm Helping!

conversionsthirdplaceprizehbd.png image.png

https://gitlab.syncad.com/hive/hive/-/issues/129

Shoutout to Tonimontana for providing this link.

So what is the source of all this confusion?
Well, for one it's explained very poorly by @blocktrades.

To be fair it is probably perfectly explained for Hive Core devs, which is the target audience. But me trying to fully understand it is difficult given my lack of knowledge about certain things.

Right off the bat we see that:

collateral_price = min(3.5 days worth of hourly price medians) + 5%

Uh... okay.

  • Why is the variable called collateral_price? Collateral doesn't have a price; it has a value and we are leveraging against that value with a loan.

  • Why are we adding 5% to the collateral_price? That's confusing. Shouldn't the collateral position be losing 5% to create the appropriate buffer?

  • Why is there a variable called collateral_paid? Collateral doesn't get paid; it is locked and value is extracted from the locked position as a loan.

  • Why is HBD being "purchased"? It's not being purchased, it's being printed/minted/drawn out of thin air as a loan against Hive collateral. DAI and MAKERDAO represent this exact function with the draw() function.

  • Why does the only example given use a collateral price of 1:1? That makes it difficult to see where that variable actually comes into play because it just disappears when you multiply by 1.

  • How is min(price_median) calculated? Is it just a single witness at the bottom of the list deciding this number? Is that too much power for a single witness to hold?

  • Why would I lose all my collateral if the final_price doubled in value? Oh... it's because the final price is measured in HBD... even though the median(price_feed) applies to Hive... or so I thought. Again, this makes no sense. The price of HBD does not change and is always assumed to be $1 in these situations. Only the value of the collateral position changes. Why is it framed otherwise?

    • No wait the final price is the price of Hive it costs to get the HBD... but we already have the HBD... we aren't buying it the HBD because we got it 3.5 days ago... we are paying back a loan. See, the words used to describe what is actually happening don't make a whole lot of sense pretty much across the board.
  • Is the 5% fee calculated by multiplying by 0.95 or dividing by 1.05?

  • Why are the equations backwards?
    Why would collateral_paid = ...? I already know what the collateral_paid is... I'm the one who chooses that variable as the user.
    I need to know amount_of_hbd_purchased. And of course by "purchased" I mean "borrowed". Because it's a loan to be paid back in 3.5 days.

  • Why do none of the Hive frontends show the min(price_median) even though it's used in such a critical function?

It's easy to see how making a list of questions even longer than the original explanation isn't too difficult, and I was holding back.

In any case the one thing that this description does clear up beyond any reasonable doubt is that Hive collateral is measured symmetrically in both directions. I concluded that it must be asymmetric to avoid exploitation, but this is not the case. The average price feed is always used, and it just so happened that the min(price_feed) happened to be very close to the current spot prices I was using in my examples. Interesting coincidence.

https://images.hive.blog/DQmfDExToYWjsAD9EEhh1Bp16dTTdC2Mgae87n184cYtvgV/liquidity-drip-faucet-usd-100.png

This may be presumptuous of me to say, but I believe the way that I thought it worked in my previous post is superior in every way to how it actually works as described above... which is why I so vehemently assumed it must work that way.

It is not appropriate to measure the value of Hive collateral on any kind of average when the price is crashing. This automatically creates potential exploits that never needed to exist in the first place. The spot price of Hive could crash on exchanges by 75% in minutes, and the average price used to measure how much HBD we get would be x4 higher than it should be. Anyone could simply buy Hive off exchanges and instantly exchange it for HBD at a profit in this scenario at no risk. It's a liquidity pool siphon waiting to happen.

Value of Hive collateral should be measured by spot price when spot price is below the average. Otherwise it should just round down to the average. There is no disadvantage to doing it this way (bold statement), and eliminates the threat of compounding damages from a black swan event. The point might be moot as such an exploit may never happen, and if it does will only drain a bit of HBD's liquidity... but still it seems weird to leave it open as a possibility when we could just be measuring collateral value more accurately to the downside. The problem gets more threatening if HBD acquires bigger liquidity pools (which is exactly what we want). Just my two cents I guess, for what that's worth. Probably 2 cents.

Conclusion

Learning exactly how HIVE >> HBD conversions work has been a frustrating experience. I started this journey last summer and actually kind of ragequit on it when the details were too convoluted for me to parse in a timely manner. I've gotten a little bit better grasp on it now, but still not 100%. All in all I've cumulatively spent multiple hours trying to figure it all out. It's a very odd experience because it feels as though it should be such a simple mechanic. Alas, it is not. At least I know enough now to profit off it should the situation arise. Kudos.

Posted Using LeoFinance Beta


Return from CONVERSION ROLLBACK! to edicted's Web3 Blog

CONVERSION ROLLBACK! was published on and last updated on 10 Feb 2023.