CONVERSION ROLLBACK!

in LeoFinancelast year

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.

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

Sort:  

I got involved in using these blockchain level conversions. In the final analysis, I found if the HBD was near $1.00, it isn't really profitable to do a conversion. If HBD is worth $ 0.95 USD, then burning it should give you 1 USD of Hive, but this often happens while Hive is dropping in value, and after 3.5 days, there were times I wished I had kept my $0.95 USD worth of HBD rather than destroy it for Hive that ended up with a value of $0.85 USD.

Your article discusses the operation that goes the other direction. In this case, the trader who is trying to make a profit and defend the HBD from getting too high has a further disadvantage with the 5%. Say, HBD was 1.20 USD, as it was a couple of days ago on Bittrex. You sell at 6000 sats, then you have to trade these sats into Hive in order to trade them back into HBD on the internal market. You have CEX trading fees and spreads along the way, along with transaction fees of BTC. It probably is worth it if you can catch an exchange trading at that height.

You have to be careful with the CEXes (pardon the pun). You need to ask yourself: What is the withdrawal fee? What is the trade fee? Are withdrawals even enabled? You need to look at the actual orders that are going to buy HBD for sats and sell you Hive for your sats. Are there large enough orders? What about counter party risk? Rather than doing this $1,000. Deposit $100, trade, and withdraw. Repeat. If they decide to steal or impede the withdrawal of your Hive you at least still have $900 of your value unimpeded. Consider the various methods for it.

This is an interesting take because HBD doesn't really have any exchange listings.
Liquidity on the internal market dwarfs all of them put together.
The main listing is UpBit which only South Korean nationals can access.
24 hour volume on Bittrex is less than $300 and as far as I know you still can't withdraw.
In addition, the withdrawal fee for all things Hive has always been near zero.
Standard price for Hive or HBD withdrawal is 0.01 Hive/HBD.

You seem to be reminiscing about a time long past.

The stabilizer proposal has been doing very well and keeps HBD propped up from the downside x100 times better than it used to be. I'm no stranger to that feeling of doing a conversion and realizing it would have been worth more Hive if I never did the thing, but that's just gambling. It can go either way. There's also a big difference between converting the HBD you already have vs bringing in outside value to buy cheep HBD off the market and convert it (or don't convert it and just let the peg return to $1).

Let it be known that on Ionomy they charge 0.60 HBD to withdraw HBD, 0.6 Hive to withdraw Hive, and 2 BUSD to withdraw BUSD. I am telling them they ought to reduce those values.

Wow really? I don't remember it being that high.
LOL also those guys are still around?
I'm surprised they were able to survive the bear market.
Is their volume still really low?
Thanks for reminding me about them that's a blast from the past.

What I mean is, yes they have a really low liquidity. I was hoping that one day we could see very low exchange rates between stable coins. One good feature is that there was support for the HBD/BUSD pair. As an experiment I put sales of HBD/BUSD and back at very low spreads but small amounts. So that one could move value between blockchains with low friction. I was hoping it could be, but I couldn't make 20% per year off of the spread because there wasn't enough volume there even with a tiny amount invested on both sides. I think I'll make more just leaving dollars in savings. Now that TribalDex has that pair, you can normally get a very good price changing dollars for dollars that way.

The exchange added more friction with higher withdrawal fees and higher exchange fees, so I don't see much future there trading between those stablecoins.

Probably lower than you remember.

I was not aware of the min(price_median) .... that's new to me :)

From the test I have made like a year ago, when this was a new thing, I usually would wait out for the conversions to end and check the final results .... and in the final result the final_price is used that is the median of the median in the 3.5 days :)
Turns out this min(price_median) is just a temporary price to ensure more collateral is put in.

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?

Its not up to one witness, since it is still a median price for one hour, collected from the feed from the top witnesses. But then it looks at the median hourly prices from the last 3.5 days (84 data points) and choses the lowest.

The way I was going about HIVE to HBD conversions is doing them only if HBD is above $1.1.

Kudos to you for learning it live and digging in deep :)

Its not up to one witness, since it is still a median price for one hour, collected from the feed from the top witnesses. But then it looks at the median hourly prices from the last 3.5 days (84 data points) and choses the lowest.

Yeah... I still don't get it.

What is a "top witness"?

Oh wait maybe I get it...
Yeah there are 84 data points (all medians) and it just takes the lowest one.
Simple enough but there are a lot of ways to misinterpret how it was being explained.

Thanks for the help!

I just imagine it like that for easier understanding, dunno how it is actually implemented in the code, and the actual code

Yeah I've been told the hourly thing before by many other people and it just wasn't clicking.
I think I have a better grasp of what's happening here.

I still think it's a little weird that we would consolidate them into hourly aggregates when we could technically create a new data point every 3 seconds. Guessing it has something to do with database efficiency and whatnot.

Yes it reduces the size faster ... when you keep converting HIVE to HBD and selling the HBD for HIVE

The one thing that you have to remember when converting Hive to HBD is that the only thing that matters is what is the price that you pay at the end of the process.

That price will be the median (not the average) feed price for the last 3.5 days plus five percent.

In order to minimize the risk during a conversion, the price of HBD on the open market has to be at least 1.10. You could risk it if the HBD price is between 1.05 and 1.10 but, anything below that is losing by default because of the five percent fee.

If the median feed price is higher than the one on the open market by more than five percent then you profit, otherwise, you lose in the end.

The price that you see at the start of a conversion is irrelevant. At this phase of the process, the blockchain just makes sure that you have more than double the collateral needed to cover the cost of the loan.

Mean, median, and mode are all averages.

anything below that is losing by default because of the five percent fee.

Not if you expect the price of hive to go up.
But this may be an extreme outlier and regular longs on MEXC are smarter.

The price that you see at the start of a conversion is irrelevant.

This is an EXTREMELY important point that took me a while to understand.
We can think of it as a 3.5 day futures market with a forced sale at the end.

Mean, median, and mode are all averages

More specifically they are measures of central tendency. However, it is important to not just think that you can just interchange the terms. Since the way to calculate them is different they can yield very different values depending on the shape of the data distribution.

The blockchain uses the median, not the mean which is what people refer to when they use the word average. I just want to make sure that the readers do not get confused.

Not if you expect the price of hive to go up.

You are correct. If the Hive market price has an upward trend it is less risky to start a conversion. But the price has to be the right one to start with. Otherwise, you are just hoping that the market will be in your favor in the end. There is a risk regardless but starting from a losing position is not my cup of tea.

All good distinctions to make to be sure.
Thanks for the addition.

Moist should be using the internal exchange and swapping $HIVE for HBD on there. Conversion isnt for the masses.

Posted Using LeoFinance Beta

Yep it is perhaps best left to the market makers and the bots.

But during crazy bull run upswings the entire network may have to engage in them.

Since the conversion is programmatic the Conversion Interfaces on wallet.hive.blog and on peakd.com* should tell users when conversion is the better option and should include a link to the market when it is not.

*Peak.com and wallet.hive.blog are computer programs. Computer programs should understand computer programs better than people.

Posted Using LeoFinance Beta

Don't make the plebs revolt, their are moistly peaceful ;)))

ragequit

Since I'm not a gamer, this is new to me. I love the word. (Used first time in 2005, according to inverse.com)

The rest of the discussion is beyond me--although I did try to plow through for a bit. With my dim understanding of finance and crypto, it all seems like a bit of magic and illusion. I'll never out-think the people who designed this platform, so I just come along for the ride and hope for the best. A lot of people need Hive to live. That I do understand.

Thanks for the new word :)

Haha yes rage-quitting is a time honored tradition.

This used to be called "pulling the plug" in Starcraft because people would get so mad they'd literally pull the 56k modem cable out of the wall instead of just clicking the "surrender" button. So instead of the game ending instantly the winner would have to wait 45 seconds for the other player to timeout and get dropped from the game due to "bad internet connection".

Anyone could simply buy Hive off exchanges and instantly exchange it for HBD at a profit in this scenario at no risk

Isn't this the exact idea of these conversions - to stabilize the price? But it is not "at no risk". If the price recovers in the next 3.5 days you'll lose half of your Hive in the conversion

 last year  Reveal Comment

Thanks for the explanation, I had to do the math earlier. I still don't see how you'd get huge profit as the actual amounts are calculated at the end of the conversion. Perhaps I'll understand it better after playing around with it

!PGM
!PIZZA

Sent 0.1 PGM - 0.1 LVL- 1 STARBITS - 0.05 DEC - 1 SBT - 0.1 THG - 0.000001 SQM - 0.1 BUDS tokens to @torran

remaining commands 0

BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!

The tokens that the command sends are: 0.1 PGM-0.1 LVL-0.1 THGAMING-0.05 DEC-15 SBT-1 STARBITS-[0.00000001 BTC (SWAP.BTC) only if you have 2500 PGM in stake or more ]

5000 PGM IN STAKE = 2x rewards!

image.png
Discord image.png

Support the curation account @ pgm-curator with a delegation 10 HP - 50 HP - 100 HP - 500 HP - 1000 HP

Get potential votes from @ pgm-curator by paying in PGM, here is a guide

I'm a bot, if you want a hand ask @ zottone444


🍕 PIZZA !

I gifted $PIZZA slices here:
@torran(10/10) tipped @edicted (x1)

Send $PIZZA tips in Discord via tip.cc!