BitShares Forum

Main => General Discussion => Topic started by: starspirit on March 10, 2015, 01:44:38 am

Title: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 10, 2015, 01:44:38 am
[Edit May 12: The ideas in this thread have now been superseded by whitepaper here: https://bitsharestalk.org/index.php/topic,15880.0.html]

**** SHORT VERSION ****

This post outlines an alternate method of creating a stable, pegged currency, that I believe may have better pegging and liquidity over the current bitAsset approach, with comparable security. As I'm not a developer/coder, I would like for others to comment on the theoretical and technical feasibility, assuming such an approach has not already been analysed in the past. The basic construction is that there is a pool of depositors on one side, that receive tradeable deposit receipts at the feed price (e.g. a BankUSD) in exchange for their BTS, and a pool of borrowers on the other side, which an agent in the middle (I'm loosely calling it a "bank") automatically matches off on each block, at the feed price, according to prioritisation rules on both sides. This negates the need for longs and shorts to meet directly in a price-negotiating market, BankUSD holders can get instant redemption at the feed price (requiring loans to be callable), and all other participants can trade at the feed price subject to some delay. Following up the initial OP idea, I further suggest how all parties may be able to always trade instantly at the feed price (removing the need for matching delays) by having borrowers share in a pool where leverage is able to fluctuate up to some maximum limit.

The OP also contains a suggestion around assets whose main purpose is trading and speculation, being to treat them more like traditional expiring derivatives, rather than requiring fungibility. The thought here is to encourage more trading activity, simpler arbitrage and better liquidity.

[Edit: Mar 29 - My thinking on the bank mechanism evolves through the thread - for example allowing standing orders at a premium or discount to the feed price, and also allowing for the alternative that such features could be incorporated into the current bitAsset market. These are working ideas moreso than a proposal at the moment, depending on feedback.]

*** LONG VERSION ***

I think there are potentially two types of bitAssets - bitCurrencies, and bitTradingAssets. For bitCurrencies, this might include any asset that could conceivably be used in exchange for goods and services, such as bitUSD, bitCNY, bitEUR, bitBTC, bitGOLD etc. For these it is important to have very consistent price-pegging, high liquidity and critically, fungibility.

However other bitAssets may be used primarily for investment and trading exposures, which I denote bitTradingAssets. Examples might be bitDOW, bitAPPL etc. Traders do not care about fungibility. However, they are still concerned with effective pegging and liquidity, and will be willing to move on price for that liquidity.

With that in mind, I think it may be worth separating the implementation approaches for these different types of assets. I wondered about the following approaches:

bitCurrencies, and a Bank

To achieve consistent price-pegging, while still allowing fungibility, one approach is fixed price redeemability (for sellers). Via arbitrage such fixed-price redeemability would flow through to strongly pegged prices and liquidity in all external markets where the bitCurrencies trade.

Rather than a bid/offer market for bitAsset/BTS, a centralised entity or agent, on the block-chain, could stand between the pool of longs and the pool of shorts to automatically mediate supply and demand, much as banks today stand between a pool of lenders (depositors) and borrowers. If we would desire deposits to be callable, then loans on the other side must also be callable. Withdrawal prices can then be fixed and immediate.

Alternative matching schema are possible, but here is one way in which transactions might be ordered by the "Bank" for each block:

- Withdrawals are first paid at the price feed from margin calls on loans, new depositors, then from loan repayments, and then from called loans. To guarantee that withdrawals are paid on demand, loans must be callable, beginning with those paying the lowest interest, or factoring in lowest collateral if system collateral is low.
- Remaining margin calls on loans, other loan repayments, and then deposits, are re-lent at the price feed to new borrowers, starting with those offering the highest interest.
- Remaining unfilled orders either side wait in the queue, and get priority in terms of age (depositors) or interest (borrowers).

Interest rates should adjust to mediate lop-sidedness in supply and demand over time, although this will not be immediate. Borrowers might also be able to voluntarily increase their current interest rate or collateral to avoid being called.

This system could be implemented with no bank equity (its merely a facilitator), but there may be some delays in time it takes for depositors, new borrowers or repaying borrowers to be filled, even if they would be prepared to pay to act more urgently. Better mediation of supply and demand might be possible if such excess payment is allowed in certain ways. In any case, it is always possible for people to make use of public markets in the bitAsset elsewhere to fill or hedge their position at an agreeable floating price if they demand more urgent liquidity.

If the bitCurrency were cheap on external exchanges, arbitragers could buy it, and instantly redeem it to make a profit. If it were expensive, arbitragers could wait in the deposit queue with their BTS, and when they receive the bitAsset, sell it externally in exchange for BTS again (or step off the deposit queue if the bitCurrency premium normalises). This should ensure external markets are closely pegged and liquid, subject to some delays that may be experienced on the bank queue.

bitTradingAssets, and a derivatives exchange

I think bitAssets are not yet meeting this need because there are problems with consistent pegging, liquidity, and high collateral requirements for traders. The Bank idea is also not good for bitTradingAssets because there may be delays in getting set when supply and demand is lop-sided, when traders may prefer liquidity, and collateral is still higher than elsewhere.

Traditional derivatives have an expiry date. Given that fungibility is not a requirement of trading assets, I suggest that bitTradingAssets could be created in a similar way, with staggered expiry dates. By having certainty around the convergence of the bitAsset price to the feed price at expiry, this would lead to simpler 2-way arbitrage, helping to keep the price in line with the feed, and tending toward zero at expiry. (The current bitAsset structure creates some practical difficulties for arbitrage). This approach would also facilitate options markets on these assets.

Since these are trading positions, rather than  long term stores of value, long term security is not as important as for bitCurrencies. Fractional deposit margining could be used, with frequent margining. Positions could be automatically closed on both sides when the pool on one side is at risk of being insufficient. In extreme black swans, there may be a partial loss on one side, but I think that risk is acceptable here.

If this approach allowed collateralisation by bitCurrencies rather than BTS, I feel it may have even wider appeal. In combination, BitShares would be able to replicate the functionality of existing centralised exchanges trading a wide range of asset types, but without the centralisation risk.

Either of the above ideas could be run under common ownership (all BTS holders) or as UIAs, with different business models and service models being possible.

A lot of things I haven't thought through though, for example price feeds, which the above is highly dependent on, still have lag and accuracy problems
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 12, 2015, 02:54:49 am
Further possibilities with the bank idea - as I said, once you take this approach, a number of business and service models are possible. Consider the bank's deposit receipts as an alternative to bitUSD, let's instead call it BankUSD.

It might be possible for the BTS borrowers to be part of a combined pool, lets call it the BTS Bull Pool. The BTS Bull Pool holds BTS, and is able to borrow BTS up to some limit such as 50% of the pool equity, or equivalently 33% of the pool's total BTS assets (note that this is equivalent to the current collateral requirements for shorts). All members of the BTS Bull Pool share in the outcomes equally, although their degree of leverage will vary over time. Within that leverage limit, both deposits and withdrawals of BTS with the bank (creating and redeeming BankUSD respectively) can be met instantly at the feed price. Also, BTS bulls can enter and exit the BTS Bull pool instantly, as long as the fund is within its limits, entering and exiting at the common equity price for the pool. So within the leverage limits on the pool, this negates the need for supply and demand to exactly match, and everybody can transact instantaneously at the feed price.

Things are a bit more complex when the limits are reached, and I haven't thought through all the best possibilities, so this is just food for thought. An interest rate can automatically adjust on both sides to incentivise or disincentivize lending and borrowing as necessary to restore balance. In extreme cases, other measures may be possible. New deposit liabilities of the bank (creating new BankUSD) might become restricted, or subject to a fee. Exits from the BTS Bull Pool might be restricted or occur at discounts to preserve collateralisation in the pool. If collateralistion falls to some further limit level, the Pool may raise new equity at a discount, diluting existing members of the Pool unless they participate. In any case all of this will be publicly transparent and automatic, so it is critical to think about how the right incentives and disincentives can be created.

Its also possible for there to be a bank balance sheet and equity owners in the bank. Equity owners could receive a cut of interest margins, but their balance sheet may also be at risk to protect depositors in black-swan events. On top of the collateral requirements in the BTS Bull Pool, this provides even greater security to depositors, at the cost of giving up on some yield.

[Edit: Other variations might be possible if demand allowed, such as different classes of investors in the BTS Bull Pool  (e.g. having different leverage profiles), with tokens of ownership for each class being freely traded in the market].

On a final note, I recognise this is all extremely different to the concept of bitAssets as being purely market determined between buyers and sellers at a floating price. However, currently we have had to rely on external price feeds anyway, and its not clear that such an artifice can ever be removed. And there are still wide spreads. If we focus purely on the end-goal of a stable, pegged, liquid currency, and let go of the idea that we must use a public bid/offer market in the bitCurrency to achieve this, then maybe other avenues are opened up. Perhaps bitAssets in their current form will be hugely successful. Perhaps these ideas could be done in parallel, either complementarily (meeting different needs), or in competition, like survival of the fittest.

I'm not claiming all of this is possible - they are just ideas at the moment, and there may be some fatal flaws or technical obstacles.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 13, 2015, 11:58:41 pm
I provided a *** short version *** in the OP given its length.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: arhag on March 16, 2015, 05:24:11 pm
I have a big issue with the loans being callable at any time. That makes the deal for borrowers far worse than our current system. At least someone who shorts in the current system and maintains enough collateral to not be margin called knows that they do not have to realize any losses for 30 days. I question whether you will get enough borrowers in this system to actually support the BitCurrency demand from depositors.

I also feel like this is a step down from the current system in that the borrowers are forced to match at the price feed (not allowed to trade above the BTS/BitAsset price). In our current system, when shorts don't want to short at the price feed they can offer their short sell orders at a higher price. In your system, the only option borrowers have in this case is to not be in the queue at all (since they can't get any lower than 0% interest).

In fact, it seems like the BitCurrency system you propose is very similar to our current system with the following modifications:


Edit: To demonstrate part of the equivalence of the two systems and show how it does not help prevent BitAsset or BitCurrency premiums, let us examine what happens if there is a BitAsset premium. If BitAsset supply is not sufficient for the current demand, it will be trading at a premium. To correct this, shorts needs to short sell more BitAssets to increase the supply (which they can do if the BitAssets are at a premium since, assuming relatively accurate price feeds, the bids will be at or above the BTS/BitAsset feed price). But if it is a bear market like it is now, the shorts may not be willing to short down to the price feed since there is no guarantee that the BitAsset/BTS will actually rise in the near future. Similarly with the BitCurrency proposal, in a bear market borrowers will not be willing to borrow at the price feed even at 0% interest. Any one who wants to deposit BTS and get more of the BitCurrency will be forced to wait in the queue. Those who are desperate to get the BitCurrency will buy some from a BTS/BitCurrency market on an external exchange at a premium price. There is no way of getting around that, we just embrace it and put that external exchange on the blockchain DEX (as the BTS/BitAsset market) and allow bids and asks to match above the feed price.



As for your BitTradingAsset proposal, I believe that is the "bond market" that we all would like to eventually see on BitShares in addition to BitAssets. But obviously it is a new feature that is less of a priority than BitAssets and getting the rest of the core product robust and stable.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 17, 2015, 12:17:41 am
Thanks for taking the time to reply arhag. Your comments are around the initial OP approach, so I'll respond to these first. My second post suggests a variation (the borrowers sharing in a pool) that may avoid some of these issues. I'll cover that second.

Regarding the initial OP proposal for bitCurrencies:

I'm hearing that one of your key issues is this - That in the current system there are the immediate profit incentives for shorts to respond to changes in bitAsset demand, by being able to trade favourably to the price feed (above it, when buyers demand new creation, or below it, when sellers demand supply destruction). In the proposed system, this profit incentive is removed, because all trading is at the price feed, and the regulating mechanism to match supply and demand is purely the interest rate. This might reduce the ability of supply to adjust to demand, especially if demand is strong and shorts are not willing to borrow even at 0%.

I believe the ability of the interest rate to mediate supply and demand would be fairly strong in most circumstances. It seems an unlikely circumstance that when bitCurrency demand is strong, with the longer term implications that has for BTS, nobody is willing to borrow freely to buy BTS. But I agree its possible in some circumstances that latent demand may not be met because the exposure to BTS alone is not considered enough incentive for shorts, and this can lead to unresolved premiums on external exchanges in such periods. I'm not sure how much of a concern this is though. More patient buyers can wait on the deposit queue, which is fair. And this also needs to be weighed against the tremendous benefit that bitAsset owners get by being guaranteed to exit at any time at the fair price.

I have a big issue with the loans being callable at any time. That makes the deal for borrowers far worse than our current system. At least someone who shorts in the current system and maintains enough collateral to not be margin called knows that they do not have to realize any losses for 30 days. I question whether you will get enough borrowers in this system to actually support the BitCurrency demand from depositors.
There are advantages to shorts of the proposed system too - they can hold shorts indefinitely as long as they are willing to improve collateral and interest, and they are always guaranteed to enter and exit at the feed price even when being called. It's best to weigh the risks in both systems:

- In the proposed system there are no expiries. Expiries in the current system create risks for shorts - they force buying even if liquidity is thin (in which case the market is not really demanding this action anyway), and they force the short out of position for an unknown time.

- In the proposed system, the loans are callable at any time (according to market demand), but the queue of callable shorts is rank-able. That is, every short knows where they stand in this queue, and if they are unhappy with their position, they can lift the interest rate or collateral. Essentially if they are keen to continue carrying the short, they can continue to do so indefinitely, as long as bitCurrency demand supports this. Those less keen to hold are the shorts at risk of call. There is a risk though that if they are not actively monitoring the queue, that they may unexpectedly fall in the queue and get called, so this may require an alert mechanism.

- In the proposed system, any transaction, including being called, is transacted at the feed price. There is zero price risk. In the current system, there is price risk when shorts are called or expired, that could work out favourably or result in loss.

Everybody will weigh these risks in their own way, but I am inclined to view the proposed system as providing greater certainty and fairness to shorts. Although shorts lose the ability to trade favourably relatively to the price feed to meet changes in bitAsset demand, the greater certainty for a fair exit price is a key balancing factor. As most of the longer term return to shorts accrues from BTS trends rather than premiums/discounts anyway, this removes a source of noise in their returns. So although I understand your concern that shorts may be less financially motivated to participate, its not obvious to me whether that is correct.

Overall, its not clear to me that one system objectively dominates the other. Ultimately, its really for users to judge which system they would prefer to operate in. I think constructing a bitCurrency in this way potentially enhances demand because it is simple and less risky for all participants. Arbitrage is easy, enhancing liquidity. And it may not affect supply adversely, because what's good for bitAssets is good for BTS, and that's what shorts ultimately derive most of their return from. (*)

Regarding the BTS bull Pool proposal:

Having a shared pool to hold the borrowed positions has certain other advantages with respect to the concerns you raised:

- As long as the pool is within its leverage limits, there is perfect supply flexibility to meet the demand.
- The callability on loans is against the pool, not any individual short. Therefore individual risk is removed, and all that happens is the pool leverage reduces.

The main benefits of this approach are that supply is more resilient to fluctuations in demand, participation in borrowing/shorting is significantly simplified, and all transactions are instantaneous at the feed price within the pool limits. Simplicity encourages participation without having to worry about secondary risks.

There are still some issues at the leverage limits however if 0% interest is not low enough to attract BTS bulls to the pool.

Again, it is for others to judge what system they would prefer.

Is it the case then that these approaches are technically feasible, and just a matter of preference? I'd like to know whether these can be run in the BitShares environment alongside bitAssets.

(*) There is a bit more system risk if margin calls may not get cleared at the feed price (the current system allows a 10% movement), which may be important if BTS is falling rapidly. I suspect its possible to replicate the current system in other ways however (e.g. a special deposit pool for bitCurrency holders that sits ready to clear unmet margin calls).
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: arhag on March 17, 2015, 06:15:22 am
I'm hearing that one of your key issues is this - That in the current system there are the immediate profit incentives for shorts to respond to changes in bitAsset demand, by being able to trade favourably to the price feed (above it, when buyers demand new creation, or below it, when sellers demand supply destruction). In the proposed system, this profit incentive is removed, because all trading is at the price feed, and the regulating mechanism to match supply and demand is purely the interest rate.

Not really. In the current system there is no immediate profit incentive (for either case). In fact, in your proposed system there is an immediate profit incentive (through arbitrage) when the BitAssets are trading (presumably on an external exchange) below the BTS/BitAsset price feed: buy the cheap BitAssets with your BTS and then use it to withdraw more BTS then you paid from the bank. In the current system this is not immediate because of the 30 day minimum before shorts can be called (assuming margin call isn't triggered). Since the BTS/BitAsset feed price may shrink below the price you purchase the BitAssets at within that max 30 day waiting period, there no guarantee of profit by buying the BitAsset selling well below the feed and then using those BitAssets to place a sell order maintained just slightly under the price feed. But one of my main points in the previous post was that neither the current system nor your proposed system help the peg in the case when the BitAssets are trading above the BTS/BitAsset feed price.

The other main point was that despite the fact that making the short positions callable before 30 days (even if they maintain margin) helps the peg in the case where BitAssets are trading below the feed price, I don't consider this to be a significant enough issue to make the drastic change of taking away the guarantee to the shorts that as long as they maintain enough collateral to avoid margin calls, they won't have to realize losses in less than 30 days.

I believe the ability of the interest rate to mediate supply and demand would be fairly strong in most circumstances. It seems an unlikely circumstance that when bitCurrency demand is strong, with the longer term implications that has for BTS, nobody is willing to borrow freely to buy BTS.

And yet right now there is a bid (BitUSD buy) order above the feed price (highest bid is 115.9433 BTS/BitUSD and feed price is 115.5082 BTS/BitUSD) and the lowest ask is 116.1030 BTS/BitUSD and the lowest short sell order is at 117.0000 BTS/BitUSD. Granted that isn't very strong demand, but I remember situations where the highest bid was more significantly larger than the feed price and yet the shorts weren't bothering to sell to them. The problem is that there is no guarantee that someone will later sell the needed BitUSD to the short seller at a price below the price they entered the short at. In your proposed system this means that even in the case where the feed price in BTS/BitUSD goes down lower than the borrow price and the borrower submits a loan repayment order, there is a risk that by the time the loan repayment order is matched by a withdrawal or new borrower the feed price would have gone back up above the price the borrower originally got the borrow order matched. Even if the borrower cancels the loan repayment order if the feed price goes up above the original borrow price, there is then the risk that the feed price will continue going up until the loan is margin called or more likely that the loan will be called at a time when feed price is above the original borrow price because someone wants to withdraw and there are no margin calls, new depositors, or loan repayments left in the queue. These risks may prevent the borrower from taking a 0% loan.

And this also needs to be weighed against the tremendous benefit that bitAsset owners get by being guaranteed to exit at any time at the fair price.

I just want to be clear that those are orthogonal concerns. The benefit to BitAsset owners of being guaranteed to exit immediately at any time at the feed price comes from making the loans callable before 30 days even when margin requirements are maintained. The disadvantage discussed above is not a result of making the loans callable. It exists in both your proposed system and the current system.

There are advantages to shorts of the proposed system too - they can hold shorts indefinitely as long as they are willing to improve collateral and interest, and they are always guaranteed to enter and exit at the feed price even when being called. It's best to weigh the risks in both systems:

- In the proposed system there are no expiries. Expiries in the current system create risks for shorts - they force buying even if liquidity is thin (in which case the market is not really demanding this action anyway), and they force the short out of position for an unknown time.

Actually expiration is not a big deal in the current system when compared to your proposed system. If a short expires and there is not enough BitUSD sells at or below the feed price, it will just sit at the feed price until it gets matched. If no one sells at or below the feed price, it can just sit there indefinitely. Similarly, with your proposed system, if no one makes a withdrawal, the loans can just sit there indefinitely without being called (assuming they aren't margin called). However, if anyone withdraws (equivalent to BitUSD sell just slightly under the feed price) and there are no other margin calls (equivalent to margin call orders), deposits (equivalent to BitUSD buy at feed price), or loan repayments (equivalent BitUSD buy at feed price or expired cover orders), then the system will call a loan. In the current system, if there already is an expired cover order sitting in the order book and someone does a BitUSD sell just slightly under the feed price, the BitUSD sell will match with the expired cover order (forcing the expired short position to at least partially exit from the position). The only difference is that a BitUSD sell order won't cause short positions that haven't yet expired (and have enough margin) to be called, whereas a withdrawal in your system can force a brand new short position to exit. So there is actually more risk for shorts (borrowers) in your system. If I short at the current feed price in the current system, I know that as long as the feed price does not grow larger than 150% of the current feed price then my short position will not be called in the next 29 days. I have no such guarantee with your proposed system.

Actually to make it equivalence better we would require that given two orders (a BitUSD buy order and expired cover order) at the same price, the BitUSD buy order is preferentially matched over the expired cover order, and given two expired cover orders at the same price, the expired cover order corresponding to the short position with the lower interest rate is preferentially matched over the expired cover order corresponding to the short position with the higher interest rate.

- In the proposed system, the loans are callable at any time (according to market demand), but the queue of callable shorts is rank-able. That is, every short knows where they stand in this queue, and if they are unhappy with their position, they can lift the interest rate or collateral. Essentially if they are keen to continue carrying the short, they can continue to do so indefinitely, as long as bitCurrency demand supports this. Those less keen to hold are the shorts at risk of call. There is a risk though that if they are not actively monitoring the queue, that they may unexpectedly fall in the queue and get called, so this may require an alert mechanism.

I think allowing shorts to raise the interest rate they pay after getting matched is a nice addition to the current system. This would be useful with the matching priority changes described above to make it less likely that their expired short gets matched. To reiterate, the callable shorts in your proposal are equivalent to expired shorts in the current system. Non-expired shorts in the current system are something that does not exist in your proposed system. Essentially your system is like setting the expiration period for shorts to 0 days and setting up the matching order for expired cover orders to be in the ascending interest rate order. Expired shorts would still be capable of being manually covered. To get the BitUSD needed to manually cover, the short position owner would get BitUSD the same way a "depositor" would (buy BitUSD just slightly above the feed price).

- In the proposed system, any transaction, including being called, is transacted at the feed price. There is zero price risk. In the current system, there is price risk when shorts are called or expired, that could work out favourably or result in loss.

What do you mean by price risk?

Regarding the BTS bull Pool proposal:

I'll have to spend time thinking about your BTS bull pool proposal later and get back to you on it.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: sparkles on March 17, 2015, 12:51:30 pm
1) What if we removed the expiration period entirely.  This would make the market symmetric in the same way that making shorts instantly callable (the other extreme).   We went away from this because of a lack of liquidity, but I wonder if the lack of liquidity is merely a growing pain and not something that needs to be supported.

2) What if we removed the interest rate entirely and instead allowed shorts to sell below the parity by up to X%.   This could cause the price to deviate from the feed when there is heavy short demand in a bull market, but this would be symmetric with deviations in the other direction like we have now when there is a bear market and shorts are only willing to sell above parity if at all.  Perhaps design decisions were made during a bull market that were not appropriate for all markets and we need to restore sym. to the market.   As long as shorts do not have the ability to "sell to 0 and keep it there" then the price should follow the dollar and deviate with swings in supply and demand.

3) What if the problem with BitAssets is NOT the mechanics of the market, but the lack of a sufficiently well capitalized market maker using an algorithm that doesn't attempt to "enforce a peg" but instead attempts to maintain a balanced portfolio of USD and BTS.  With such a market maker in place price swings should be dampened and liquidity would improve around what ever price the market established.

4) What if the price feed wasn't just one price, but 2.  A short limit and a call limit designed to protect USD from being sold to 0 and to prevent margin calls at unreasonable prices as people attempt to force USD to infinity.  What if these limits could get wider over time as the market gets deeper.   The end result would be true price discovery with safety.

Attempting to maintain 99.9% parity with very high liquidity in a young/thin market without large market makers is the fallacy.   Imagine if we had many market makers like NuBits where the primary difference is that all of the collateral is ON THE BLOCKCHAIN and there are no fractional reserves. 

I think that there needs to be less restrictions, less dependence upon the feed, and less complexity.     BitShares would have a hard time pivoting to a NuBits style market maker unless some major whales step up to the plate and start operating bots.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: arhag on March 17, 2015, 06:10:28 pm
Attempting to maintain 99.9% parity with very high liquidity in a young/thin market without large market makers is the fallacy.   Imagine if we had many market makers like NuBits where the primary difference is that all of the collateral is ON THE BLOCKCHAIN and there are no fractional reserves. 

I think that there needs to be less restrictions, less dependence upon the feed, and less complexity.     BitShares would have a hard time pivoting to a NuBits style market maker unless some major whales step up to the plate and start operating bots.

I think the only reason NuBits can afford the risk of the low-spread market making they do is because they are subsidized by NuShareholders. NuShareholders are willing to dilute their shares to pay for losses of the market maker. So the market maker is able to take higher risk by offering lower spreads despite the fact that NuBits is very new like BitAssets and would otherwise most likely have low liquidity as well. My guess as to why NuShareholders are willing to take on this risk is because they believe this can bootstrap the liquidity so they can continue offering low spreads without immense market making risk (and also because a tighter peg could boost NuBits adoption which they can then profit from by issuing new NuBits for free). But it is a gamble and they could just end up racking up more and more losses, and be forced to make up those losses through more and more dilution, until the whole system breaks down.

Anyway it would be highly inappropriate to put this risk on all BTS holders. But it is perfectly fine if some subset of BTS holders elect to take on this risk for the sake of bootstrapping liquidity and hopefully earning a profit from that activity. I believe most of the benefits would be shared by all BTS holders however, so there is a likely some group trap there.

I'm wondering if CryptoHedge would be interested in taking on this role by issuing a UIA designated to use collected funds for market making on the BitShares DEX. They are already doing this on centralized exchanges between BitAsset/BTC markets.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 18, 2015, 12:14:16 am
Arhag,

This is a lengthy post discussing the following - (i) I believe I have a solution to your issues, that involves a further modification to the "bank" mechanism that I discuss below. (ii) You have also inferred that the changes I am proposing could be incorporated into the order and matching rules in the current BitAsset model, not requiring a separate market or entity at all. I have taken this line of thought and suggested what changes might be necessary and their benefits. (iii) If the benefits were real, it would then need to be considered what are the relative merits of incorporating this approach into the current bitAsset market, versus splitting the market and adopting a separate bank clearing mechanism as I have proposed. (iv) I make some further comment on how the idea of a BTS Bull Pool might fit into this new way of thinking. I will respond to sparkle's points separately.

The "bank" mechanism

(i) Ways to resolve issues - self-destruction and self-creation of supply

I want to leave aside for the moment the feature that you seem to dislike the most, being the matching of instant withdrawals against the ability to call shorts at any time. I'll come back to this later. For now, assume that withdrawals enter a queue at the price feed like all other participants, but are simply first in line to get matched when there are enough deposits or loan calls/repayments available.

The main benefit I see in the bank mechanism is the ability of all participants to be guaranteed to be able to transact at the feed price, that I believe has flow-on benefits to confidence in the currency, ability to arbitrage, and liquidity. However, the main disadvantage for users is that they need to queue and wait for an indeterminate period. There are times and situations when many participants will be willing to pay a cost to act more urgently. For bitCurrency buyers and sellers that is easily enough facilitated through the existence of another free market in which to trade the bitAsset, where they can freely trade at a discount or premium if they like. For those looking to borrow and repay loans however, such an avenue does not exist. This can lead to risks for the borrowers (shorts in our usual terminology) such as the one you describe here:

I remember situations where the highest bid was more significantly larger than the feed price and yet the shorts weren't bothering to sell to them. The problem is that there is no guarantee that someone will later sell the needed BitUSD to the short seller at a price below the price they entered the short at. In your proposed system this means that even in the case where the feed price in BTS/BitUSD goes down lower than the borrow price and the borrower submits a loan repayment order, there is a risk that by the time the loan repayment order is matched by a withdrawal or new borrower the feed price would have gone back up above the price the borrower originally got the borrow order matched. Even if the borrower cancels the loan repayment order if the feed price goes up above the original borrow price, there is then the risk that the feed price will continue going up until the loan is margin called or more likely that the loan will be called at a time when feed price is above the original borrow price because someone wants to withdraw and there are no margin calls, new depositors, or loan repayments left in the queue. These risks may prevent the borrower from taking a 0% loan.

To resolve this the bank could implement a mechanism that allows the borrower to destroy both the currency and the loan at any time if they own the corresponding bitCurrency. In this case the borrower presents their loan for self-cancellation, buys the bitCurrency in the free market, and presents that for withdrawal. As long as these are on the same account, the bank can automatically offset the withdrawal against the loan repayment. Although there's more steps, it achieves essentially the same function as a voluntary short cover in the current regime. The borrower satisfies their urgency, and accepts the risk of buying the bitCurrency at the free market price.

Its also possible to have a converse mechanism to create supply if new borrowers wish to act more urgently. For example, the new borrower can self-create a loan and corresponding units of bitCurrency, as long as their interest rate satisfies some minimum condition that does not give them unfair interest rate advantage relative to the current market (not sure what such condition should be yet). Then they can take the created units of bitCurrency and sell them in the free market.

The combination of these features means that:

- all participants can be guaranteed the feed price, subject to queuing
- all participants can act more urgently by bearing the price risk in the free market
- when free market prices are at a premium, there is incentive to create new currency units instantly and sell them in the free market
- when free market prices are at a discount, there is incentive to buy currency units in the free market and instantly destroy them
- an arbitrager with BTS inventory can easily participate in this creation and destruction of currency units for risk-less profit (in terms of BTS)
- market-makers with a BTS inventory and loan book can stand in the free market, and offset their hit orders with instant creations or cancellations of bitCurrency
- the latter behaviours should help ensure that free market prices are closely pegged

The arbitrage and market-making mechanisms are really key to whether this whole approach radically improves pegging and liquidity in the free markets, and I will try to give these more attention, but my current thinking is the proposal will at least improve current conditions.

Coming back now to the idea of instant withdrawals and loan callability...The basic principle behind expiries is that there needs to be some enforcement for interest rate resets on loans, otherwise when bitCurrency demand is very low, there is no mechanism for rates to increase. Something analogous is required in the proposed system too. In the absence of forced re-setting, even if the bitCurrency traded at a discount, borrowers may be reluctant to buy it to cancel their low loan rates. Instead of making all loans instantly callable (as per the OP), to be somewhat consistent with the current system, they could become callable after 30 days (and correspondingly, withdrawals are guaranteed their redemption within 30 days). The difference to the current system is that rather than all loans sitting unnecessarily at the feed after 30 days, the proposed system would selectively call on the loans as required, ranking on interest (and collateral where low). This provides incentive for keener borrowers to improve their terms, and allows them the flexibility to carry the loan as long as they desire. I think also other ideas are still possible here.

(ii) Incorporating these features into the current bitAsset regime

If this were desired, I think the following would need to be done:

- all participants would have the option to enter price-limit orders, or enter an order that transacts at the price feed, but joins a queue (should be aesthetically very simple)
- personal alerts would be highly desired to notify when such queued positions are hit
- borrowers could enter a different type of order for self-cancellation, that expires after some period if the bit currency is not presented
- a separate type of order for bitCurrency self-creation can be created with BTS
- a ranking of callable loans
- a mechanism for borrowers to adjust both collateral and interest rates

(iii) Would such a change, if desired, be better incorporated into current bitAsset markets, or separated like a "bank" mechanism?

On the one hand, it could be cleaner and simpler to have 2 markets - the bank clearer, and a free market (which could still be a decentralised market in BitShares, such as a free market in bitUSD/BTS). On the other hand, it might be more efficient to have this functionality sit completely within a single market, with different order types. For example, that would reduce the need for market-makers and arbitragers to operate across 2 markets, and potentially reduce the number of steps involved (e.g. self-cancellation might be automatically completed as soon as the bitCurrency units are purchased).

I think we would need to consider the bigger picture of what BitShares would look like down the track. For instance, on top of bitCurrencies created against BTS, there might be a range of other types of markets to meet particular needs - e.g. other MPAs created against stable bitCurrencies as collateral, leveraged trading asset markets, bond markets. It will be important to keep each market simple. I tend to think it might be cleaner to have some free trading markets that are not intermingled with the creation/destruction process, because that will be much easier for newcomers to the decentralised exchange to understand. But I'm open.

(iv) What about the BTS Bull Pool?

The main advantage of the BTS Bull Pool concept was to allow market participants to transact at the feed price without any queuing, as long as the pool is within its leverage limits. If the above ideas were successful in creating strong pegging and liquidity, the benefits of the BTS Bull Pool approach begin to reduce (although I'm not discounting this approach yet). The BTS Bull Pool might still serve an important ancillary function, in that it is a very simple mechanism for any BTS holders to participate in the short side, without having to monitor or manage anything themselves. This could encourage greater supply. However, its possible this could be integrated within the above systems as well, by having it run as a UIA, and having it simply compete with other borrowers/shorts.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 18, 2015, 12:38:22 am
1) What if we removed the expiration period entirely.  This would make the market symmetric in the same way that making shorts instantly callable (the other extreme).   We went away from this because of a lack of liquidity, but I wonder if the lack of liquidity is merely a growing pain and not something that needs to be supported.

2) What if we removed the interest rate entirely and instead allowed shorts to sell below the parity by up to X%.   This could cause the price to deviate from the feed when there is heavy short demand in a bull market, but this would be symmetric with deviations in the other direction like we have now when there is a bear market and shorts are only willing to sell above parity if at all.  Perhaps design decisions were made during a bull market that were not appropriate for all markets and we need to restore sym. to the market.   As long as shorts do not have the ability to "sell to 0 and keep it there" then the price should follow the dollar and deviate with swings in supply and demand.

3) What if the problem with BitAssets is NOT the mechanics of the market, but the lack of a sufficiently well capitalized market maker using an algorithm that doesn't attempt to "enforce a peg" but instead attempts to maintain a balanced portfolio of USD and BTS.  With such a market maker in place price swings should be dampened and liquidity would improve around what ever price the market established.

4) What if the price feed wasn't just one price, but 2.  A short limit and a call limit designed to protect USD from being sold to 0 and to prevent margin calls at unreasonable prices as people attempt to force USD to infinity.  What if these limits could get wider over time as the market gets deeper.   The end result would be true price discovery with safety.

Attempting to maintain 99.9% parity with very high liquidity in a young/thin market without large market makers is the fallacy.   Imagine if we had many market makers like NuBits where the primary difference is that all of the collateral is ON THE BLOCKCHAIN and there are no fractional reserves. 

I think that there needs to be less restrictions, less dependence upon the feed, and less complexity.     BitShares would have a hard time pivoting to a NuBits style market maker unless some major whales step up to the plate and start operating bots.

This is just my personal view, but I am not convinced that pegging will be successful without mechanisms to oblige certain participants to meet it. That's a wordy way of saying that a completely free market will probably not peg. As you rightly say, market-makers build liquidity around the market price, but not the peg price. If the market thinks a bitUSD is worth 0.5 x RealUSD, and trades at this level in the external and internal markets, there is no arbitrage available to restore that to 1.0x. In the current system its partially resolved through short expiries, which means shorts are obliged to buy back at the feed price within 30 days, hopefully limiting any discounts. I realise my proposal leans even more heavily on the price feed, but unfortunately I don't think there is any evidence that we can ever do without it. I may be proven wrong.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: arhag on March 18, 2015, 01:38:32 am
Although there's more steps, it achieves essentially the same function as a voluntary short cover in the current regime.

It seems exactly like the voluntary short cover in the existing system. This wasn't the problem.

Its also possible to have a converse mechanism to create supply if new borrowers wish to act more urgently. For example, the new borrower can self-create a loan and corresponding units of bitCurrency, as long as their interest rate satisfies some minimum condition that does not give them unfair interest rate advantage relative to the current market (not sure what such condition should be yet).

Well you told me to assume that the loans aren't callable in this discussion (which is essentially the same as going back to the BitAsset system with no expiration period). In such a case, this sort of self-shorting outside of the market isn't an issue. This was already discussed in fact in a thread bytemaster posted about a proposal to simplify the BitAsset system which has since been rejected. The problem with the proposal is that if you do want an expiration period, the self-shorting outside the market allows borrowers to get around the expiration restrictions. Those selling below the price feed expect to be matched within 30 days, but if a short can just roll over their shorts outside of the market, those BitAsset sell orders under the price feed may remain for an indefinite amount of time. A tweak to correct this is to disallow self-shorting outside the market if there are any BitAsset sell orders under or at the price feed (but with that restriction in place you might as well just use the current system and match your own short). To use your terminology, a borrower would not be allowed to self-create a loan if there is a withdrawal waiting in the queue.

- all participants can be guaranteed the feed price, subject to queuing

That isn't just a small detail though. I can "guarantee" any price for any asset as long as the time at which it will be settled is allowed to be unbounded. I will sell BTS at a price of $0.00001 to anyone who agrees to not be paid until 5,000 years later. It is pointless. If I put a buy or sell order stuck just above the price feed, there is a very good chance in the current system that my order will be matched in a reasonable amount of time (days if not hours). If I put a sell order stuck just below the price feed, there is a guarantee by the system that it will be matched within 30 days.

From that perspective, being able to trade away from price feed on the DEX is not a problem, it is a feature (it combines the external free market and the "bank" into a single combined market). Anyone who wants to restrict themselves to just the price feed can do so and have upper bounds on the time they will spend in the queue for BitAsset sell orders (just like they have an upper bound on the time a withdrawal stays in the queue in your system assuming you make loans callable after some finite time and you put the restriction on self-creating loans that I described above), and while they won't have any guarantees or upper bounds on time spent in the queue for BitAsset buy orders (just depositors might spend an indefinite amount of time in the queue in your system), it is usually safe to assume that buy orders at the feed price will be matched relatively quickly (days).

- when free market prices are at a premium, there is incentive to create new currency units instantly and sell them in the free market

How so? I already discussed that with my short example. For there to be a profit incentive, the borrower needs to be able to take the BTS collected by selling the premium BitAssets in the free market and deposit it into the bank to get the BitAsset needed to cover the loan. But there is no guarantee that deposit will be matched immediately. By the time the deposit is matched, the price feed may have moved significantly to the disadvantage to the borrower. In other words, this isn't risk-free arbitrage. And again, this is the same thing as the current system. The external market and the "bank" in your proposed system are just merged into one combined BTS:BitAsset market with mixed order types (which in fact makes actual risk-free arbitrage automatic and unnecessary for people to do, not including arbitrage with other external markets that happen to be trading the BitAssets and BTS of course).

- when free market prices are at a discount, there is incentive to buy currency units in the free market and instantly destroy them

Only if the borrower will realize profits by doing so. If the feed price when they borrowed is lower (in BTS/BitAsset) than the the current feed price, it may not necessarily be profitable to buy the discount BitAsset and cover (or self-cancel). It depends on how much the discount is and how much the feed price has changed since the loan was created (also interest rates would have to be factored in). But in a long bear market (like we have been experiencing), the borrowers would be at a loss and would not wish to realize that loss by buying even discount BitAssets and covering. This is why the expiration is a good thing for helping the peg, especially in bear markets, because it forces the borrowers to cover at the price feed after a reasonable amount of time (thus increasing liquidity and supporting the peg) despite the fact that it causes them to realize their losses which is why they wouldn't have covered had it not been for the expiration.

The arbitrage and market-making mechanisms are really key to whether this whole approach radically improves pegging and liquidity in the free markets, and I will try to give these more attention, but my current thinking is the proposal will at least improve current conditions.

I believe this proposal is nearly equivalent to the current BitAsset system with no expiration period, and will have similarly liquidity as we would if tweaked the current system to removed the expiration period (which I believe would be worse liquidity in bear markets, so that means worse liquidity than we have at the moment). I also believe that this proposal with instant withdrawals and loan callability is nearly equivalent to the current BitAsset system with an expiration period of 0 days (maybe some minor additional tweaks needed), and will have similar liquidity as we would if we tweaked the current system to set the expiration period to 0 days (which I believe would be even worse liquidity than today because any of the remaining short sellers that are still selling today would likely be scared off by a 0 day expiration period).

The difference to the current system is that rather than all loans sitting unnecessarily at the feed after 30 days, the proposed system would selectively call on the loans as required, ranking on interest (and collateral where low). This provides incentive for keener borrowers to improve their terms, and allows them the flexibility to carry the loan as long as they desire.

Right, as I mentioned before I like the idea of adjusting the order matching rules of expired cover orders to first pick the ones corresponding to shorts that offer the lowest interest rates. I also like the idea of allowing a short position owner to increase (but not decrease) the interest rate the short pays after getting matched (even if expired).

I believe those are the only changes necessary to the current system for it behave essentially the same way as the system you are proposing (now that you are willing to accept 30 day periods before loans become callable).
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 23, 2015, 02:54:26 am
I believe this proposal is nearly equivalent to the current BitAsset system with no expiration period, ...

There are further aspects of the proposal I would like to discuss in subsequent posts, but I'll start with an example of where I think the proposed mechanisms would allow greater arbitrage opportunity, and consequently liquidity, compared to the current system. The specific arbitrage opportunity in this case is when the bitCurrency is at a discount to the feed price, and the mechanism that helps the arbitrage is the ability to set a withdrawal order that sits and moves with the feed price. Just take this as a starting example to justify at least this capability, recognising it says nothing about the remainder of the proposal at this stage.

Arbitrage process when the free market price is at a discount to the peg

In theory we know that if a bitUSD sell order could be placed at the price feed, and move with the price feed, that the order will be satisfied within 30 days because of the requirement that all shorts expire. If bitUSD were at a discount, it would be possible to buy the bitUSD, place a sell order at the price feed, and when it is hit, to sell the BTS for an arbitrage profit.

In practice, this arbitrage is not possible in the current system. The sell order would need to be constantly shifted with the price feed, and that would lose position in the sell queue. As the price feed cannot be known easily in advance of the next shift, when the price feed changes, it is also possible that the order is filled at a discount to the new price feed, or that other sell or short orders are met ahead of it if the order now sits even briefly at a premium to the price feed. So there are uncertainties as to the relative price achieved as well as position in the queue. There are monitoring and order-changing costs. And there is no guarantee that the order can even be met within 30 days.

Under the proposed mechanism, the bitUSD holder places a sell order that is guaranteed to be met within 30 days at the price feed. So a significant risk has been taken away from the arbitrager. The following hedged arbitrages (ie no net change in BTS exposure) then become more effective:

If the arbitrager is operating from a base of:

i)   real USD: they buy bitUSD on an external exchange at a discount and set a sell order at the feed price on the internal exchange. They get hit within 30 days, then sell the BTS for USD in the free market.

ii)   BTS: they buy bitUSD on the internal exchange, and hedge this by buying BTS back with real USD on an external exchange. They set a sell order on the bitUSD at the feed price on the internal exchange. They get hit within 30 days, receiving BTS, and sell their BTS hedge on the external exchange.

In both cases there is still some risk of an unhedged exposure to BTS in the time it takes between getting hit on an order on the internal exchange versus offsetting the exposure in the external exchange. But this existed in the current system anyway. The biggest risk cut out here is the relative price and timing risk on the sell order on the internal exchange.

In principle then, any discounts to the feed price should be limited to the rate of return arbitragers demand for locking up some capital for 30 days.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 23, 2015, 05:34:36 am
[Edit 25 Mar: I am modifying this post from its original form, as I'm testing the logic a bit more]
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: ebit on March 23, 2015, 06:06:59 am
 +5%
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 29, 2015, 01:58:10 am
Why feed-price relative orders will improve pegging and liquidity

My previous post showed that a mechanism allowing sell orders to be set at the median feed price (MFP) would lead to more robust arbitrage of bitCurrency discounts (e.g. bitUSD). In this post I would like to expand that to the ability of all participants to be able to place orders that are set relative to the median feed price (MFP +/- X%). I believe this should encourage a wider group of arbitragers and market-makers to participate in strategies that help strengthen the peg, but it will have to be determined through debate how much relative benefit this might add. My OP originally allowed orders to be set at the feed price (FP + 0%) via the 'bank' mechanism - this post generalises that line of thinking to MFP+/-X%, again using bitUSD as an example.

If bitUSD is trading at a discount, arbitragers could buy bitUSD and place a sell order at MFP (they can also hedge their reduced BTS exposure elsewhere). We know such an order, if permitted, must be hit within 30 days, unlike any order that can be placed in the current system (see previous post). This means that the discount should never be greater than the return arbitragers demand for tying up some capital for up to 30 days.

In fact, whenever a sell order is placed in the queue at MFP, it's possible to use the queue of short expiries to determine the maximum time it will take for any new sell order to get hit (this would be a useful public metric). This could range anywhere between 0 and 30 days. Arbitragers (and others) can always use this metric to weigh up the discount against the time.

Now in some scenarios, if a high return is demanded by arbitragers, the discount could still be high. Some arbitragers may prefer to capture just part of the discount if they can close the trade more quickly. So on buying at MFP - 4% say, they could place an order to sell at MFP - 2%, and hope to get hit by a new group of buyers or arbitragers coming in at the lower discount before the expiries occur. So allowing both buyers and sellers to trade relative to MFP allows a wider group of arbitragers and bargain hunters to trade exposures relative to the MFP. (*)

With regard to premiums on bitUSD, although there is not a strict arbitrage available, its possible to make the process simpler and less costly for market-makers by introducing self-creation, self-cancelling, and self-rolling mechanisms as I describe here...https://bitsharestalk.org/index.php?topic=15207.msg196314#msg196314. This would encourage greater market-making activity to exploit premiums. For example, a market-maker could wait for a premium to appear, self-create bitUSD, sell bitUSD at a premium for real USD, wait for a future reversion of the premium, buy back bitUSD with their USD, and use the bitUSD to self-cancel their short. All without ever having changed their exposure to BTS. (**)

By allowing such orders to be conditional on certain levels of discount or premium (in practice, determined by comparing to the highest bid or lowest ask prices), this would allow market-makers to set standing orders and wait, rather than monitoring for the opportunity. They can more easily implement a strategy such as (Sell at X% premium, and close at X-2% premium). Or (Sell at X% premium, and close at 1% discount). These parameters allow for the heterogenous views of market-makers on where they think the trading ranges might be, and how long they are willing to hold positions.

An alternative strategy (especially if there is not a liquid external market in the bitAsset) is to short bitAsset internally at the premium, and sell BTS and buy USD on external exchanges as a hedge. When the premium narrows, close the short and remove the external hedges. For such outright short positions, allowing limit orders to be placed on new shorts at MFP + X%, and limit orders for short covering at MFP +/- X%, might encourage this type of market-making also. This is not really possible in the current system because there is no way a short can guarantee shorting at a premium unless they are willing to constantly change their price limit, and short covers are effectively a market order.

In summary, I'm of the view that the ability for all parties to set orders that are relative to the feed price, and for self-order mechanisms to be conditional on these, creates a rich and effective environment for arbitragers and market-makers to implement their strategies. This in turn will lead to better pegging and liquidity around that.

[ * If the MFP relative trading took place separate to the main market as proposed in the original OP, its possible to incorporate a wider range of possibilities, such as queued withdrawals selling their queue positions.
** This assumes there is a liquid external market for the bitAsset. bitUSD right now has zero volume at BTER]

Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: merivercap on March 29, 2015, 08:40:14 am
My head hurts trying to follow this.   :P

I probably will take time to sit down and think about both the current and proposed mechanisms, but I assume for now there is just not enough market making bots.  At this point I don't know exactly how the current system works other than at a high level it's like a Total Return Swap and contract-for-difference (CFD).  I haven't traded bitUSD and was going to comment after experimenting a little.  Even then all I would probably want to know is:
-What price I would get for bitUSD and what interest rate. 
-As a short all I want to know is what is the interest rate cost
-Lastly I just want liquidity and simplicity.

How do both systems compare with Bitfinex?  I've used Bitfinex a little bit with a general understanding of how it works and it also works like a Total Return Swap/ CFD, but I don't even know my interest rate when trading.  I assume it's the lowest available interest rate and I just really track the daily swap costs to make sure it's not too bad. 

I'm not sure how good price feeds are from the current exchanges.  Furthermore, price feeds in general are just rough proxies of value for shares that trade at some point in time among a few investors/speculators.   All value is subjective and constantly changing.  Prices don't give a good gauge of value among the broad spectrum of shareholders, because most shareholders don't actively trade.  Less than 0.5% of outstanding shares trade in a day.   If a few big whales wanted out, the price would take the price down a lot.. let's say 25%... if a few big whales wanted in.. it would take it up 25%...without liquidity you have a few retail speculators dictating the marketcap of the entire ecosystem.  That's also why too many people on the forum focus on marketcap when in a illiquid market pricing doesn't really tell you that much.  You probably have a bunch of big whales looking at binary scenarios who don't really trade much.  On the demand side, there isn't much going on either.  Even if the prices become cheap, doesn't mean big shareholders have to accumulate more.  They could be satisfied and saturated with their positions, but value their shares much more than the current price.  Let's say for example 99% of all shareholders that did not trade valued their shares at a $100 million market cap and would not sell until then.  Even if prices of 1% float trading among a few speculators back and forth with each other went on to reflect a $20 million market cap, doesn't mean the 99% of shareholders will value their shares any less and also doesn't mean they'd want to accumulate more either.   Anyways I'm digressing a bit.  You probably need a lot more liquidity to get a decent price-feed, but if your system creates more liquidity and action it may be something to consider. 

Also usability can be an issue.  All this seems really complicated and if there's a way to simplify the process that could definitely help.  I really don't want to know all the moving parts.  I don't really want to think too much.  I'd like to just click a few buttons and be done.

Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 29, 2015, 10:01:03 pm
My head hurts trying to follow this.   :P
I totally understand! This thread started as an idea, and I've used it as a place to evolve that idea and collect my thoughts. I would like to turn this into a clear and simple proposal in the the end, but I thought by putting it all on here, others could comment if they wish. I will simplify it.

Also usability can be an issue.  All this seems really complicated and if there's a way to simplify the process that could definitely help.  I really don't want to know all the moving parts.  I don't really want to think too much.  I'd like to just click a few buttons and be done.
The functionality I am describing here is only required for advanced users that engage in arbitrage, market-making and shorting. This functionality would be provided to ensure the best pegging and liquidity we can get, because that's what will attract average users. For most of these users however, it is stuff that happens behind the scenes. All most users will ever want to do is trade bitUSD to/from BTS at price-points, and never relative to fair. Despite this, they demand good pegging and liquidity, which advanced users must have the right tools to provide them.

What I imagine at the moment is that from the average user's perspective all they see is a wide range of markets where they can trade in and out at price limits or market orders. They never need to see separate short orders, fee-price relative orders, self-orders etc, and they can use a basic client that is free of this functionality. Advanced users use a full client with all this functionality, which makes their strategies simpler and profitable. Of course anybody could partake in this if they like.

In my OP I had the idea of separating these users by having two separate markets, a free market in the bitAsset, and a 'banking mechanism' which would be for advanced users adopting these strategies. But it could all take place in one market, with each user just getting a different perspective on it. Still thinking this bit through.

I hope that helps alleviate the concern some may have that "this seems all too complicated". The debate can at times be complicated, but in fact, as long as we design the most effective mechanisms, it can make life simpler for both sets of users.

How do both systems compare with Bitfinex?  I've used Bitfinex a little bit with a general understanding of how it works and it also works like a Total Return Swap/ CFD, but I don't even know my interest rate when trading.  I assume it's the lowest available interest rate and I just really track the daily swap costs to make sure it's not too bad. 
Not sure from what perspective you mean. A big difference is that because there is no pegging required there, the market is completely free. Bitfinex also takes a cut of interest...

I'm not sure how good price feeds are from the current exchanges.  Furthermore, price feeds in general are just rough proxies of value for shares that trade at some point in time among a few investors/speculators.   All value is subjective and constantly changing.  Prices don't give a good gauge of value among the broad spectrum of shareholders, because most shareholders don't actively trade.  Less than 0.5% of outstanding shares trade in a day.   If a few big whales wanted out, the price would take the price down a lot.. let's say 25%... if a few big whales wanted in.. it would take it up 25%...without liquidity you have a few retail speculators dictating the marketcap of the entire ecosystem.  That's also why too many people on the forum focus on marketcap when in a illiquid market pricing doesn't really tell you that much.  You probably have a bunch of big whales looking at binary scenarios who don't really trade much.  On the demand side, there isn't much going on either.  Even if the prices become cheap, doesn't mean big shareholders have to accumulate more.  They could be satisfied and saturated with their positions, but value their shares much more than the current price.  Let's say for example 99% of all shareholders that did not trade valued their shares at a $100 million market cap and would not sell until then.  Even if prices of 1% float trading among a few speculators back and forth with each other went on to reflect a $20 million market cap, doesn't mean the 99% of shareholders will value their shares any less and also doesn't mean they'd want to accumulate more either.   Anyways I'm digressing a bit.  You probably need a lot more liquidity to get a decent price-feed, but if your system creates more liquidity and action it may be something to consider. 
I believe we need price feeds - I don't know any way to get around that. So absolutely, improving the robustness of price feeds is a key challenge that deserves much further investigation and whole threads dedicated to it. FYI I made a comment recently here (that does not address all the points you make)... https://bitsharestalk.org/index.php?topic=15331.msg197641#msg197641
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: Globally Distributed on March 29, 2015, 10:30:50 pm
I believe I remember a post or mumble a while back from Dan saying that relative orders code had been written but not implemented due to the increased risks that relative orders create for average users in terms of attacks or manipulation because of the current price feed implementation.

As for strength of bitasset pegs, the more they depend on price feeds, the less independent the system can become; that is, if people depend solely on the internal price feeds, then the feeds can be manipulated and/or turned off by governments and other wealthy attackers. Better price feeds seem like an ideal solution now, especially with the low levels of liquidity, however, in the long run BitShares may be much more robust and resistant to tampering by governments and other forces the less it depends on external information.

I may be wrong, but as far as I understand, the idea for strengthening the pegs with infrequent feeds is that people will know the feeds are imperfect and as such will generally seek price information outside of the system.  In the future, if all major liquidity providers are using data feeds outside of the bts exchange, then the pegs will tighten and bts will not compromise its robustness. It does seem to be a kind of chicken-or-the-egg problem, however, I forecast people taking the risk to increase liquidity and strengthen the peg with information other than the internal price feed implementation because a tighter peg is better for business and all of those  who will be in the liquidity business will probably agree.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: merivercap on March 30, 2015, 01:35:53 am
In my OP I had the idea of separating these users by having two separate markets, a free market in the bitAsset, and a 'banking mechanism' which would be for advanced users adopting these strategies. But it could all take place in one market, with each user just getting a different perspective on it. Still thinking this bit through.
Yes there could probably be various ways to tweak the system and using the perspectives of two separate groups is good.  I'll comment after playing around more down the road.  I think the raw market engine could just be as loose and flexible as possible and people can build various exchange platforms on top of it correct?  I think the primary revenue source early on for the Bitshares ecosystem will be transaction fees from traders/speculators.  There are people new to the wild west of  margin trading & derivatives that once was closed off for Wall Street and limited in online trading platforms.   Look at how much volume Bitfinex has.  http://bitcoincharts.com/markets/  $325 million per month!!!!  Can you imagine how much transaction fees will be accrued from all the trading if you just created a similar platform?  You can leverage there up to 2.5 times so allowing greater leverage can be incredibly useful for liquidity.  I started following Bitcoin after the fall of Bitcoinica, but they were the first to create margin trading and from what I understand got to the level of MtGox volume in the early years.   That's why catering to traders and speculators is important and introducing new people to this wild west of boom/bust margin trading is very good for liquidity.  It's also why I stress usability.  Is anyone planning to build a custom exchange off the Bitshares blockchain & market engine?  I think that would be a fantastic project. 

Also I think the marketing & communication is also needed to explain what creating bitUSD & trading bitUSD allows... 
The leverage is 1.5 to 1 so that you can make 50% more if you are short bitUSD and BTS appreciates, so instead of your BTS going up by 100% when BTS appreciates, you gain 150%... (Did I get my numbers right?)  Anyways .. leverage is exciting.. and the more the leverage the more action and attention you'll get... but I think 50% is pretty good already.

I believe we need price feeds - I don't know any way to get around that. So absolutely, improving the robustness of price feeds is a key challenge that deserves much further investigation and whole threads dedicated to it. FYI I made a comment recently here (that does not address all the points you make)... https://bitsharestalk.org/index.php?topic=15331.msg197641#msg197641

I think Bytemaster mentioned the current price feed is mainly in place because of the low liquidity, otherwise the system wouldn't have to rely on price feeds .  Ultimately you get enough volume on a platform and you become the price feed.  You also have to consider counterparty risk & entry/exit fees when evaluating price feeds on the various exchanges.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 30, 2015, 01:42:26 am
I believe I remember a post or mumble a while back from Dan saying that relative orders code had been written but not implemented due to the increased risks that relative orders create for average users in terms of attacks or manipulation because of the current price feed implementation.
Thanks for the heads up GD. I'll try to ferret this out, unless somebody can point out where it is.

As for strength of bitasset pegs, the more they depend on price feeds, the less independent the system can become; that is, if people depend solely on the internal price feeds, then the feeds can be manipulated and/or turned off by governments and other wealthy attackers. Better price feeds seem like an ideal solution now, especially with the low levels of liquidity, however, in the long run BitShares may be much more robust and resistant to tampering by governments and other forces the less it depends on external information.
I empathise with this concern to make the system independent of external hands. I wonder how much of a risk it really is though. As long as delegates or other price-feed submitters have access to external price sources, I'm not sure how anybody can prevent them from providing those feeds. If the price feeds come from other exchanges, the only way a government could turn off public access to that is by shutting down those exchanges. Such an action would have wider ramifications. But if it did that, there would be no way for users to know if they are getting a fair price anyway (no external BTS price), irrespective of whether we had external price feeds or not.

Though GD, I do worry about the lack of liquidity in BTS on these external exchanges. I have suggested elsewhere that it might be possible to set up a decentralised exchange for trading BTS against fiat, using escrow and other security features. Then we might have an exchange-driven price feed that is tamper-proof.

The only other alternative I can imagine is if we had a mechanism to ensure that the value of all bitAssets against each other bears the same relationship that these assets have externally against any other metric such as USD (which would still require a feed of prices for each asset against a common external metric). This would not require an external BTS feed at all. Then the value of BTS would be inferred from the price such a basket of bitAssets fetches in BTS on the internal exchange. Just thinking off the top of my head here, I don't know if this is feasible, or what other ramifications there might be.

I may be wrong, but as far as I understand, the idea for strengthening the pegs with infrequent feeds is that people will know the feeds are imperfect and as such will generally seek price information outside of the system.  In the future, if all major liquidity providers are using data feeds outside of the bts exchange, then the pegs will tighten and bts will not compromise its robustness. It does seem to be a kind of chicken-or-the-egg problem, however, I forecast people taking the risk to increase liquidity and strengthen the peg with information other than the internal price feed implementation because a tighter peg is better for business and all of those  who will be in the liquidity business will probably agree.
That would be great if it could happen, but as much as I've read this opinion, I can't get my head around it.

Liquidity providers cannot enforce a peg if the market disagrees that is the correct valuation for the bitAsset. Let's say the market comes to a consensus that a bitUSD is worth only 0.9 of a real USD, taking into account acceptance, collateral risk, regulatory risk, or other factors. Now a liquidity provider sets up buys and sells just around the peg price. All current owners would sell instantly to the liquidity provider. Now he ends up with all the bitUSD in his hands for which he has paid $1 worth of BTS for each. This is a big loss.

In my opinion, it's only the possibility of arbitrage that strengthens the peg. Market-makers can only provide liquidity around the natural market price, because that's where they will make the spread profit. More liquidity providers and bots may do a lot of things, but will never strengthen the peg. It needs arbitrage, and arbitrage requires certain parties to be contractually obligated to settle at the feed price. And it further needs tools such as I'm discussing in this thread. That's at least the way I see it, and if I'm right, we are barking up the wrong tree completely talking purely about liquidity providers and neglecting arbitragers, if its the peg we want to enforce.
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 30, 2015, 02:18:00 am
I think Bytemaster mentioned the current price feed is mainly in place because of the low liquidity, otherwise the system wouldn't have to rely on price feeds .  Ultimately you get enough volume on a platform and you become the price feed.  You also have to consider counterparty risk & entry/exit fees when evaluating price feeds on the various exchanges.
Yes, thanks for raising it again. The fact that this opinion is coming up a lot, and conflicts with my own view, means I need to give it deeper thought. I doubt I'll convince anyone of the need for feed-relative orders if they don't agree we need feeds in the first place!
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on March 31, 2015, 12:46:46 am
I think Bytemaster mentioned the current price feed is mainly in place because of the low liquidity, otherwise the system wouldn't have to rely on price feeds .  Ultimately you get enough volume on a platform and you become the price feed.  You also have to consider counterparty risk & entry/exit fees when evaluating price feeds on the various exchanges.
OK, so I'm trying to think through how this would work.
So if a bitUSD on external exchanges is trading for $0.80 real USD, do you set the feed price at 25% above the current bitUSD:BTS market price, so there is no more supply created until bitUSD pegs with real USD outside? In which case you still need a feed price...?
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: merivercap on April 01, 2015, 08:03:32 am
I think Bytemaster mentioned the current price feed is mainly in place because of the low liquidity, otherwise the system wouldn't have to rely on price feeds .  Ultimately you get enough volume on a platform and you become the price feed.  You also have to consider counterparty risk & entry/exit fees when evaluating price feeds on the various exchanges.
OK, so I'm trying to think through how this would work.
So if a bitUSD on external exchanges is trading for $0.80 real USD, do you set the feed price at 25% above the current bitUSD:BTS market price, so there is no more supply created until bitUSD pegs with real USD outside? In which case you still need a feed price...?

Interesting question.  I think Total Return Swaps & CFDs in general use an agreed upon price feed, but it may not be necessary in the current system.  Whatever is going on it seems to be working right? :)

I'm not sure about how the current price feed mechanism works, but we can try looking at your question from a different perspective.  Using your example, if it was a riskless exchange, people who wanted to buy BTS cheap would purchase the bitUSD for $0.80 per and sell it for BTS and push the bitUSD price up naturally.  If  the bitUSD at $0.80 was  at a risky exchange, the cheap prices would be the risk discount. 

We can step back and just think about what creates the market & price for bitUSD in the first place.   If you generate an order to create bitUSD you might offer it at 200BTS.   If someone buys that new bitUSD from you, the contract-for-difference (CFD) price will be set at '$.005' for each BTS. (Usually a CFD has an agreed upon price feed, but this CFD can be based on the market price of existing or new bitUSD at any point in time.) A month later a second bitUSD can be created by someone else at '$.01' for each BTS (or 100BTS for 1bitUSD).  The price of BTS doubles vs bitUSD.  All these orders to create bitUSD automatically generates pricing of what bitUSD is worth in BTS.  With high liquidity, the bitUSD creation/destruction process itself can generate USD/BTS pricing. 

Now there are two ways to invest in BTS.  You can just buy more BTS directly (ie. via US dollars converted to BTC from Coinbase then using Metaexchange)  or you can leverage your existing BTS positions and create bitUSD.  Both prices should generally converge based on the demand for BTS.  As an investor you just ask what is the cheapest way to get exposure to BTS?  Short bitUSD or buy BTS directly?  Your decision to do either based on the cheapest price will naturally balance the two markets.   When BTS is cheap relative to bitUSD you short.  When BTS is expensive relative to bitUSD you buy BTS directly.

Furthermore if you used price feeds there are potentially many, each with various counterparty risks and entry/exist friction:
US dollars (via checkbook money) -> BTC (via Coinbase) -> BTS (via Metaexchange)
US dollars (federal reserve notes) -> BTC (via LocalBitcoins) -> BTS (via Metaexchange)
US dollars (via checkbook money) -> BTC (via Coinbase) -> CNY (via BTC38) -> BTS (via BTC38)
US dollars (federal reserve notes) -> BTC (via LocalBitcoins) -> BTS (via Poloniex)
US dollars (federal reserve notes/Moneygram) -> BTC (via LocalBitcoins) -> BTS (via BTER)

If 90% of the volume was in trading & creating bitUSD and 10% of the volume was in investing in BTS directly, the bitUSD market would probably be a better indicator of USD/BTS pricing.... prices are always changing, always subjective... differs in time & place & mood etc.. so there is never really ever a true objective price or 'price feed' for anything.

Anyways those are just some thoughts... it may be good for me to experiment before theorizing too much and analyze the actual markets, but I'm waiting for trading on the web wallet to test.  I guess I can download a light client for Windows too...
Title: Re: A BitCurrency Bank and a BitTradingAsset derivatives exchange
Post by: starspirit on April 06, 2015, 11:11:51 pm
I'm not sure about how the current price feed mechanism works, but we can try looking at your question from a different perspective.  Using your example, if it was a riskless exchange, people who wanted to buy BTS cheap would purchase the bitUSD for $0.80 per and sell it for BTS and push the bitUSD price up naturally.  If  the bitUSD at $0.80 was  at a risky exchange, the cheap prices would be the risk discount. 

If the exchange was considered risky, this would affect all assets at the exchange, so would not explain why a bitUSD should trade cheap relative to other assets on the same exchange.

I believe that there are many alternative reasons why a bitUSD could trade cheap relative to other assets, in the absence of forced settlement at or above a feed price. Such possibilities might include the lack of guaranteed settlement itself, black swan/solvency risk, illiquidity, potential risk in converting BTS proceeds to USD if BTS is volatile, lack of market interest in bitUSD etc. If we admit the possibility of such views, there is no means by which one can be assured that a current bitUSD is cheap or expensive relative to its value in the future in a free-floating market.


Now there are two ways to invest in BTS.  You can just buy more BTS directly (ie. via US dollars converted to BTC from Coinbase then using Metaexchange)  or you can leverage your existing BTS positions and create bitUSD.  Both prices should generally converge based on the demand for BTS.  As an investor you just ask what is the cheapest way to get exposure to BTS?  Short bitUSD or buy BTS directly?  Your decision to do either based on the cheapest price will naturally balance the two markets.   When BTS is cheap relative to bitUSD you short.  When BTS is expensive relative to bitUSD you buy BTS directly.


The person who wants to invest in BTS has 2 choices, but they are not against the same asset, and so bear different risks. One they buy with USD. The other they make a bet against bitUSD. The argument that they are indifferent between these choices and simply buy the cheapest form assumes a priori that they expect the markets to converge. But then you are using that behaviour as evidence to show why we should expect the markets to converge. That is a circular argument in my opinion.

If we accept that logic, I could construct a simple counter-argument. Let's suppose the market does not believe that bitUSD and USD are comparable assets, and there is no expectation of convergence. Now the investor cannot decide which is the cheapest form. As a result, their trading behaviour will reflect different valuations, and no convergence will happen - which is also consistent with their initial expectation.

Not intending to cut you off, and I do appreciate your very considered response merivercap, but rather than go too far off the original purpose of this thread, I've raised this important issue in an another thread here...
https://bitsharestalk.org/index.php/topic,15474.msg199230.html#msg199230