BitShares Forum

Main => General Discussion => Topic started by: bytemaster on October 02, 2014, 04:40:45 pm

Title: The Future of the BTSX Market Engine...
Post by: bytemaster on October 02, 2014, 04:40:45 pm
We plan to make one last change to the market engine prior to locking it in stone for many months and changing to a much slower release cycle.

Short orders can only get filled under these conditions:

1) There is someone willing to buy BitUSD at the price feed
2) AND Your short order offers the highest interest rate
3) AND Your price limit is lower than the feed  (BTSX per USD) or you didn't specify a price limit.
4) AND You have enough collateral to provide 2x backing at the feed price (amount of USD for short sale will vary with feed price)
5) OR Your price limit is higher than the feed (BTSX per USD) and someone is willing to buy at your price limit.

Short orders are forced to cover after 30 days by taking the best offers at the time.  No fee is charged.
Short orders are forced to cover when 75% of their collateral is required to cover, leaving the short with 25% of the collateral minus a 5% fee. 
The 5% fee is assessed as a percent of the collateral left over after covering.

The maximum interest rate shorts can pay is 1000% APR
The initial collateral ratio will be 3x rather than 2x  (2x from short + 1x from long)

Interest charged will accumulate to the yield fund.

How is this better than *everything else* we have tried before it? 
1) First attempt charged a *fee* for short overlap, this fee basically bid up the spread and the amount of time a short would have to wait to cover profitably and made market makers unprofitable.
2) Second attempt (currently implemented) has shorts bid up collateral, but this provides less and less benefit to the network as prices go higher... ie: 10x collateral only provides 5% more downward protection than 5x collateral. 

How can I be sure we "have it right now"? 
1) It only makes sense that if you are borrowing USD you should be paying interest....
2) It only makes sense that if you are borrowing USD there is a fixed repayment time...
3) We are not price fixing the interest rate, it is being set at "auction" at the current price feed.
4) Time based fees encourage covering sooner rather than holding forever which improves liquidity.
5) It only makes sense that the creditors (holders of it BitUSD) be compensated for their risk at market rates.
6) BitUSD supply will rise to meet the demand of the shorts and the market activity will be more robust

It has been very tricky to figure out this market with two dimensions (price and interest) and we have been evolving toward steadily improving systems.   The great thing about this latest solution is that it realizes almost all of my original goal of interest paying BitUSD funded by the shorts.   BTS with market based interest rates..... you know those two upgrades we talked about 6 months ago that were being postponed until we tried the interest-free version.    Well in just 1 month we have learned, adapted, and deployed a system that does what I thought would take 6 months and a new DAC to implement. 

We have only had to make one compromise so far:  price feeds. 

The remaining weaknesses are: 
  1) shorts don't get to pick the price, just a limit and the rate 
  2) the price feed is slow to update and does not allow internal price discovery.
  3) the market is asymmetric (you cannot short BTSX backed by USD)
  4) you cannot short BitGLD backed by BitUSD (or any other combo)
 
We have a roadmap for addressing all of these:

1) Implementing a bond market that allows USD longs to LEND to shorts for fixed term with a bid/ask system setting the interest rate.  This will create no new BitUSD but will give shorts freedom to set their price without respect to the feed and hold for longer than 30 days.

2) Implementing a prediction market that trades on the ERROR in the price feed.  This prediction market will then allow continuous, real time, price discovery on the blockchain by continuously discovering the % delta between the price feed and real price.  It can be speculated on without losing any exposure to BTSX and with limits that can be used to halt trading on the USD/BTSX market if the feed error is too great.   The USD/BTSX market can then use FEED_PRICE * PERCENT_ERROR.   In this way delegates are only responsible for "getting close" with their feeds and a free market will continuously update the price at which shorts can execute.

These last 2 items are not critical and price feeds are likely more accurate than a thin error market.   For this reason we will not be implementing them until after BitAssets have proven themselves for 3+ months *AND* we have done a very careful test network.   Getting BitUSD right has required rapid tweaking and updates, but the rate of change is not healthy for BTSX or others and has many risks due to bugs.   So I think these last two enhancements are not high priority and we will instead focus on light weight clients, multi-sig, etc.

We are working to make BTSX and the toolkit the most robust financial platform we can with as little trust as possible in anything but the market.
Title: Re: The Future of the BTSX Market Engine...
Post by: Xeldal on October 02, 2014, 04:48:39 pm
 +5% This is fantastic! Great work!  +5%
Title: Re: The Future of the BTSX Market Engine...
Post by: xeroc on October 02, 2014, 04:55:13 pm
very detail, much rules, .. aehm .. screw it ... nicely written .. we should copy&pasta this into the wiki ..
I will be offline for the weekend so maybe some else can handly it ..

It's exciting to see babies grow!
Title: Re: The Future of the BTSX Market Engine...
Post by: GaltReport on October 02, 2014, 04:57:22 pm
We plan to make one last change to the market engine prior to locking it in stone for many months ...

Glad to hear this.  i think we are near (past?) the point of diminishing returns with respect to the time spent on this for the return.  Maybe that will free up more time to focus on marketing, partnering and networking to facilitate further BitSharesX/BitUSD utility in all the ways discussed. 

Edit: I have this re-occurring nightmare that someone else is going to come along with less tech but better marketing/partnering and eat our lunch. :(
Title: Re: The Future of the BTSX Market Engine...
Post by: Method-X on October 02, 2014, 05:03:14 pm
It's definitely a good idea to finalize this as soon as possible and focus on BitUSD adoption. The PEG is tracking very well for all assets and is therefore ready to be marketed.
Title: Re: The Future of the BTSX Market Engine...
Post by: nomoreheroes7 on October 02, 2014, 05:27:45 pm
Are we at the point of a stable client then? Or are people still experiencing instability?

I'm curious just how close to the true marketing push we really are...
Title: Re: The Future of the BTSX Market Engine...
Post by: Rune on October 02, 2014, 05:51:58 pm
IMO interest rates are the only economically efficient way to allocate loans.

Perhaps later several bitUSD assets can be created with different collateral requirements. Assets with lower collateral levels could be created to cater to those who wish to speculate in higher interest rates paid by shorts and are willing to assume the higher risk, and could be called bitUSD_interest. Standard BitUSD could then be geared towards being used primarily for spending by normal people, where as the other assets can be differentiated towards the different customers/investors/speculators needs, instead of the current system of a single "catch all" asset that is difficult to determine if it has an appropriate collateral level.
Title: Re: The Future of the BTSX Market Engine...
Post by: Agent86 on October 02, 2014, 06:05:15 pm
I'm sure some people are tired of debating these things and I agree that things like multi-sig (also offline transaction signing, cold storage, non-TITAN functionality) are more important than market tweaks as long as the market works good enough for now.

Here is my take on changes:

-If we switch to 30 day required covering and this 30 day timeframe is deemed important/needed, I really hope we don't grandfather current shorts more than a couple months if at all; the health and liquidity of the whole system is more important than some individuals' desire to keep their leveraged position... everyone else shouldn't have to wait a year to see what the end result looks like.

The initial collateral ratio will be 3x rather than 2x  (2x from short + 1x from long)
Why is this the right amount of collateral?
10x collateral only provides 5% more downward protection than 5x collateral. 
I'm not sure I follow this.
remaining weaknesses are:  ...
  3) the market is asymmetric (you cannot short BTSX backed by USD)
  4) you cannot short BitGLD backed by BitUSD (or any other combo)
I don't understand the need for these things.
We have a roadmap for addressing ...
2) Implementing a prediction market that trades on the ERROR in the price feed.  This prediction market will then allow continuous, real time, price discovery on the blockchain by continuously discovering the % delta between the price feed and real price.  It can be speculated on without losing any exposure to BTSX and with limits that can be used to halt trading on the USD/BTSX market if the feed error is too great.   The USD/BTSX market can then use FEED_PRICE * PERCENT_ERROR.   In this way delegates are only responsible for "getting close" with their feeds and a free market will continuously update the price at which shorts can execute.
I don't see the need; the central market already accomplishes this in and of itself.  As it is right now, smart traders will make their trades based on the real exchange rate, not the feed as long as they expect the feed to track toward the right answer over the long run.  If the feed is wrong you shouldn't overpay and buy expensive bitUSD.  By the same token if the feed is wrong in the other direction you shouldn't sell bitUSD cheap because you know the feed will eventually correct and the market will eventually correct and 1 bitUSD will equal $1 in the long run so if the market is inefficient that is a profit opportunity.

Overall I'm not getting this and I still prefer priority by collateral, and using a bond market to manage interest rates.


Title: Re: The Future of the BTSX Market Engine...
Post by: Empirical1.1 on October 02, 2014, 06:23:48 pm
+5% This is fantastic! Great work!  +5%

 +5% I think the plan is great.

Obviously it 'price fixes' collateral, but I'm fine with that.
Title: Re: The Future of the BTSX Market Engine...
Post by: Fox on October 02, 2014, 06:40:55 pm
Congratulations go out to the development team on their successful implementation of the market peg.

I very much look forward to the multi-sig feature enhancement and additional marketing.
Title: Re: The Future of the BTSX Market Engine...
Post by: bytemaster on October 02, 2014, 07:19:19 pm
I'm sure some people are tired of debating these things and I agree that things like multi-sig (also offline transaction signing, cold storage, non-TITAN functionality) are more important than market tweaks as long as the market works good enough for now.

Here is my take on changes:

-If we switch to 30 day required covering and this 30 day timeframe is deemed important/needed, I really hope we don't grandfather current shorts more than a couple months if at all; the health and liquidity of the whole system is more important than some individuals' desire to keep their leveraged position... everyone else shouldn't have to wait a year to see what the end result looks like.

The initial collateral ratio will be 3x rather than 2x  (2x from short + 1x from long)
Why is this the right amount of collateral?

I have addressed this in other places... there is no clear way to know the right collateral level and competing for shorts based on collateral doesn't actually establish a market rate for collateral is just causes the network to buy as much collateral as possible given the short vs USD demand.  IE: it maximizes collateral. 

10x collateral only provides 5% more downward protection than 5x collateral. 
I'm not sure I follow this.
If you have 2x collateral, it protects you against an 50% black swan.   Cost 100%    Gain 100%     Ratio  1
If you have 3x collateral, it protects you against an 66% black swan.   Cost +50%    Gain +32%    Ratio  .64
If you have 4x collateral, it protects you against an 75% black swan.   Cost +33%    Gain +13%    Ratio  .39
If you have 5x collateral, it protects you against an 80% black swan.   Cost +25%    Gain +6%      Ratio  .24
If you have 6x collateral, it protects you against an 83% black swan.        ...
If you have 7x collateral, it protects you against an 86% black swan.
If you have 8x collateral, it protects you against an 87.5% black swan.
If you have 9x collateral, it protects you against an 88.9% black swan.
If you have 10x collateral, it protects you against an 90% black swan

You can see that the benefit/cost of adding collateral decreases exponentially which means that all collateral levels approach the same value to the network.   The probability of a black swan is on a bell curve which plots the probability of each black swan happening at different levels decaying at an even faster rate than the linear model this cost benefit analysis assumes.   I figure a black swan will either be 100% or nothing close to 50 or 66%.   Even a 66% fall isn't fatal to BitUSD... given its interest rate. 

So we would be pouring money into collateral that could be poured into marketing incentive of interest.  It is clear to me which will increase BTSX value faster.

remaining weaknesses are:  ...
  3) the market is asymmetric (you cannot short BTSX backed by USD)
  4) you cannot short BitGLD backed by BitUSD (or any other combo)
I don't understand the need for these things.
We have a roadmap for addressing ...
2) Implementing a prediction market that trades on the ERROR in the price feed.  This prediction market will then allow continuous, real time, price discovery on the blockchain by continuously discovering the % delta between the price feed and real price.  It can be speculated on without losing any exposure to BTSX and with limits that can be used to halt trading on the USD/BTSX market if the feed error is too great.   The USD/BTSX market can then use FEED_PRICE * PERCENT_ERROR.   In this way delegates are only responsible for "getting close" with their feeds and a free market will continuously update the price at which shorts can execute.
I don't see the need; the central market already accomplishes this in and of itself.  As it is right now, smart traders will make their trades based on the real exchange rate, not the feed as long as they expect the feed to track toward the right answer over the long run.  If the feed is wrong you shouldn't overpay and buy expensive bitUSD.  By the same token if the feed is wrong in the other direction you shouldn't sell bitUSD cheap because you know the feed will eventually correct and the market will eventually correct and 1 bitUSD will equal $1 in the long run so if the market is inefficient that is a profit opportunity.

Overall I'm not getting this and I still prefer priority by collateral, and using a bond market to manage interest rates.

I agree that the error market may not ever be necessary given external price discovery processes. 
Title: Re: The Future of the BTSX Market Engine...
Post by: tonyk on October 02, 2014, 07:24:04 pm
As I already said - I am pretty surprised* by the fact how much I  like this new proposal. 
I like it a lot and I like it for more than one reason...+5%



Several points/questions (when you find the time BM):

-How the  interest   works?
The short sets the interest at say  I = 10% annually, if it closes, say 7 days after opening the position, the system collects   Int=  7 / 365 * I * price at close * #ButUSD  and does this from the collateral? If not how do you do it ?

-When we have the interest in place, the need to re-short is somewhat diminished. The only definite advantage, in my view, is to force the loosing short position to be re-collateralized (aka keeping the overall collateralization at high level). In this regard maybe only do the 30 day  force-close, just for short positions below 300% collateral?
Forcing everybody to close will probably make everybody reevaluate more often and maybe provide more regular input on the current market conditions (including interest rates), which might be good by itself. I do not know...



*[In General I do believe that anything other then 2x collateral put one side of the trade in disadvantage, but this is just theoretical  understanding on my part; in practice I find this insignificant regarding this proposal in the medium and medium-long term]



Title: Re: The Future of the BTSX Market Engine...
Post by: bytemaster on October 02, 2014, 07:33:08 pm
As I already said - I am pretty surprised by the fact how much I  like this new proposal. 
I like it a lot and I like it for more than one reason...+5%



Several points/questions (when you find the time BM):

-How the  interest   works?
The short sets the interest at say  I = 10% annually, if it closes, say 7 days after opening the position, the system collects   Int=  7 / 365 * I * price at close * #ButUSD  and does this from the collateral? If not how do you do it ?

-When we have the interest in place, the need to re-short is somewhat diminished. The only definite advantage, in my view, is to force the loosing short position to be re-collateralized (aka keeping the overall collateralization at high level). In this regard maybe only do the 30 day  force-close, just for short positions below 300% collateral?
Forcing everybody to close will probably make everybody reevaluate more often and maybe provide more regular input on the current market conditions (including interest rates), which might be good by itself. I do not know...

The purpose of the forced cover period is to provide USD liquidity when the demand for USD falls but the demand for shorts doesn't.   

The interest works as so:

If you are paying 10% per month interest... and you are short $100 then you will owe $110 USD to reclaim your collateral after 30 days.
If after 15 days you wish to reclaim your collateral you will owe $105
If on day 15 you partially cover by paying $50 then the network will charge you $2.50 in interest and your balance will be $52.50 and on day 30 you will pay $52.50 + $5.25 to close your position either manually or by automatic margin call. 


Title: Re: The Future of the BTSX Market Engine...
Post by: Agent86 on October 02, 2014, 07:57:48 pm
10x collateral only provides 5% more downward protection than 5x collateral. 
I'm not sure I follow this.
If you have 2x collateral, it protects you against an 50% black swan.   Cost 100%    Gain 100%     Ratio  1
If you have 3x collateral, it protects you against an 66% black swan.   Cost +50%    Gain +32%    Ratio  .64
If you have 4x collateral, it protects you against an 75% black swan.   Cost +33%    Gain +13%    Ratio  .39
If you have 5x collateral, it protects you against an 80% black swan.   Cost +25%    Gain +6%      Ratio  .24
If you have 6x collateral, it protects you against an 83% black swan.        ...
If you have 7x collateral, it protects you against an 86% black swan.
If you have 8x collateral, it protects you against an 87.5% black swan.
If you have 9x collateral, it protects you against an 88.9% black swan.
If you have 10x collateral, it protects you against an 90% black swan

You can see that the benefit/cost of adding collateral decreases exponentially which means that all collateral levels approach the same value to the network.   The probability of a black swan is on a bell curve which plots the probability of each black swan happening at different levels decaying at an even faster rate than the linear model this cost benefit analysis assumes.   I figure a black swan will either be 100% or nothing close to 50 or 66%.   Even a 66% fall isn't fatal to BitUSD... given its interest rate. 

So we would be pouring money into collateral that could be poured into marketing incentive of interest.  It is clear to me which will increase BTSX value faster.

This is honestly just bad math or a misleading way of wording things.

i.e. if you invested after a 90% drop/correction and then the market cap lost half it's value from there, you experienced a 50% loss.  Describing this as "just a 5% drop" (by using the all time high as a baseline) is silly and misleading.
Title: Re: The Future of the BTSX Market Engine...
Post by: bytemaster on October 02, 2014, 08:07:50 pm
10x collateral only provides 5% more downward protection than 5x collateral. 
I'm not sure I follow this.
If you have 2x collateral, it protects you against an 50% black swan.   Cost 100%    Gain 100%     Ratio  1
If you have 3x collateral, it protects you against an 66% black swan.   Cost +50%    Gain +32%    Ratio  .64
If you have 4x collateral, it protects you against an 75% black swan.   Cost +33%    Gain +13%    Ratio  .39
If you have 5x collateral, it protects you against an 80% black swan.   Cost +25%    Gain +6%      Ratio  .24
If you have 6x collateral, it protects you against an 83% black swan.        ...
If you have 7x collateral, it protects you against an 86% black swan.
If you have 8x collateral, it protects you against an 87.5% black swan.
If you have 9x collateral, it protects you against an 88.9% black swan.
If you have 10x collateral, it protects you against an 90% black swan

You can see that the benefit/cost of adding collateral decreases exponentially which means that all collateral levels approach the same value to the network.   The probability of a black swan is on a bell curve which plots the probability of each black swan happening at different levels decaying at an even faster rate than the linear model this cost benefit analysis assumes.   I figure a black swan will either be 100% or nothing close to 50 or 66%.   Even a 66% fall isn't fatal to BitUSD... given its interest rate. 

So we would be pouring money into collateral that could be poured into marketing incentive of interest.  It is clear to me which will increase BTSX value faster.

This is honestly just bad math or a misleading way of wording things.

i.e. if you invested after a 90% drop/correction and then the market cap lost half it's value from there, you experienced a 50% loss.  Describing this as "just a 5% drop" (by using the all time high as a baseline) is silly and misleading.

From the perspective of "before the event" to "after the event" as a single event I am not being misleading.    The what is the probability of a fall from "current prices" to "the level required to wipe out collateral".     Are you saying that the probability of falling an extra 5% from the top is equal to the probability of falling 50% from any price?
Title: Re: The Future of the BTSX Market Engine...
Post by: Agent86 on October 02, 2014, 08:25:13 pm
10x collateral only provides 5% more downward protection than 5x collateral. 
From the perspective of "before the event" to "after the event" as a single event I am not being misleading.    The what is the probability of a fall from "current prices" to "the level required to wipe out collateral".     Are you saying that the probability of falling an extra 5% from the top is equal to the probability of falling 50% from any price?
Yes, the probability that the original price drops 5% (happens all the time due to volatility) is much more likely than the probability of a full 95% drop occurring assuming it already dropped 90% because this is in actuality a 50% price difference.

10x collateral is twice the collateral of 5x collateral.  It is much more accurate to say that this offers twice the protection than to say that this offers "5% more protection."
Title: Re: The Future of the BTSX Market Engine...
Post by: theoretical on October 02, 2014, 08:30:13 pm
If you are paying 10% per month interest... and you are short $100 then you will owe $110 USD to reclaim your collateral after 30 days.
If after 15 days you wish to reclaim your collateral you will owe $105
If on day 15 you partially cover by paying $50 then the network will charge you $2.50 in interest and your balance will be $52.50 and on day 30 you will pay $52.50 + $5.25 to close your position either manually or by automatic margin call. 

There's something amiss with these numbers.  We need to track interest and principal separately, because interest dollars don't generate income, but principal dollars do.

- $100 initial principal generates $5 in interest over the first 15 days.
- $52.50 is used to pay down $50 in principal and $2.50 in interest at 15 days.
- $50 remaining principal has $2.50 interest remaining, and generates $2.50 in interest over the second 15 days.
- The balance at one month is now $50 principal plus $5.00 interest.
- The total interest paid should be $2.50 after 15 days, plus $5.00 after one month.

Your algorithm makes the partial cover operation cause interest dollars to start generating income, and that's why it charges greater interest [1] [2].  In other words, the interest doesn't compound if you let it sit, but a partial cover (in your algorithm) would be "manual compounding".

We don't want this, because it would dis-incentivize partial covering.  (Partial covering is desirable from a policy standpoint because it improves the collateral ratio and makes BitUSD more solid.)

[1] I think you meant $52.50 + $2.625 on the last day, otherwise you'd be double counting somewhere and charging a total of $10.25!

[2] Even if we go with $2.50 + $2.625 on the last day, we get $7.625 in interest with your algorithm.  The $0.125 is 5% of the $2.50 remaining interest after 15 days.
Title: Re: The Future of the BTSX Market Engine...
Post by: bytemaster on October 02, 2014, 08:41:56 pm
If you are paying 10% per month interest... and you are short $100 then you will owe $110 USD to reclaim your collateral after 30 days.
If after 15 days you wish to reclaim your collateral you will owe $105
If on day 15 you partially cover by paying $50 then the network will charge you $2.50 in interest and your balance will be $52.50 and on day 30 you will pay $52.50 + $5.25 to close your position either manually or by automatic margin call. 

There's something amiss with these numbers.  We need to track interest and principal separately, because interest dollars don't generate income, but principal dollars do.

- $100 initial principal generates $5 in interest over the first 15 days.
- $52.50 is used to pay down $50 in principal and $2.50 in interest at 15 days.
- $50 remaining principal has $2.50 interest remaining, and generates $2.50 in interest over the second 15 days.
- The balance at one month is now $50 principal plus $5.00 interest.
- The total interest paid should be $2.50 after 15 days, plus $5.00 after one month.

Your algorithm makes the partial cover operation cause interest dollars to start generating income, and that's why it charges greater interest [1] [2].  In other words, the interest doesn't compound if you let it sit, but a partial cover (in your algorithm) would be "manual compounding".

We don't want this, because it would dis-incentivize partial covering.  (Partial covering is desirable from a policy standpoint because it improves the collateral ratio and makes BitUSD more solid.)

[1] I think you meant $52.50 + $2.625 on the last day, otherwise you'd be double counting somewhere and charging a total of $10.25!

[2] Even if we go with $2.50 + $2.625 on the last day, we get $7.625 in interest with your algorithm.  The $0.125 is 5% of the $2.50 remaining interest after 15 days.

I am aware the issue and know that it does cost extra for partial covering.   You end up paying interest on your interest.... result: partial covering has fees associated with it that are magnified by the insane interest rate used in the example. 

The challenge is calculating the result without adding yet another data field to every order... to track the start date and end date. 

I suppose I might as well store extra data rather than using a crude approximation. 
Title: Re: The Future of the BTSX Market Engine...
Post by: liondani on October 02, 2014, 08:58:31 pm

If you have 2x collateral, it protects you against an 50% black swan.   Cost 100%    Gain 100%     Ratio  1
If you have 3x collateral, it protects you against an 66% black swan.   Cost +50%    Gain +32%    Ratio  .64
If you have 4x collateral, it protects you against an 75% black swan.   Cost +33%    Gain +13%    Ratio  .39
If you have 5x collateral, it protects you against an 80% black swan.  Cost +25%    Gain +6%      Ratio  .24
If you have 6x collateral, it protects you against an 83% black swan.        ...
If you have 7x collateral, it protects you against an 86% black swan.
If you have 8x collateral, it protects you against an 87.5% black swan.
If you have 9x collateral, it protects you against an 88.9% black swan.
If you have 10x collateral, it protects you against an 90% black swan

You decided for 3x collateral that means protection against a 66% black swan...
Is the remaining 34% not a serious possibility/threat? (is it not because it's only theoretical?)
Would we be not more comfortable with a 5x collateral and a 80% "protection"?
And maybe we could even "promote" somehow the 5x collateral with the help of our  +5% meme
and maybe even with a 5% default yearly interest rate that increase depended on the willingness of the shorters(?)....

imagine the number 5 rules (from a marketing view of point)    5x collateral, 5% interest ,  +5% our meme....

Maybe I am totally wrong with my thoughts, I suck on economics after all....
BUT I suggest you before implementing the 3x collateral to make a simple typical poll thread where you ask the community what they want....

for example:

How much collateral do you thing is needed to implement on the exchange market?

1. 2x
2. 3x
3. 4x
4. 5x
5. 6x
6. 7x
7. Let the shorter choose the collateral ratio
8. I don't know 
9. Iet the dev's decide, I trust them.

I thing even the competitors will not blame you in future for that decision when it was taken by community consensus...
We could use it as marketing wapon, that the community makes many critical decisions together etc....


PS after all I really believe we will have the same result or at least very close to your initial proposal.... or a better one (?) (from agent86 maybe?)
Title: Re: The Future of the BTSX Market Engine...
Post by: starspirit on October 02, 2014, 09:30:43 pm
Just want to check I understand the interest - so shorts compete on interest, thus have different rates, and the network collects this in the pool that longs earn through their BitYield?

Also is there a fixed date when this will all be locked in stone (for now)?

Thanks
Title: Re: The Future of the BTSX Market Engine...
Post by: theoretical on October 02, 2014, 10:26:46 pm
I am aware the issue and know that it does cost extra for partial covering.   You end up paying interest on your interest.... result: partial covering has fees associated with it that are magnified by the insane interest rate used in the example. 

The challenge is calculating the result without adding yet another data field to every order... to track the start date and end date. 

I suppose I might as well store extra data rather than using a crude approximation.

If you do continuous compounding, then interest and principal dollars generate interest at the same rate and don't need to be tracked separately.  The amount payable is f(t) = initial_principal * (1+r)^t where t is the time in months and r=1.10 is the monthly rate.

Continuous compounding is technically doable.  I'll post an example of what the numbers would look like in another post.  I would actually recommend doing continuous compounding if the story ended there.  But there's more:  Linear compounding has one highly desirable feature that continuous compounding does not.  With linear interest, you can figure out per-block short interest income for the network as a whole:  Just keep track of the sum of the shorts' per-block interest!  We could (and I think we should) pay the interest income directly to the yield fund as it accrues, rather than waiting for shorts to close.

If you have a bunch of outstanding shorts using exponential compounding with different exponents and expiration dates, I think this immediate payment would be impossible for technical reasons [1] [2].

Therefore, my recommendation is to stick with linear compounding, and consider implementing paying the accrued interest to the yield fund immediately every block (not a super high priority, so we should probably testnet this first).

[1] It would theoretically be possible if we were willing to spend O(N) computation every block, where N is the number of shorts that exist.  We aren't willing to do that, as "not breaking the network" is a higher priority than "paying yield a little sooner" :)

[2] I don't think paying exact interest as it's accrued would be possible with exponential compounding, but you might be able to figure out some approximate lower bound that you only need to update when a short opens or covers.
Title: Re: The Future of the BTSX Market Engine...
Post by: theoretical on October 02, 2014, 10:27:00 pm

Let's walk through the bookkeeping of a partial cover with continuous compounding.  Basically you compute f(t), subtract the payment amount, re-figure the initial principal based on the new amount, and treat it the same as you'd treat a loan with that re-figured initial principal.  Let's imagine the user pays $52.50 on $100 at 10% monthly rate at 15 days, just like before.

- (1.10)^(0.5 months) = 1.048809 (always round up), so $104.8809 is the balance at 15 days.
- Subtract the $52.50 payment, you now have $52.3809 left.
- Solve for what the initial principal would have been on a loan with a current balance of $52.3809 at 15 days left ("implied initial principal").
- You get 52.3809 / 1.048808 (always round down here), giving $49.9433 (rounded up) as the implied initial principal.
- Now compound $49.9433 at 1.10 to get the new value of interest due at maturity (basically we un-counted the first 15 days when we did the implied initial principal computation, so we have to re-count it by doing the whole month).
- $4.9944 interest (always round up) + $49.9433 gives a total of $54.9377 due at maturity.  The collateral ratio and margin call price would then be calculated using $54.9377.
- $54.9377 + $52.50 = $107.4377 total repayment.

Of course, to do this bookkeeping, you have to compute f(t) for fractional t.  Which is non-trivial with integer arithmetic.  You can make it easier by having all computations internally use a per-block interest rate; per-month or APR is strictly for the convenience of using human-friendly units when displaying values to the user.  Using fixed-point arithmetic with 32-bit fractional part, per-block interest would have a resolution of under 0.08% APR.  Increasing to 48-bit fractional part gives APR resolution of about 1.1 millionths of a percentage point -- more than good enough.  With 64-bit values you have 16 bits before we overflow, if we ever exceed 100% in some computation.

You'd get some full 128-bit products in intermediate computations, but I think you mentioned in another thread you already have library functions for dealing with 128-bit values.
Title: Re: The Future of the BTSX Market Engine...
Post by: bytemaster on October 02, 2014, 10:52:56 pm
With the interest rates we are talking about and the terms we are talking this will merely encourage people to "cover all at once" and prior to expiration.

You can "partially cover" by being short and long at the same time....

The extra fee just motivates users to be more economical with their transactions and to avoid waiting until the end of their interest period. 

The complex math involved to do it right has many issues with performance at high transaction volumes, rounding errors, etc. 

Worst case: user pays interest on their interest.  Best case: user pays simple interest.   
Title: Re: The Future of the BTSX Market Engine...
Post by: zhao150 on October 02, 2014, 11:02:27 pm
Good idea
Title: Re: The Future of the BTSX Market Engine...
Post by: arhag on October 03, 2014, 12:08:09 am
I think this is a decent compromise, all things considered. Who knows if the 3x collateral is enough (to protect against 66% flash crashes), but there has to be some balance that we decide and going over too much just hurts our ability to use interest for more productive purposes. Also, if a black swan event does occur, and there are more BitAssets issued than the BTSX value backing them, the DAC can simply burn the BitAssets collected as interest from shorts from that point forward until balance is restored. During that time, yields would all go to zero, but after balance is restored, yields would resume. With this policy in place, BitAssets might hold their value even in the event of a black swan event. I think it would be even better if a reserve fund of BitAssets, with a sensible dynamic minimum limit, were held to immediately burn as much as necessary to restore balance in the event of a black swan event for the purpose of quickly restoring market confidence.

And I agree with bytemaster here:
Why is this the right amount of collateral?

I have addressed this in other places... there is no clear way to know the right collateral level and competing for shorts based on collateral doesn't actually establish a market rate for collateral is just causes the network to buy as much collateral as possible given the short vs USD demand.  IE: it maximizes collateral. 

The shorts don't care about finding the optimal collateral ratio to maximize long-term market confidence/desire in the system (meaning decreasing the risk of black swan events while also increasing the utility/value of BitAssets). They just care about getting in front of the line but with enough leverage that it is still individually profitable for them to short. This just maximizes the collateral the shorts are willing to offer under the constraint that they still believe they can profit in the short-term. I don't know if we can expect the strong believers of BTSX growth (at least in the short-term) to properly access the risk of black swan failure. If we got rid of the reserve requirements and there was little competition for shorts, they might drive down the collateral ratio to something only a little higher than 134% (above the margin call limit where 75% of collateral is needed to pay the debt). We, the shareholders of the DAC and long-term holders of BTSX, impose a minimum collateral to protect BitAsset holders against the risk of black swan because of the overeagerness of the shorts. I am not sure what the proper number is, but once we have that minimum limit I see no reason why we need to allow the market to increase it any higher for the purposes of getting shorts matched (instead letting shorts compete by interest rate makes more sense).

I am also not sure if we can devise a market mechanism to dynamically find the new optimal collateral ratio needed. Perhaps as the price (BTSX per BitAsset) of BitAsset sells (not short sells) drops further and further below the price feed, the mandated minimum collateral requirements for new shorts can increase to compensate? The reasoning behind this is that perhaps the discount in the BitAsset price is because of the risk of black swans, and so decreasing that risk through higher collateral will eventually stimulate demand for BitAssets. Anyway, I don't think any of that is really necessary. Allowing the DAC to specify a fixed minimum collateral requirement per BitAsset (and maybe later on we can have the flexibility to adjust it with shareholder approval) is good enough IMO. And the 3x collateral bytemaster proposed seems reasonable to me for now.


-If we switch to 30 day required covering and this 30 day timeframe is deemed important/needed, I really hope we don't grandfather current shorts more than a couple months if at all; the health and liquidity of the whole system is more important than some individuals' desire to keep their leveraged position... everyone else shouldn't have to wait a year to see what the end result looks like.

I'm fine with this.


remaining weaknesses are:  ...
  3) the market is asymmetric (you cannot short BTSX backed by USD)
  4) you cannot short BitGLD backed by BitUSD (or any other combo)
I don't understand the need for these things.
We have a roadmap for addressing ...
2) Implementing a prediction market that trades on the ERROR in the price feed.  This prediction market will then allow continuous, real time, price discovery on the blockchain by continuously discovering the % delta between the price feed and real price.  It can be speculated on without losing any exposure to BTSX and with limits that can be used to halt trading on the USD/BTSX market if the feed error is too great.   The USD/BTSX market can then use FEED_PRICE * PERCENT_ERROR.   In this way delegates are only responsible for "getting close" with their feeds and a free market will continuously update the price at which shorts can execute.
I don't see the need; the central market already accomplishes this in and of itself.  As it is right now, smart traders will make their trades based on the real exchange rate, not the feed as long as they expect the feed to track toward the right answer over the long run.  If the feed is wrong you shouldn't overpay and buy expensive bitUSD.  By the same token if the feed is wrong in the other direction you shouldn't sell bitUSD cheap because you know the feed will eventually correct and the market will eventually correct and 1 bitUSD will equal $1 in the long run so if the market is inefficient that is a profit opportunity.

I also agree with the above. I don't really see the point in shorting BTSX using a BitAsset since the market is always going to be asymmetric because of the collateral ratio requirements and the fact that everything is ultimately backed by BTSX. Although, I do see some use in being able to short one BitAsset backed by another BitAsset (but maybe there should be different minimum collateral requirements depending on which BitAsset you back with since the risk of extreme BitAsset1 / BitAsset2 volatility depends on the chosen BitAsset pairs). Actually, thinking about it more, I would say BitAssets should not be shorted into existence by anything other than BTSX. If you want to do a separate bond market backed by other BitAssets, that is fine with me.


Overall I'm not getting this and I still prefer priority by collateral, and using a bond market to manage interest rates.

A bond market allows the shorts to directly pay the bond holders the interest (which also makes it nonfungible). The DAC doesn't get in the middle of this payment and get the opportunity to decide the best way to utilize those payments (for example, maybe not all of the interest should go to BitAsset yields, maybe there should be a yield rate cap and the excess should be given to delegates/workers). Prioritizing shorts by collateral kills all of this potential revenue for the DAC for the sake of potentially excessive and unnecessary black swan risk reduction. Using a bond market in its place, doesn't allow the DAC to take a cut either as I already mentioned.

Also, what exactly is the point of the bond market in this case? It doesn't stimulate demand for BitAssets, it stimulates demand for holding bonds. It is true that it locks up extra BTSX as collateral which can have a positive effect on the price. But I am not convinced that this BTSX wouldn't be effectively locked up anyway as people hold a lot of their wealth as BTSX for long-term growth. I think it makes more sense to have BitAsset yields paid for by the short interests. BitAssets are fungible and can be used like the money in your checking account (unlike bonds). Plus they receive much better yields than a typical bank, especially with the new market engine that allows shorts to pay interest.
Title: Re: The Future of the BTSX Market Engine...
Post by: theoretical on October 03, 2014, 01:08:40 am
I am aware the issue and know that it does cost extra for partial covering.   You end up paying interest on your interest.... result: partial covering has fees associated with it that are magnified by the insane interest rate used in the example. 

The challenge is calculating the result without adding yet another data field to every order... to track the start date and end date. 

I suppose I might as well store extra data rather than using a crude approximation.

I thought about this issue some more.  I think you can solve it by just figuring out what part of the payment goes to principal, and updating the initial principal.

Consider our example, where $100 short has an interest rate of 10% / month and the user covers with $52.50 at 15 days.

We said that a full cover would be $105 at 15 days, $100 principal and $5 interest.  The partial cover payment goes to principal and interest in the same 100 : 5 proportion.  A $52.50 payment would pay $50 to principal and $2.50 to interest.  (A $50 payment would pay $47.62 to principal and $2.38 to interest.)  So if the user pays $52.50, just update the initial principal to $50.  In other words, you just replace the record that says they took out a $100 short at 10% interest 15 days ago, with a "back-dated" record that says they took out a $50 short at 10% interest 15 days ago.

Then they would need $52.50 to do a full cover right now, so the numbers are right for doing a partial cover quickly followed by a full cover.  In 30 days they'll need $55 to do a full cover, and linearly in between.  The back-dated record is an accounting fiction which happens to make the numbers come out exactly right without needing another database field.
Title: Re: The Future of the BTSX Market Engine...
Post by: arhag on October 03, 2014, 01:25:37 am
I thought about this issue some more.  I think you can solve it by just figuring out what part of the payment goes to principal, and updating the initial principal.

Consider our example, where $100 short has an interest rate of 10% / month and the user covers with $52.50 at 15 days.

We said that a full cover would be $105 at 15 days, $100 principal and $5 interest.  The partial cover payment goes to principal and interest in the same 100 : 5 proportion.  A $52.50 payment would pay $50 to principal and $2.50 to interest.  (A $50 payment would pay $47.62 to principal and $2.38 to interest.)  So if the user pays $52.50, just update the initial principal to $50.  In other words, you just replace the record that says they took out a $100 short at 10% interest 15 days ago, with a "back-dated" record that says they took out a $50 short at 10% interest 15 days ago.

Then they would need $52.50 to do a full cover right now, so the numbers are right for doing a partial cover quickly followed by a full cover.  In 30 days they'll need $55 to do a full cover, and linearly in between.  The back-dated record is an accounting fiction which happens to make the numbers come out exactly right without needing another database field.

 +5% Looks good to me.

I also think it is unnecessary to complicate the calculations to implement continuous compounding interest for the shorts.
Title: Re: The Future of the BTSX Market Engine...
Post by: tonyk on October 03, 2014, 01:38:42 am
I am aware the issue and know that it does cost extra for partial covering.   You end up paying interest on your interest.... result: partial covering has fees associated with it that are magnified by the insane interest rate used in the example. 

The challenge is calculating the result without adding yet another data field to every order... to track the start date and end date. 

I suppose I might as well store extra data rather than using a crude approximation.

I thought about this issue some more.  I think you can solve it by just figuring out what part of the payment goes to principal, and updating the initial principal.

Consider our example, where $100 short has an interest rate of 10% / month and the user covers with $52.50 at 15 days.

We said that a full cover would be $105 at 15 days, $100 principal and $5 interest.  The partial cover payment goes to principal and interest in the same 100 : 5 proportion.  A $52.50 payment would pay $50 to principal and $2.50 to interest.  (A $50 payment would pay $47.62 to principal and $2.38 to interest.)  So if the user pays $52.50, just update the initial principal to $50.  In other words, you just replace the record that says they took out a $100 short at 10% interest 15 days ago, with a "back-dated" record that says they took out a $50 short at 10% interest 15 days ago.

Then they would need $52.50 to do a full cover right now, so the numbers are right for doing a partial cover quickly followed by a full cover.  In 30 days they'll need $55 to do a full cover, and linearly in between.  The back-dated record is an accounting fiction which happens to make the numbers come out exactly right without needing another database field.

For me the above is the straight-way to solve this 'incorrectness' but:
-Is it really that easy to update the initial order on a blockchain? Or will we will end up carrying well too much pretty unnecessary info for a average interest of 0.20833% And deference of like less then 10% of that?
Title: Re: The Future of the BTSX Market Engine...
Post by: theoretical on October 03, 2014, 01:50:23 am
I also think it is unnecessary to complicate the calculations to implement continuous compounding interest for the shorts.

You, me and bytemaster are all agreed that linear interest is preferred to exponential continuously compounding interest.  I just have a different reason for reaching the same conclusion.

I want to eventually implement interest from shorts being paid immediately to longs (via the yield fund), rather than waiting for shorts to close their positions.  With linear interest it should be fairly simple to do, since the network income from short interest would occur at a constant per-block rate that only changes when a short opens, closes or partially covers.  With continuous compounding interest, this immediate-payment feature is likely technically impossible (given practical engineering constraints).  For me, the potential to implement the immediate-payment feature is what really tips the scales in favor of linear interest.

I agree that linear interest computations are slightly simpler to implement, and linear interest is also the approach taken by current (or planned) code.  While certainly valid points, these arguments wouldn't quite be enough to tip the scales for me.  But they're a nice bonus when the potential for the immediate-payment feature has already tipped the scales in favor of linear interest :)
Title: Re: The Future of the BTSX Market Engine...
Post by: theoretical on October 03, 2014, 02:29:18 am
For me the above is the straight-way to solve this 'incorrectness' but:
-Is it really that easy to update the initial order on a blockchain? Or will we will end up carrying well too much pretty unnecessary info for a average interest of 0.20833% And deference of like less then 10% of that?

The blockchain itself will just contain two things (well not really, this is just a simplification, see [1] for the truth):

- On November 1, a transaction initiating the initial short.
- On November 16, a transaction executing the partial cover.

It's up to the client to compute the new margin call price from the information in these transactions, and figure out how much BitUSD liability the position has in the future when something else happens to it (which might be another partial cover, a full cover, a margin call, or expiration).

So the November 1 transaction remains the same forever (the blockchain is basically an append-only transaction log, that's kinda the whole point of having a blockchain).  The client's database record showing the open BitUSD short positions, OTOH, is a mutable record which is updated by transactions coming from the blockchain.  So when the November 16 transaction comes in, the client updates the principal amount in the database record for the open short position.

My point was that, if you have the client handle the partial cover transaction by updating its database record using the algorithm I described, you'll cause the existing logic to do exactly the right thing for any further operations on that short position (another partial cover, full cover, margin call, expiration).  Without requiring another column in the database.

[1] It actually doesn't even contain this much.  Basically the blockchain only contains the bare minimum information to tell the client how to update its database.  If the client can figure something out on its own from existing information, then that's what the client does.  It'd just be stupid and wasteful to use precious blockchain storage to store a copy of anything we could just have each client store locally.

In a little more detail:  From the answer vikram (one of the devs) gave to one of my questions this forum, BTSX does something called "virtual transactions."  Basically whenever market orders are matched, the resulting transaction is generated locally by the client and never exists on the blockchain itself.  So you'd have blockchain transactions for Alice entering the short order, and Bob entering the bid order.  The matching between Alice's and Bob's order wouldn't show up on the blockchain.  Instead, the client would figure out that the prices overlap, triggering the "virtual transaction" logic which is basically bunch of different database updates showing that Alice now has an active short position, Alice and Bob's BTSX has moved from their orders into the short position's collateral, Bob now has some newly printed BitUSD, and both of the orders are now gone (or maybe just one is gone if the quantity was unequal and one side got a partial fill).  The database updates caused by virtual transactions are only visible on the blockchain insofar as they affect what transactions are accepted in future blocks, i.e. if Bob tries to send BitUSD to Caitlin, it will now be accepted because every client will have performed the database update and every client's database will show that Bob has enough BitUSD (because of the update that happened when his bid overlapped Alice's short).  Whereas before the match, it might have failed because Bob would have had a smaller (maybe zero) BitUSD balance.

Of course there's also logic for fees, partial fills, yield, and lots of rounding going on.  Oh, and this also all has to be undoable to deal with forks, which can happen if a delegate is so late producing a block that the next delegate produces its own block, having decided that the first delegate is offline (but the first delegate did produce a block because it didn't get notified in time that the second delegate had produced a block).

In addition, the production BTSX client has to keep a copy of all previous versions of the market logic to figure out the database from blocks that happened before the current rules came into effect.  (On testnet, they just reset everything to the genesis state when they change the market engine, because testnet XTS / BitAssets are just "play money" and we don't care about resetting their ownership.)

Knowing about all of the machinery that has to exist, explains why I tend to be so patient and understanding when there are frequent updates to deal with various bugs :)
Title: Re: The Future of the BTSX Market Engine...
Post by: arhag on October 03, 2014, 02:45:36 am
You, me and bytemaster are all agreed that linear interest is preferred to exponential continuously compounding interest.  I just have a different reason for reaching the same conclusion.

...
For me, the potential to implement the immediate-payment feature is what really tips the scales in favor of linear interest.

I agree that linear interest computations are slightly simpler to implement, and linear interest is also the approach taken by current (or planned) code.  While certainly valid points, these arguments wouldn't quite be enough to tip the scales for me.

That's cool. I guess if we all come to the same conclusion anyway it doesn't really matter. But I am curious as to why you care so much about immediate payments. BitAssets are fungible so all of these short interest payments get mixed into a buffer fund anyway. I suppose the immediate nature of charging the interest thanks to the linear interest model (based on practical engineering constraints anyway) is useful in increasing the speed at which information propagates in this negative feedback loop (shorts deciding to pay higher interest -> higher yields on BitAssets available -> increased demand of BitAssets causes more bids to go over the price feed -> shorts ease off on their high interest rates and perhaps even set prices above the feed). But I think the speed of propagation is already good enough with the 1 month term limit and practical limits on how quickly humans [1] will change demand for BitAssets based on yield rate changes.  Also, if there was a cap of 5% yearly yield on BitAssets like I hope there will be, and the yield rate was consistently saturated at this cap for a long time, the feedback loop would be temporarily broken anyway so information propagation speed would be meaningless.

[1] Also, if you are considering most of the BitAsset buy demand to be controlled by bots, then the bots have the ability to predict the future BitAsset yield rate changes by examining the blockchain/database to see the interest rates set by the shorts and which shorts have yet to cover. The information propagation speed is just as fast for bots in a model where interest owed is only collected at cover time as it is would be for them in the immediate-payment models. So in a market where BitAsset buy demand is dominated by bots, what exactly is the benefit of the immediate-payment models (obviously other than the technical implementation simplicity that we have already discussed, although that is a property of the linear interest model not the immediate-payment model, which technically are orthogonal issues)? Also, the client could always tell the humans an estimated predicted yield rate change expected in the near future by examining the blockchain the same way bots do. So the advantages bots have over humans does not have to be any different in either models. Note that the accuracy of the estimated prediction of yield rate change would be dependent on computing power available (in particular when the number of outstanding shorts is large) up to the limit of perfect accuracy if the computer could calculate interest contributed from each short every block without following behind the rate at which blocks are produced.
Title: Re: The Future of the BTSX Market Engine...
Post by: santaclause102 on October 03, 2014, 10:26:10 am
Quote
2) Implementing a prediction market that trades on the ERROR in the price feed.  This prediction market will then allow continuous, real time, price discovery on the blockchain by continuously discovering the % delta between the price feed and real price.  It can be speculated on without losing any exposure to BTSX and with limits that can be used to halt trading on the USD/BTSX market if the feed error is too great.   The USD/BTSX market can then use FEED_PRICE * PERCENT_ERROR.   In this way delegates are only responsible for "getting close" with their feeds and a free market will continuously update the price at which shorts can execute.
who determines here what the "real price is". A feed again? :) Or what the majority thinks?

Quote
  2) the price feed is slow to update and does not allow internal price discovery.
as a short term but practically effective solution there could be statistics in the client about: how often a delegate updates his/her price feed, and how close the delegate was to the median (this would already include some prediction market dynamics).
Maybe delegate pay could depend on reliability and price accuracy?
Title: Re: The Future of the BTSX Market Engine...
Post by: starspirit on October 06, 2014, 05:19:11 am
BM - Are the changes proposed here due to be implemented imminently or still being discussed? It should be clear to everybody when these final changes are effective so nobody is surprised.
Title: Re: The Future of the BTSX Market Engine...
Post by: starspirit on October 07, 2014, 12:59:40 am
Does the rule that shorts are forced to cover after 30 days introduce the possibility of a short squeeze? Would it be better to set a limit on their purchases at the feed price, rather than being forced to buy at whatever price is available?
Title: Re: The Future of the BTSX Market Engine...
Post by: jsidhu on October 07, 2014, 03:57:28 am
Does the rule that shorts are forced to cover after 30 days introduce the possibility of a short squeeze? Would it be better to set a limit on their purchases at the feed price, rather than being forced to buy at whatever price is available?
Its the way cfd work they are closed at market unless you redo your position
Title: Re: The Future of the BTSX Market Engine...
Post by: bytemaster on October 07, 2014, 04:17:50 pm
Does the rule that shorts are forced to cover after 30 days introduce the possibility of a short squeeze? Would it be better to set a limit on their purchases at the feed price, rather than being forced to buy at whatever price is available?
Its the way cfd work they are closed at market unless you redo your position

Short squeezes are not really an issue because new shorts can cover into the squeeze at the feed price.
Title: Re: The Future of the BTSX Market Engine...
Post by: aaaxn on October 07, 2014, 06:00:27 pm
Short squeezes are not really an issue because new shorts can cover into the squeeze at the feed price.
Short squeezes are huge issue. You basically require 1/30 of entire outstanding supply to be rolled over every day. Even worse - due to nature of randomness it would be clustered once in a while. Just wait and such spike are bound o happen in period when there is diminished demand for shorts.
Title: Re: The Future of the BTSX Market Engine...
Post by: starspirit on October 08, 2014, 01:34:13 am
Does the rule that shorts are forced to cover after 30 days introduce the possibility of a short squeeze? Would it be better to set a limit on their purchases at the feed price, rather than being forced to buy at whatever price is available?
Its the way cfd work they are closed at market unless you redo your position

Short squeezes are not really an issue because new shorts can cover into the squeeze at the feed price.
I agree there is always incentive for shorts to reopen or new shorts to be opened if the price gets too high. If this occurred after a big BTSX decline though, the existing shorts would need to top up collateral to cover, so they may not all be in a position to do so.
Title: Re: The Future of the BTSX Market Engine...
Post by: starspirit on October 08, 2014, 10:22:56 pm
Is there a status update - are these short-covering rules already implemented? I noticed that the latest client versions seem to refer to this having been implemented after block 640000. If so, are we seeing the buy volume come through in the market associated with around 1/30 of the supply on average being covered each day? Or has some grandfathering been applied to exclude older shorts?
Title: Re: The Future of the BTSX Market Engine...
Post by: lafona on October 08, 2014, 10:31:16 pm
When I looked this morning, it seemed like there were shorts with a less than 30 day expiration, suggesting that it has already been implemented. I also saw some expiration dates to be around a year or so out, so some were probably grandfathered in too.
Title: Re: The Future of the BTSX Market Engine...
Post by: liondani on October 08, 2014, 10:32:00 pm
Or has some grandfathering been applied to exclude older shorts?

as bytemaster said the old shorts can keep their position for one year (shorts before the last mandatory update)
Title: Re: The Future of the BTSX Market Engine...
Post by: starspirit on October 08, 2014, 10:33:12 pm
When I looked this morning, it seemed like there were shorts with a less than 30 day expiration, suggesting that it has already been implemented. I also saw some expiration dates to be around a year or so out, so some were probably grandfathered in too.
Where can you see the expiries?
Title: Re: The Future of the BTSX Market Engine...
Post by: bytemaster on October 09, 2014, 03:35:33 am
Short squeezes are not really an issue because new shorts can cover into the squeeze at the feed price.
Short squeezes are huge issue. You basically require 1/30 of entire outstanding supply to be rolled over every day. Even worse - due to nature of randomness it would be clustered once in a while. Just wait and such spike are bound o happen in period when there is diminished demand for shorts.

What I mean is that a squeeze / margin call happens as a result of the feed moving, not as a result of the internal BitUSD market.   
Title: Re: The Future of the BTSX Market Engine...
Post by: vikram on October 11, 2014, 02:53:40 am
Is there a status update - are these short-covering rules already implemented? I noticed that the latest client versions seem to refer to this having been implemented after block 640000. If so, are we seeing the buy volume come through in the market associated with around 1/30 of the supply on average being covered each day? Or has some grandfathering been applied to exclude older shorts?

The 30 day limit is alive with old positions grandfathered in with a 1 year limit. The interest rate changes are still under development.
Title: Re: The Future of the BTSX Market Engine...
Post by: starspirit on October 12, 2014, 10:06:19 am
Does the rule that shorts are forced to cover after 30 days introduce the possibility of a short squeeze? Would it be better to set a limit on their purchases at the feed price, rather than being forced to buy at whatever price is available?
Its the way cfd work they are closed at market unless you redo your position

Short squeezes are not really an issue because new shorts can cover into the squeeze at the feed price.
I agree there is always incentive for shorts to reopen or new shorts to be opened if the price gets too high. If this occurred after a big BTSX decline though, the existing shorts would need to top up collateral to cover, so they may not all be in a position to do so.
Another thought I would like to add to this, because I still feel there's a risk here. If short-covering is compressed enough in time, new shorts just may not be able to come in fast enough to prevent a temporary short squeeze and rising price premium on BitUSD. It always takes some lag for market participants to respond, as we've seen many times in the much more liquid BTC market where flash crashes have been common. There is also a similar situation where BTSX falls considerably, and a fair number of shorts are forced to cover by buying whatever is available in the market at that point. What's to stop this turning into a runaway situation where more and more covers are triggered? There might be ways to help prevent this sort of situation if its considered a risk.
Title: Re: The Future of the BTSX Market Engine...
Post by: bytemaster on October 12, 2014, 05:00:13 pm
Covers are triggered by price feed and not internal bid/ask.   Thus margin calls on the internal exchange are unable to directly effect price on external exchange.

Then feeds must update to confirm the move.  Slowing down the process. 

Worst case a margin call is triggered by the feed and there is insufficient depth.  However because the market can see the call coming and the profit is too great I suspect there will be plenty of sellers within 10% of the real price. 
Title: Re: The Future of the BTSX Market Engine...
Post by: starspirit on October 12, 2014, 11:01:52 pm
Covers are triggered by price feed and not internal bid/ask.   Thus margin calls on the internal exchange are unable to directly effect price on external exchange.

Then feeds must update to confirm the move.  Slowing down the process. 

Worst case a margin call is triggered by the feed and there is insufficient depth.  However because the market can see the call coming and the profit is too great I suspect there will be plenty of sellers within 10% of the real price.
OK thanks, I'm comfortable now that a cascade effect is unlikely.
Title: Re: The Future of the BTSX Market Engine...
Post by: liondani on October 13, 2014, 12:15:06 am
what about a "re-short" option for the shorters (when they enter the order from the beginning) that triggers automatically in current feed price after the auto cover take place (after the 30 days period ) ?

Sent from my ALCATEL ONE TOUCH 997D

Title: Re: The Future of the BTSX Market Engine...
Post by: gordonhucn on October 17, 2014, 01:23:07 pm
We plan to make one last change to the market engine prior to locking it in stone for many months and changing to a much slower release cycle.

Short orders can only get filled under these conditions:

1) There is someone willing to buy BitUSD at the price feed
2) AND Your short order offers the highest interest rate
3) AND Your price limit is lower than the feed  (BTSX per USD) or you didn't specify a price limit.
4) AND You have enough collateral to provide 2x backing at the feed price (amount of USD for short sale will vary with feed price)
5) OR Your price limit is higher than the feed (BTSX per USD) and someone is willing to buy at your price limit.

Short orders are forced to cover after 30 days by taking the best offers at the time.  No fee is charged.
Short orders are forced to cover when 75% of their collateral is required to cover, leaving the short with 25% of the collateral minus a 5% fee. 
The 5% fee is assessed as a percent of the collateral left over after covering.

The maximum interest rate shorts can pay is 1000% APR
The initial collateral ratio will be 3x rather than 2x  (2x from short + 1x from long)

Interest charged will accumulate to the yield fund.

How is this better than *everything else* we have tried before it? 
1) First attempt charged a *fee* for short overlap, this fee basically bid up the spread and the amount of time a short would have to wait to cover profitably and made market makers unprofitable.
2) Second attempt (currently implemented) has shorts bid up collateral, but this provides less and less benefit to the network as prices go higher... ie: 10x collateral only provides 5% more downward protection than 5x collateral. 

How can I be sure we "have it right now"? 
1) It only makes sense that if you are borrowing USD you should be paying interest....
2) It only makes sense that if you are borrowing USD there is a fixed repayment time...
3) We are not price fixing the interest rate, it is being set at "auction" at the current price feed.
4) Time based fees encourage covering sooner rather than holding forever which improves liquidity.
5) It only makes sense that the creditors (holders of it BitUSD) be compensated for their risk at market rates.
6) BitUSD supply will rise to meet the demand of the shorts and the market activity will be more robust

It has been very tricky to figure out this market with two dimensions (price and interest) and we have been evolving toward steadily improving systems.   The great thing about this latest solution is that it realizes almost all of my original goal of interest paying BitUSD funded by the shorts.   BTS with market based interest rates..... you know those two upgrades we talked about 6 months ago that were being postponed until we tried the interest-free version.    Well in just 1 month we have learned, adapted, and deployed a system that does what I thought would take 6 months and a new DAC to implement. 

We have only had to make one compromise so far:  price feeds. 

The remaining weaknesses are: 
  1) shorts don't get to pick the price, just a limit and the rate 
  2) the price feed is slow to update and does not allow internal price discovery.
  3) the market is asymmetric (you cannot short BTSX backed by USD)
  4) you cannot short BitGLD backed by BitUSD (or any other combo)
 
We have a roadmap for addressing all of these:

1) Implementing a bond market that allows USD longs to LEND to shorts for fixed term with a bid/ask system setting the interest rate.  This will create no new BitUSD but will give shorts freedom to set their price without respect to the feed and hold for longer than 30 days.

2) Implementing a prediction market that trades on the ERROR in the price feed.  This prediction market will then allow continuous, real time, price discovery on the blockchain by continuously discovering the % delta between the price feed and real price.  It can be speculated on without losing any exposure to BTSX and with limits that can be used to halt trading on the USD/BTSX market if the feed error is too great.   The USD/BTSX market can then use FEED_PRICE * PERCENT_ERROR.   In this way delegates are only responsible for "getting close" with their feeds and a free market will continuously update the price at which shorts can execute.

These last 2 items are not critical and price feeds are likely more accurate than a thin error market.   For this reason we will not be implementing them until after BitAssets have proven themselves for 3+ months *AND* we have done a very careful test network.   Getting BitUSD right has required rapid tweaking and updates, but the rate of change is not healthy for BTSX or others and has many risks due to bugs.   So I think these last two enhancements are not high priority and we will instead focus on light weight clients, multi-sig, etc.

We are working to make BTSX and the toolkit the most robust financial platform we can with as little trust as possible in anything but the market.
+5% 30days rule makes all the difference. Exit conditions for either time or space , great !