BitShares Forum

Main => General Discussion => Topic started by: monsterer on December 06, 2014, 07:58:17 pm

Title: Yield question
Post by: monsterer on December 06, 2014, 07:58:17 pm
Does yield on a bitAsset purchase come from the interest paid by the short on the other side of the trade - and therefore stop being paid when that short covers?
Title: Re: Yield question
Post by: bytemaster on December 06, 2014, 08:29:46 pm
Does yield on a bitAsset purchase come from the interest paid by the short on the other side of the trade - and therefore stop being paid when that short covers?

All interest paid by all shorts is shared by all USD equally.
Title: Re: Yield question
Post by: biophil on December 06, 2014, 08:48:42 pm
Does yield on a bitAsset purchase come from the interest paid by the short on the other side of the trade - and therefore stop being paid when that short covers?

The interest is paid when the short covers, and it just gets put into the pool that all other bitAsset fees go into.
Title: Re: Yield question
Post by: monsterer on December 06, 2014, 11:02:46 pm
All interest paid by all shorts is shared by all USD equally.

What's to stop someone from taking both sides of the trade, shorting and buying into their own short, essentially entering into a 100% hedge which pays yield with no risk?
Title: Re: Yield question
Post by: islandking on December 06, 2014, 11:04:13 pm
All interest paid by all shorts is shared by all USD equally.

What's to stop someone from taking both sides of the trade, shorting and buying into their own short, essentially entering into a 100% hedge which pays yield with no risk?

Nothing, but you would not gain anything from that. Its like going long and short. 0% change.
Title: Re: Yield question
Post by: monsterer on December 06, 2014, 11:04:44 pm
Nothing, but you would not gain anything from that. Its like going long and short. 0% change.

Yield?
Title: Re: Yield question
Post by: starspirit on December 06, 2014, 11:14:27 pm
All interest paid by all shorts is shared by all USD equally.

What's to stop someone from taking both sides of the trade, shorting and buying into their own short, essentially entering into a 100% hedge which pays yield with no risk?
The short has to compete on interest, so to guarantee getting set there could be a net cost.
Title: Re: Yield question
Post by: islandking on December 06, 2014, 11:22:34 pm
Nothing, but you would not gain anything from that. Its like going long and short. 0% change.

Yield?

The yield comes from the short position I think. So you would not make any money at all doing this.
Title: Re: Yield question
Post by: monsterer on December 06, 2014, 11:36:06 pm
Nothing, but you would not gain anything from that. Its like going long and short. 0% change.

Yield?

The yield comes from the short position I think. So you would not make any money at all doing this.

Read the OP :)
Title: Re: Yield question
Post by: Shentist on December 06, 2014, 11:58:35 pm
All interest paid by all shorts is shared by all USD equally.

What's to stop someone from taking both sides of the trade, shorting and buying into their own short, essentially entering into a 100% hedge which pays yield with no risk?

it is not like - you could eat your own cake! in theory i assume you could make money if the short interest you pay is smaller as the yield you get. but the yield looks not so much in the moment to me. so, not much to gain.

- yield is difficult because bytemaster decided to pay to bitAsset holders more over time. it would easier to understand everything to redo it and pay for every day equal yield! at the moment it is for a normal user impossible to calculate the yield he gets. in my opinion this should be redone. it is not convenient at the moment.
Title: Re: Yield question
Post by: monsterer on December 07, 2014, 11:14:08 am
it is not like - you could eat your own cake! in theory i assume you could make money if the short interest you pay is smaller as the yield you get. but the yield looks not so much in the moment to me. so, not much to gain.

Yes, like you say it depends on whether the yield you receive is more than the interest you pay. IMO it might have been cleaner to have the short pay the long directly (with yield) and have that expire when the short covers, then you truly gain nothing from this.
Title: Re: Yield question
Post by: biophil on December 07, 2014, 03:04:12 pm
it is not like - you could eat your own cake! in theory i assume you could make money if the short interest you pay is smaller as the yield you get. but the yield looks not so much in the moment to me. so, not much to gain.

Yes, like you say it depends on whether the yield you receive is more than the interest you pay. IMO it might have been cleaner to have the short pay the long directly (with yield) and have that expire when the short covers, then you truly gain nothing from this.

You talk like you see a problem with a simultaneous long/short. In my view, this hurts nobody. The only possible downside is that it artificially inflates the market cap of the asset, but maybe that's not a downside.

Disclaimer: I routinely short to myself when I can do so at a zero interest rate.

Sent from my SCH-S720C using Tapatalk 2

Title: Re: Yield question
Post by: monsterer on December 07, 2014, 05:14:36 pm
You talk like you see a problem with a simultaneous long/short. In my view, this hurts nobody.

I don't think so. If you short to yourself with 0% interest rate, then you take money away from the system with 0 risk. All the other shorts contribute to your yield while you contribute nothing.
Title: Re: Yield question
Post by: biophil on December 07, 2014, 09:06:57 pm
You talk like you see a problem with a simultaneous long/short. In my view, this hurts nobody.

I don't think so. If you short to yourself with 0% interest rate, then you take money away from the system with 0 risk. All the other shorts contribute to your yield while you contribute nothing.

Yeah, I see that... fair enough. Not sure if there's a good way around it though. You can't have the short pay interest directly to the long because you'd end up with different classes of bitUSD, some with a high interest rate, some with low.

Sent from my SCH-S720C using Tapatalk 2

Title: Re: Yield question
Post by: arhag on December 08, 2014, 02:44:05 am
All interest paid by all shorts is shared by all USD equally.

What's to stop someone from taking both sides of the trade, shorting and buying into their own short, essentially entering into a 100% hedge which pays yield with no risk?

So if I understand what you are saying correctly, you are saying that any time there is an opportunity to match your own short (without eating up other people's BitUSD sells in the process) at 0% interest you should take it, since there is no downside possible. You just need to cover your own short with the BitUSD you hold before 30 days and you will not lose/gain any BTS due to price changes in BTS. However, you could potentially collect extra BitUSD at the end of this process because of yield earned on the BitUSD you held over the 30 day period.

Now, if you could only match your short at some positive interest rate, it is no longer a sure thing. You have to bet that the total yield you will receive over the N blocks (where N < 259200 = 30 days / 10 seconds) from when your short is matched until when you cover is greater than the total interest you need to pay over the same N blocks. The total interest you will pay while your matched short position exists, I(N), can be known prior to even submitting the short order (assuming your short does match). However, the yield you receive over the same period of time Y(N) is not possible to know exactly. You want to submit your short order and match it (assuming again you can match it without buying up other people's BitUSD sell orders in the process) if you believe I(N) < Y(N) for some N < 259200. If you are wrong about this, you will actually lose money.

The big problem with all of this comes from the way the yield is calculated currently. It is estimate the yield your BitUSD balance will get over 30 days with decent accuracy. While it is in theory possible that all other BitUSD balances will suddenly claim their yields before you do in the 30 day period, leaving you with very little yield left, you can safely assume that yield claims will be uniformly distributed throughout the year. That allows you to determine a very good estimate of Y(N) for 1 < N < 259200, and therefore decide whether it is worth it given the interest you would have to pay.

I do not think the solution to this is to destroy the fungibility of BitAssets. I think the solution is to have a better implementation of BitAsset yields. The yields for a BitAsset balance should always be known exactly (not estimated) and should be monotonically increasing (not necessarily strictly) over time. The order in which yields for BitUSD balances are claimed should not effect the yield of all other BitUSD balances (and same for all other BitAssets). Yields should be paid out of a yield pool. The amount of funds that move into the yield pool every block is enough to satisfy the target interest rate at that moment for all outstanding BitAssets (all BitAssets that are allowed to collect yield which does not include the BitAssets stored in the yield fund or the other reserve that feeds into the yield fund at the target rate). The target interest rate can change from block to block depending on the amount of BitAssets in the reserve pool compared to the amount of outstanding BitAssets that can collect yield, as well as other factors.

I believe an implementation of yield as described above not only makes yield more fair than the current system for BitAsset holders, but also makes it difficult for people to estimate Y(N), since it is hard to predict how the supply of BitAssets may change in the near future (existing shorts can be covered and new open short orders could be matched at any time) and how the market short interest rate will change in the near future (information from short interest changes should propagate very quickly to the target yield rate, meaning the DAC should collect short interest continuously and feed that into the reserve pool so that the target interest rate can adjust quickly based on that new information). So the attack you brought up (I hesitate to really even call it an attack) would become more of a gamble and thus not really an attack.
Title: Re: Yield question
Post by: zerosum on December 08, 2014, 03:16:09 am
...the way the yield is calculated currently...

Do you have a link (other info) for that?
Title: Re: Yield question
Post by: arhag on December 08, 2014, 03:45:40 am
...the way the yield is calculated currently...

Do you have a link (other info) for that?

This (https://bitsharestalk.org/index.php?topic=8520.msg110779#msg110779) with these updates (https://bitsharestalk.org/index.php?topic=8520.msg112027#msg112027) to it is the best I could find.

Define:
R(N) = Quantity of BitUSD in the yield pool as of block N
S(N) = Supply of BitUSD as of block N (not clear if this is total supply or only the supply that can collect yield)
T(N) = Timestamp of block N

Then, let's say you have a balance of B BitUSD at block M and then you want to move it to claim yield at block N > M. The yield Y on that balance would be calculated according to the formula:
Y = B * (R(N) /  S(N)) * ( 0.8 * (min((N-M), 3155673) / 3155673) + 0.2 * (min((N-M), 3155673) / 3155673)^2 )   if (N-M) >= 8640
or
Y = 0   if (N-M) < 8640


Let Y' = B * (R(N) / S(N))
and deltaT = T(N) - T(M)

Y = 0   if deltaT <= (1 day)
Y = Y'  if deltaT >= (1 year)
Y = Y' * ( 0.8 * (deltaT / 1 year) + 0.2 * (deltaT / 1 year)^2 )  if (1 day) < deltaT < (1 year)


Keep in mind the above is my interpretation of the linked posts. The devs would have to confirm if this is in fact representative of the actual code present in the current client.

Edit: Actually it appears the code (https://github.com/BitShares/bitshares/blob/master/libraries/blockchain/balance_operations_v1.cpp) deals with time directly and not block heights (I guess the timestamp that delegates include in the blocks are used as the trusted time source?).
Title: Re: Yield question
Post by: zerosum on December 08, 2014, 04:12:27 am
...the way the yield is calculated currently...

Do you have a link (other info) for that?

This (https://bitsharestalk.org/index.php?topic=8520.msg110779#msg110779) with these updates (https://bitsharestalk.org/index.php?topic=8520.msg112027#msg112027) to it is the best I could find.

Define:
R(N) = Quantity of BitUSD in the yield pool as of block N
S(N) = Supply of BitUSD as of block N (not clear if this is total supply or only the supply that can collect yield)

Then, let's say you have a balance of B BitUSD at block M and then you want to move it to claim yield at block N > M. The yield Y on that balance would be calculated according to the formula:
Y = B * (R(N) /  S(N)) * ( 0.8 * (min((N-M), 3155673) / 3155673) + 0.2 * (min((N-M), 3155673) / 3155673)^2 )   if (N-M) >= 8640
or
Y = 0   if (N-M) < 8640


Keep in mind the above is my interpretation of the linked posts. The devs would have to confirm if this is in fact representative of the actual code present in the current client.

Thanks for the fast response! Those are the posts I recall, although I could not find them, myself.

I have several intertwined points -
1. The current system continues to heavily undervalue the collected yield ( or be to slow to distribute it, in my rough/feel estimate).
2. drltc Had a more concise post explaining exactly where this calculation goes wrong; One of the main points of it was to the effect that the system will always accumulate yield and will more or less try to keep 1y of non-distributable interest.
3.Some changes were made (will be made ?), due to his input, now that he works for I3 (And I have seen no written record for those changes)

Anyway, thanks for the fast and pointed response!
Title: Re: Yield question
Post by: biophil on December 08, 2014, 05:30:00 am
Drltc posted an excellent proposal to redesign the yield system a couple months back as well. The current system is pretty hacky, I'll heartily agree with that.

The current system straddles that fine line between crude and elegant.

Sent from my SCH-S720C using Tapatalk 2

Title: Re: Yield question
Post by: zerosum on December 08, 2014, 06:05:42 am
...the way the yield is calculated currently...

Do you have a link (other info) for that?

This (https://bitsharestalk.org/index.php?topic=8520.msg110779#msg110779) with these updates (https://bitsharestalk.org/index.php?topic=8520.msg112027#msg112027) to it is the best I could find.

Define:
R(N) = Quantity of BitUSD in the yield pool as of block N
S(N) = Supply of BitUSD as of block N (not clear if this is total supply or only the supply that can collect yield)
T(N) = Timestamp of block N

Then, let's say you have a balance of B BitUSD at block M and then you want to move it to claim yield at block N > M. The yield Y on that balance would be calculated according to the formula:
Y = B * (R(N) /  S(N)) * ( 0.8 * (min((N-M), 3155673) / 3155673) + 0.2 * (min((N-M), 3155673) / 3155673)^2 )   if (N-M) >= 8640
or
Y = 0   if (N-M) < 8640


Let Y' = B * (R(N) / S(N))
and deltaT = T(N) - T(M)

Y = 0   if deltaT <= (1 day)
Y = Y'  if deltaT >= (1 year)
Y = Y' * ( 0.8 * (deltaT / 1 year) + 0.2 * (deltaT / 1 year)^2 )  if (1 day) < deltaT < (1 year)


Keep in mind the above is my interpretation of the linked posts. The devs would have to confirm if this is in fact representative of the actual code present in the current client.

Edit: Actually it appears the code (https://github.com/BitShares/bitshares/blob/master/libraries/blockchain/balance_operations_v1.cpp) deals with time directly and not block heights (I guess the timestamp that delegates include in the blocks are used as the trusted time source?).

Well, this formula reduces the yield in any case of  growth of the total bitAssets outstanding (from 5% to 3.12% for a very conservative 10% monthly growth (from 1 Mill to  2.853 Mil for the whole year) in the next year, in the total available bitUSD).  And as we expect/hope for massive growth in that area he should find probably some distribution schedule of those yields/interest (or alternatively, calculations from the 'origination point', but those seam more calculation expensive).
Title: Re: Yield question
Post by: monsterer on December 08, 2014, 09:08:29 am
Yeah, I see that... fair enough. Not sure if there's a good way around it though. You can't have the short pay interest directly to the long because you'd end up with different classes of bitUSD, some with a high interest rate, some with low.

Right now yield is very difficult to quantify because its completely variable for everyone. At least with the short paying the long, you'd know up front exactly what you were getting.

True, you'd end up with bitUSD's receiving different interest rates, but on the limit wouldn't they all end up mixed together anyway?
Title: Re: Yield question
Post by: bytemaster on December 08, 2014, 03:41:18 pm
Yeah, I see that... fair enough. Not sure if there's a good way around it though. You can't have the short pay interest directly to the long because you'd end up with different classes of bitUSD, some with a high interest rate, some with low.

Right now yield is very difficult to quantify because its completely variable for everyone. At least with the short paying the long, you'd know up front exactly what you were getting.

True, you'd end up with bitUSD's receiving different interest rates, but on the limit wouldn't they all end up mixed together anyway?

There will be a separate bond market for guaranteed returns. 
Title: Re: Yield question
Post by: theoretical on December 08, 2014, 07:55:08 pm
There will be a separate bond market for guaranteed returns.

Do we have a spec for this yet?  Will this be a 1.0 feature?
Title: Re: Yield question
Post by: hpenvy on December 12, 2014, 05:15:15 am
There will be a separate bond market for guaranteed returns.

Do we have a spec for this yet?  Will this be a 1.0 feature?

Same question.