BitShares Forum

Main => General Discussion => Topic started by: bytemaster on February 28, 2016, 04:18:26 pm

Title: Trustless, Decentralized Bond Market Draft
Post by: bytemaster on February 28, 2016, 04:18:26 pm
The challenge is to create a bond market where lenders can earn interest while being 100% protected against default by the borrowers. This means that at all times the blockchain must be able to cover all loans on the market.

This is difficult because it is computationally expensive to calculate the cascade effect of multiple margin calls and this must be done after every market operation.

The Solution

Someone who wants to borrow an asset may do so as long as there exists enough orders on the book to cover their new position and all other open loan positions at the price of  the least collateralized loan’s DEBT to COLLATERAL. The least collateralized loan establishes what we call the SWAN PRICE, short for black-swan. 

Every time a limit order is created, filled, or canceled the blockchain updates a running total of how much of a given asset is available for sale above the SWAN PRICE.

Every time a loan position is updated and a new SWAN PRICE is established, the blockchain must also update how much of a given asset is available for sale above the SWAN PRICE.

Basic Algorithm

Code: [Select]
    Let TAS = Total asset for sale above swan price.
    Let TD   = Total asset that has been borrowed

    onOrderUpdate   /// create, cancel, fill
       try
          push undo state
          create, cancel, or fill orders on the book
          update TAS
          if( TAS < TD )
                undo changes and throw
          commit changes
      catch
          execute margin call on least collateralized loan
          goto try


Someone looking to borrow an asset makes a request of the network that includes:

1. how much they wish to borrow
2. how much collateral they wish back it with

The borrowing request will be filled so long as they post sufficient collateral. The network will automatically bump lower collateralized positions if necessary.

A margin call can happen for any of the following reasons:
1. If canceling an open order would result in insufficient orders on the books to buy back the debt with the collateral, then a margin call is executed first, then the order is canceled (if it wasn’t used as part of the margin call).
2. If filling an order would result in insufficient orders on the books to satisfy all debt at the SWAN PRICE, then the margin call is executed first.
3. If someone is looking to borrow, offering more collateral than the SWAN PRICE, and there is insufficient orders above the SWAN price then the least collateralized position is called. This will update the SWAN price to the next best.

The impact of these rules is the following:

1. The least collateralized position is always at risk of margin call when there is more demand for loans than orders on the book.
If there are more orders on the book than demand for loans, then collateral requirements can fall and the least collateralized position is safe from potential margin call

2. The ability to move an order, rather than cancel and create a new order must be supported to prevent unnecessary margin calls.
Borrowers will post sufficient collateral to ensure sufficient market depth that they are not at risk of being called.

3. Increasing collateral lowers SWAN PRICE and increases the number of orders above SWAN and thus increases SUPPLY of asset to be borrowed.
Interest Payments

4. Everyone with an open order on the books above the SWAN PRICE is effectively lending money to those who wish to borrow. If there is heavy demand for borrowing then the market response should be to pay interest to the lenders.

In this algorithm, the network charges a “fixed” interest rate on the variable collateral. In this way the interest charged to borrowers grows along with the collateral requirement. Every open order on the books above the SWAN PRICE receives their pro-rata share of the interest paid by borrowers.

Lenders have the ability to “set their interest rate” and “collateral requirement” based upon the price at which they leave their order open on the book. If demand for loans grows enough to find the least collateralized loan  (SWAN PRICE) to be above the order price, then the loan is executed and the lender starts earning interest. If the SWAN PRICE never reaches the order price then the loan is not accepted and no interest is paid.

The impact of interest is to increase the number of orders on the book above the SWAN price which in turn serves to reduce collateral requirements.

The “fixed” interest rate can be configured by the asset issuer. If collateral requirements start to get unreasonably high, then interest rates can increase.


Feedback Wanted
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: cylonmaker2053 on February 28, 2016, 04:26:10 pm
The challenge is to create a bond market where lenders can earn interest while being 100% protected against default by the borrowers. This means that at all times the blockchain must be able to cover all loans on the market.

Why 100% default protection to lenders? why not mimic traditional bond markets where lenders assume risk for payment? Interest income should come from bearing risk IMO, a necessary condition for circumspection and functioning markets.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: sittingduck on February 28, 2016, 04:54:56 pm
They do bear risk of leaving an order on the book.  No different than a bank taking risk of you mailing in the keys rather than payment. 

If even one person is left holding the bag for a default it makes the entire block chain look bad. Block chains must have higher standards. 
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: cylonmaker2053 on February 28, 2016, 05:02:05 pm
They do bear risk of leaving an order on the book.  No different than a bank taking risk of you mailing in the keys rather than payment. 

If even one person is left holding the bag for a default it makes the entire block chain look bad. Block chains must have higher standards.

i love the automated collateral for smartcoins to significantly reduce default risk, but for bonds i don't see the same benefit. default risk is core to bond markets, else why would anyone differentiate who they lend to? there's no need to go down a similar moral hazard route as what FDIC insurance has done to deposits.

i see two types of potential bonds we can deal in: system generated "treasury bonds" and UIBs. would it make sense for a small company, for instance, to come to our bond market to raise capital, issue bonds, and there not be default risk embedded in the lending? of course not. i think we're overthinking the bond market, should keep it general, and start with a test case, like the treasury bond idea that recycles market fees as interest.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: JonnyB on February 28, 2016, 05:37:31 pm
The challenge is to create a bond market where lenders can earn interest while being 100% protected against default by the borrowers. This means that at all times the blockchain must be able to cover all loans on the market.

Why 100% default protection to lenders? why not mimic traditional bond markets where lenders assume risk for payment? Interest income should come from bearing risk IMO, a necessary condition for circumspection and functioning markets.

you can already do this with UIAs, just issue a token called CYCLON100USDBOND
then issue it to who ever lends you 100 BITUSD and pay them an agreed amount of interest. the market will decide your credit worthiness.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: cylonmaker2053 on February 28, 2016, 05:43:13 pm
The challenge is to create a bond market where lenders can earn interest while being 100% protected against default by the borrowers. This means that at all times the blockchain must be able to cover all loans on the market.

Why 100% default protection to lenders? why not mimic traditional bond markets where lenders assume risk for payment? Interest income should come from bearing risk IMO, a necessary condition for circumspection and functioning markets.

you can already do this with UIAs, just issue a token called CYCLON100USDBOND
then issue it to who ever lends you 100 BITUSD and pay them an agreed amount of interest. the market will decide your credit worthiness.

that's a great point. so what would a dedicated bond market add? doing what you just mentioned would cover UIB tender offers and secondary markets.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: sittingduck on February 28, 2016, 06:19:09 pm
This is to enable collateralized margin trading, not unsecured debt.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: JonnyB on February 28, 2016, 07:18:25 pm
This is to enable collateralized margin trading, not unsecured debt.

I suppose this is a new type of debt:

Unsecured debt

Secured debt.

And now.....Cryptographically secured debt
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: Pheonike on February 28, 2016, 07:34:01 pm
I think there should be two styles of bonds. One treasury style dedicated to smartcoins and a general bond for users to lend to each other. Not sure if they can  have the exact same mechanics because the risk profiles are different in my opinion
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: lil_jay890 on February 28, 2016, 08:14:04 pm
Calling this a bond market is misleading...  It doesn't have any of the charactertics of a bond.

There's no call date and no coupon.  Also the collateralization of this doesn't fit the description of a traditional bond market.

To properly do a bond market, there needs to be some sort of reputation system in place so that investors can evaluate risk.  Lending to an anonymous person you no nothing about is a non-starter.

Title: Re: Trustless, Decentralized Bond Market Draft
Post by: sudo on February 29, 2016, 12:43:40 am
does bts have enough users to support Bond Market?
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: onceuponatime on February 29, 2016, 12:50:10 am
does bts have enough users to support Bond Market?

Bytemaster has said that liquidity needs to come first. I think he is just planning ahead so that it is a drop and play once liquidity is achieved.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: tonyk on February 29, 2016, 03:17:19 am
 +5%
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: noisy on February 29, 2016, 03:44:15 am
Sidechain should be implemented first, before Bond market.

Bond market is feature which will be used by tiny fraction of bitshares users. Sidechain is something which could actually bring thousands of new users which will not have to worry any longer about security of traiding their REAL bitcoins on exchange.

With 100% bitcoin collateral, this will instantly boost all BTC:XYZ markets.

Moreover... there are other exchanges which has bondmarkers. There are none exchange/cryptocurrency which has such feature like sidechain. This should be our top priority which will move Bitshares to all frontpages of services about bitcoin.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: emailtooaj on February 29, 2016, 05:36:21 am
Sidechain should be implemented first, before Bond market.

Bond market is feature which will be used by tiny fraction of bitshares users. Sidechain is something which could actually bring thousands of new users which will not have to worry any longer about security of traiding their REAL bitcoins on exchange.

With 100% bitcoin collateral, this will instantly boost all BTC:XYZ markets.

Moreover... there are other exchanges which has bondmarkers. There are none exchange/cryptocurrency which has such feature like sidechain. This should be our top priority which will move Bitshares to all frontpages of services about bitcoin.
This^^^ times One billion trillion!
We really need to get our think tanks together and collaborate on this. 
If we can't get viable fiat gateways to integrate and carry Bitshares, then we must build our own decentralized vault and what better start than one which holds BTC! 
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: Empirical1.2 on February 29, 2016, 05:46:41 am
 +5% It's pretty impressive that you can create a model with no risk to lenders.

The only thing I wonder is whether we would be better off introducing the widely popular, currently used model but with more conservative initial and maintenance collateral settings? (Rather than a more complex, unfamiliar and also perhaps less favourable/uncertain for borrowers model.)

The lending prices you see on Poloniex and BitFinex are probably taking into account an exchange failure risk of >20% per annum. So while our Black Swan risk to lenders might be higher, our DEX failure rate is much lower so prices may end up being fairly similar to exchanges.

They do bear risk of leaving an order on the book.  No different than a bank taking risk of you mailing in the keys rather than payment. 

If even one person is left holding the bag for a default it makes the entire block chain look bad. Block chains must have higher standards.

It appears to be setting higher standards for one party in the trade at the expense of the other (poorer terms for borrowers) which might make it hard to create a successful market.

Similar to BitAssets forced settlement at 1-1. While great for providing 100% certainty for the longs, the burden & uncertainty this creates to shorts is part of the reason we see such a high BitAsset premium? Lowering forced settlement considerably and introducing a maintenance collateral requirement level above which you couldn't be force settled would still provide the majority of the benefits but create a more successful, active market imo. (The current setting also allows longs to profit when the market moves slightly in their favour at the expense of shorts or even gain a few % by manipulating BTS price fairly cheaply at forced settlement time.)
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: JonnyB on February 29, 2016, 07:44:37 am
Sidechain should be implemented first, before Bond market.

Bond market is feature which will be used by tiny fraction of bitshares users. Sidechain is something which could actually bring thousands of new users which will not have to worry any longer about security of traiding their REAL bitcoins on exchange.

With 100% bitcoin collateral, this will instantly boost all BTC:XYZ markets.

Moreover... there are other exchanges which has bondmarkers. There are none exchange/cryptocurrency which has such feature like sidechain. This should be our top priority which will move Bitshares to all frontpages of services about bitcoin.

Yeah I totally agree with this. Bond market isn't a priority and Bytemaster even said in the previous hangout it is unviable until we have deep liquid markets. Sidechain for BTC would help this alot.

I really think our only focus as a community right now should be liquidity.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: xeroc on February 29, 2016, 09:25:56 am
Quote
TNSTAAFL.

First off, I think describing this as a "Bond Market" is the wrong choice. As far as I know, there's no such thing as a "margin call" in bonds. Instead, this functions most like a margin account with a stockbroker: you can borrow on top of securities you hold with them as collateral, and if the price drops, you are sold out of your position.

The claim of 100% protection is false as well. There can be no guarantee or defense against a black swan event where the market evaporates in the underlying asset. Whether or not this event is considered likely is irrelevant: the claim of perfect security is false and is hidden by a lot of hand waving which ignores the fact that no calculations you do now can tell you what you'll be able to sell something for in the next moment with a guarantee.

Presenting this as a "bond" skips over the major disadvantage to the borrow compared to a real bond market: In a real bond market, if you make your payments, everything is fine. In this proposal, everything must be fully backed by collateral and the payments are irrelevant to being able to prevent the collateral from being sold.

This may be useful technology for allowing people to trade on margin more securely, but I believe it will also tend to increase volatility to the extent it's adopted since it creates exposure to cascading margin calls.

This basic misnomer led to a fair amount of confusion of purpose in that thread as a direct result. It makes no sense to call this a bond because it does not behave at all like a bond.
https://www.reddit.com/r/CryptoCurrency/comments/484cwz/trustless_decentralized_bond_market_draft/d0hcblb?context=3
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: abit on February 29, 2016, 09:55:41 am
Sidechain should be implemented first, before Bond market.

Bond market is feature which will be used by tiny fraction of bitshares users. Sidechain is something which could actually bring thousands of new users which will not have to worry any longer about security of traiding their REAL bitcoins on exchange.

With 100% bitcoin collateral, this will instantly boost all BTC:XYZ markets.

Moreover... there are other exchanges which has bondmarkers. There are none exchange/cryptocurrency which has such feature like sidechain. This should be our top priority which will move Bitshares to all frontpages of services about bitcoin.

Yeah I totally agree with this. Bond market isn't a priority and Bytemaster even said in the previous hangout it is unviable until we have deep liquid markets. Sidechain for BTC would help this alot.

I really think our only focus as a community right now should be liquidity.
Technically the side chain thing requires a totally different skill set. To be simple, if you can describe how the bond market would work in detail, I can implement it within an estimated time. But I have no idea how many efforts are needed to implement the side chain feature.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: abit on February 29, 2016, 10:26:49 am
BM in the last mumble actually said that we should focus on the liquidity proosal and the rate limited fee features next simply because the bond market will take months and you know how long an initial esimate of "a few months" really takes.

He also mentioned that running Ethereum VM on our chain is possible, but I think it might be a better idea to wait until more dapps are made, or not?
EVM is the next BIG thing. We should put in into long term road map. @jakub?
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: morpheus on February 29, 2016, 07:10:42 pm
Is this SWAN price the same SWAN price that is used now?
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: bytemaster on February 29, 2016, 07:41:24 pm
Is this SWAN price the same SWAN price that is used now?

Similar concept, but not identical.   SWAN is the price at which the least collateralized position is unable to fully cover itself with its collateral.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: Ander on February 29, 2016, 09:47:15 pm
The challenge is to create a bond market where lenders can earn interest while being 100% protected against default by the borrowers. This means that at all times the blockchain must be able to cover all loans on the market.

Why 100% default protection to lenders? why not mimic traditional bond markets where lenders assume risk for payment? Interest income should come from bearing risk IMO, a necessary condition for circumspection and functioning markets.

Because we want people to actually use the system and lend. 

By the way, this system appears to me to be copying Poloniex's system really well, which is a good thing.  Poloniex has been doing such lending for around a year now and hasnt yet has a single instance of screwing over the lenders and not being able to repay them, due to the robustness of their algorithm.

Bitshares copying that algorithm is what we should be aiming for.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: Ander on February 29, 2016, 09:48:52 pm
Calling this a bond market is misleading...  It doesn't have any of the charactertics of a bond.

There's no call date and no coupon.  Also the collateralization of this doesn't fit the description of a traditional bond market.

To properly do a bond market, there needs to be some sort of reputation system in place so that investors can evaluate risk.  Lending to an anonymous person you no nothing about is a non-starter.

Its the margin trading lending market. :)  And its what Bitshares needs in place in order to be able to both allow margin trading inside bitshares, and award yield to savers.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: Ander on February 29, 2016, 09:56:23 pm

A margin call can happen for any of the following reasons:
1. If canceling an open order would result in insufficient orders on the books to buy back the debt with the collateral, then a margin call is executed first, then the order is canceled (if it wasn’t used as part of the margin call).
2. If filling an order would result in insufficient orders on the books to satisfy all debt at the SWAN PRICE, then the margin call is executed first.

This is important to protect lenders, so I think these are good ideas.


When a margin call liquidation occurs, it will often trigger a cascade, and will be very computationally intensive.  When this happens on poloniex, for example, the site freezes up for a few seconds or maybe even longer, while it executes liquidations. (The results can be crazy.  For example, recently CLAMS had a rally that went from .001 to .002 in a day, and when it broke above .002 it triggered a cascade of liquidations that took it from .002 to .003, a 50% increase, in an instant, while poloniex was frozen executing the liquidatons.



How is the bitshares blockchain going to handle to computation intensity of this algorithm, while attempting to maintain 3 second block times?  3 seconds may not be enough for a witness to calculate the required liquidation cascade and then broadcast the block.    Given the importance of what takes place in that block, it seems very important that it not result in a fork or orphaned block.  Do we have plans to handle these issues?



Finally, I'm very glad to see progress finally being made on this. :)  Thanks to everyone working on Bitshares.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: Empirical1.2 on February 29, 2016, 10:15:43 pm
The challenge is to create a bond market where lenders can earn interest while being 100% protected against default by the borrowers. This means that at all times the blockchain must be able to cover all loans on the market.

Why 100% default protection to lenders? why not mimic traditional bond markets where lenders assume risk for payment? Interest income should come from bearing risk IMO, a necessary condition for circumspection and functioning markets.

Because we want people to actually use the system and lend. 

By the way, this system appears to me to be copying Poloniex's system really well, which is a good thing.  Poloniex has been doing such lending for around a year now and hasnt yet has a single instance of screwing over the lenders and not being able to repay them, due to the robustness of their algorithm.

Bitshares copying that algorithm is what we should be aiming for.

That's good if it replicates something similar to the Poloniex system.

In Polo, it seems that if you have at least the maintenance collateral amount you're safe unless the price moves against you, in this model it seems you can be margin called based on orders moving around/being removed from the book. Is it the same on polo, if not could this put of borrowers off or not really in your opinion?
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: Ander on February 29, 2016, 10:46:46 pm
In Polo, it seems that if you have at least the maintenance collateral amount you're safe unless the price moves against you, in this model it seems you can be margin called based on orders moving around/being removed from the book. Is it the same on polo, if not could this put of borrowers off or not really in your opinion?

Imo we should replicate the polo system as much as possible, as it is proven to work.  (In a year, there has not been a black swan big enough to cause a failure, even with some wild swings in prices). 

In the polo system, lets say that you go long BTS, to the maximum allowed 40% margin requirement.  (2.5x
long).  Polo doesnt actually check against the last price that the coin was traded at to see if your margin is okay, it checks against the buy orders that are on the books.  So if the last price of a trade was 900 sats, but there is no buy orders down until 850 sats, it actually looks at the 850 sats to calculate your margin.  And if that 850 sat buy order is not big enough to cover your position (your long is more BTS), then it will look down the order book further until it gets to the point where it sees how you can cover all of your position. 

The amount of BTC you could get by market selling your position onto the books is how much poloniex actually considers your position to be worth.

From what I understand of bytemasters proposed system, it works the same.



Lets say that the person with the buy wall at 850 sats in our example cancelled his order.  Now, polo recalculates how much you could sell your BTS for. Lets say that the 850 wall was a big wall and you were relying on its existence.  Without it, poloniex sees that you would have to dump all the way down to 400 sats in a liquidation!   It recalculates your margin and determines that you are below the 20% liquidation level and are no longer safe. Therefore it autoliquidates your position, and crashes the price to 400 sats.


So the removal of an order from the books on polo can trigger forced liquidations.  Bitshares would need to do the same thing.  Its necessary in order to protect lenders.


I might suggest that for robustness sake, that if this scenario occurs that what Bitshares should do is to not allow the order to be cancelled but instead to liquidate the position into it, when the person tried to cancel the order.  Essentially, when the buy wall owner submits the order to cancel to the blockchain, the blockchain responds 'oh no, if you pull that order then it will cause forced liquidations.  Therefore you cannot pull the order, and the forced liquidations are happening now instead'. 


What will happen as a result of this is that people are going to put in big buywalls, and others are goign to take margin positions in front of them, and then the buywall placers are going to pull their walls in order to get cheap (whatever theyre buying).  This happens on polo.  Its what happened when Bitshares crashed after the 2.0 release, the price would start to drop, a whale would remove a buy order, and it would trigger liquidations.

But there isnt any way to avoid this if we want to protect lenders, and imo we NEED to protect lenders.  Lending needs to be safe.  The margin traders take all the risk.  After all, everyone knows margin trading is risky.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: CoinHoarder on March 01, 2016, 04:46:55 am
[    ] killer app
[ x ] nice feature
[    ] should be high up on the priority list
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: Empirical1.2 on March 01, 2016, 05:31:40 am
In Polo, it seems that if you have at least the maintenance collateral amount you're safe unless the price moves against you, in this model it seems you can be margin called based on orders moving around/being removed from the book. Is it the same on polo, if not could this put of borrowers off or not really in your opinion?

Imo we should replicate the polo system as much as possible, as it is proven to work.  (In a year, there has not been a black swan big enough to cause a failure, even with some wild swings in prices). 

In the polo system, lets say that you go long BTS, to the maximum allowed 40% margin requirement.  (2.5x
long).  Polo doesnt actually check against the last price that the coin was traded at to see if your margin is okay, it checks against the buy orders that are on the books.  So if the last price of a trade was 900 sats, but there is no buy orders down until 850 sats, it actually looks at the 850 sats to calculate your margin.  And if that 850 sat buy order is not big enough to cover your position (your long is more BTS), then it will look down the order book further until it gets to the point where it sees how you can cover all of your position. 

The amount of BTC you could get by market selling your position onto the books is how much poloniex actually considers your position to be worth.

From what I understand of bytemasters proposed system, it works the same.



Lets say that the person with the buy wall at 850 sats in our example cancelled his order.  Now, polo recalculates how much you could sell your BTS for. Lets say that the 850 wall was a big wall and you were relying on its existence.  Without it, poloniex sees that you would have to dump all the way down to 400 sats in a liquidation!   It recalculates your margin and determines that you are below the 20% liquidation level and are no longer safe. Therefore it autoliquidates your position, and crashes the price to 400 sats.


So the removal of an order from the books on polo can trigger forced liquidations.  Bitshares would need to do the same thing.  Its necessary in order to protect lenders.


I might suggest that for robustness sake, that if this scenario occurs that what Bitshares should do is to not allow the order to be cancelled but instead to liquidate the position into it, when the person tried to cancel the order.  Essentially, when the buy wall owner submits the order to cancel to the blockchain, the blockchain responds 'oh no, if you pull that order then it will cause forced liquidations.  Therefore you cannot pull the order, and the forced liquidations are happening now instead'. 


What will happen as a result of this is that people are going to put in big buywalls, and others are goign to take margin positions in front of them, and then the buywall placers are going to pull their walls in order to get cheap (whatever theyre buying).  This happens on polo.  Its what happened when Bitshares crashed after the 2.0 release, the price would start to drop, a whale would remove a buy order, and it would trigger liquidations.

But there isnt any way to avoid this if we want to protect lenders, and imo we NEED to protect lenders.  Lending needs to be safe.  The margin traders take all the risk.  After all, everyone knows margin trading is risky.

 +5%  +5% Thanks for the detailed response & explanation Ander

Quote
Imo we should replicate the polo system as much as possible, as it is proven to work. 

 +5% I agree, I'm always in favour in using what has already proven to work, is popular and with the settings people are familiar with.

Quote
I might suggest that for robustness sake, that if this scenario occurs that what Bitshares should do is to not allow the order to be cancelled but instead to liquidate the position into it, when the person tried to cancel the order.  Essentially, when the buy wall owner submits the order to cancel to the blockchain, the blockchain responds 'oh no, if you pull that order then it will cause forced liquidations.  Therefore you cannot pull the order, and the forced liquidations are happening now instead'. 

It looks like this proposal already has that feature too?

1. If canceling an open order would result in insufficient orders on the books to buy back the debt with the collateral, then a margin call is executed first, then the order is canceled (if it wasn’t used as part of the margin call).

To BM/Devs, I know this might not be the next feature, but  what would be a ballpark development time and cost for it be?
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: abit on March 01, 2016, 11:57:36 am
In Polo, it seems that if you have at least the maintenance collateral amount you're safe unless the price moves against you, in this model it seems you can be margin called based on orders moving around/being removed from the book. Is it the same on polo, if not could this put of borrowers off or not really in your opinion?

Imo we should replicate the polo system as much as possible, as it is proven to work.  (In a year, there has not been a black swan big enough to cause a failure, even with some wild swings in prices). 

In the polo system, lets say that you go long BTS, to the maximum allowed 40% margin requirement.  (2.5x
long).  Polo doesnt actually check against the last price that the coin was traded at to see if your margin is okay, it checks against the buy orders that are on the books.  So if the last price of a trade was 900 sats, but there is no buy orders down until 850 sats, it actually looks at the 850 sats to calculate your margin.  And if that 850 sat buy order is not big enough to cover your position (your long is more BTS), then it will look down the order book further until it gets to the point where it sees how you can cover all of your position. 
This is similar to what BitShares 2.0 did at the beginning: a trial to eliminate price feeds. The market need to have liquidity first (huge buy wall) to support such feature.

//Update: Just saw it's mentioned in the rest of your post.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: abit on March 01, 2016, 12:04:17 pm
1. If canceling an open order would result in insufficient orders on the books to buy back the debt with the collateral, then a margin call is executed first, then the order is canceled (if it wasn’t used as part of the margin call).

To BM/Devs, I know this might not be the next feature, but  what would be a ballpark development time and cost for it be?
It sounds like the system is front-running. I don't think it's a good behavior.

//Update: however, if all participants already know the rules/risks, and still participate in the market, it's acceptable for me.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: abit on March 01, 2016, 12:21:57 pm
How is the bitshares blockchain going to handle to computation intensity of this algorithm, while attempting to maintain 3 second block times?  3 seconds may not be enough for a witness to calculate the required liquidation cascade and then broadcast the block.    Given the importance of what takes place in that block, it seems very important that it not result in a fork or orphaned block.  Do we have plans to handle these issues?
Good question.

I think we need to do some stress testing first, so we can know our capacity, and maybe set some limitations at first, for example maximum number of orders, max spread and etc. While the market grows, we improve the code, improve hardware of witnesses, adjust parameters etc.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: giant middle finger on March 03, 2016, 03:17:18 am
Let's work on sidechaining first and let the big banks decide on their standard crypto based  bond market format:

http://mobile.reuters.com/article/idUSL8N16A30H

We will fork their format after they are done. Why waste resources. We are just going to have to conform to this market standard eventually.  Measure twice, cut once.

Remember how many times we tweaked the DEX?  Let's learn from someone else's trial and error for a change.

Sidechaining first
Bond Market second
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: donkeypong on March 03, 2016, 03:51:47 am
Honestly, I think this is like Stealth. It will be nice to have, but I wouldn't choose to grant it a high priority. Why? Because we should focus on projects that improve this ecosystem by bringing in more liquidity and market cap. We need to take some bigger steps, bigger risks, make a bigger splash. How many people will actually use these bonds who aren't already long term investors?


Sidechaining first
Bond Market second

Sounds good to me.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: tbone on March 03, 2016, 04:18:11 am
Interesting feature I found on BTC-China's Pro Exchange.  When it comes to forced liquidations, they use something called Early Assignment Profit.  See below.  Perhaps this is something we could employ.  Although like a few others here, I think it makes more sense to implement a bitcoin sidechain first. 


Pro Exchange uses Early Profit Assignment™, which means that when there are forced liquidation events and a lack of liquidity, the platform will automatically select and close the highest earning positions, and immediately notify the customer(s) whose positions have been closed. Early Profit Assignment™ immediately locks in customer(s)’ profits when it closes their positions, and the customer(s) can re-open their positions as they choose. Early Profit Assignment™ ensures that forced liquidation events never cause systematic losses, and thus eliminates the need for socializing losses from winners.
Title: Re: Trustless, Decentralized Bond Market Draft
Post by: abit on March 03, 2016, 09:11:32 am
Interesting feature I found on BTC-China's Pro Exchange.  When it comes to forced liquidations, they use something called Early Assignment Profit.  See below.  Perhaps this is something we could employ.  Although like a few others here, I think it makes more sense to implement a bitcoin sidechain first. 


Pro Exchange uses Early Profit Assignment™, which means that when there are forced liquidation events and a lack of liquidity, the platform will automatically select and close the highest earning positions, and immediately notify the customer(s) whose positions have been closed. Early Profit Assignment™ immediately locks in customer(s)’ profits when it closes their positions, and the customer(s) can re-open their positions as they choose. Early Profit Assignment™ ensures that forced liquidation events never cause systematic losses, and thus eliminates the need for socializing losses from winners.
Interesting. But maybe only practicable in a liquid market.
1. what price will be used on the force-closing?
2. To prevent from force-closing of positions, traders will probably compete on closing old positions which already have enough profit then opening a new position.