Using a BitShares Decentralized Exchange (DEX) market for BitUSD and BitCNY pricefeeds

in #bitshares5 years ago (edited)

Note: This is a somewhat in-depth article on theories of how to maintain the pegging mechanism for stable coins on the BitShares blockchain. As such, it may be outside the interest of many of our normal readers. Also, it’s a bit technical and requires a fairly advanced understanding of markets. The intended audience is primarily BitShares community members.

BitShares has been using centralized exchange pricefeeds for years, why change now?

There was recently a claim that a centralized exchange (a CEX) was used to artificially manipulate downwards the price of BTS. This claim was then used to convince witnesses to feed a fake price for BTS relative to bitUSD and bitCNY to “counter” this manipulation and protect bitUSD/bitCNY marginers (people who create BitUSD and BitCNY using their BTS as collateral). These marginers would normally have been called on their BTS collateral if BTS had dropped much more and the feeding of this fake pricefeed not only protected them from being called, it also broke the peg for anyone who attempted to convert their BitUSD or BitCNY into BTS (e.g. BitUSD became worth less than 1 USD and BitCNY became worth less than 1 CNY when doing an a “forced conversion” operation).

BitShares has a protection mechanism called “forced conversion” that was created to ensure that BitUSD and BitCNY holders could rely on the pegged value of these assets, so that even in the case of low liquidity for these assets (when no buyer is available to purchase the asset), a holder could convert his bitasset into an equivalent amount of presumably more liquid BTS which could then be sold for corresponding USD or CNY. But by falsifying the pricefeed, this protection has been severely impaired.

I personally believe that the evidence presented for this claimed manipulation of BTS pricing was far from compelling (in short, I think the claimants are, at the very least, wrong about this and that most of them were economically incentivized to be wrong about this). Despite the weakness of the proof presented, the resulting fake pricefeeding by witnesses broke the pegs for bitUSD and bitCNY, harmed anyone who was holding these bit assets, and damaged the long term reputation of all bit assets.

Unless this argument of price manipulation can be destroyed, it seems inevitable that this same excuse will be used again and again whenever marginers are about to lose their funds, to protect them against loss, at the expense of the bitasset holders (because the marginers tend to hold the majority of the BTS and thus can vote out non-compliant witnesses).

Why use the DEX for the price feed?

To prevent the re-use of this argument, I’m proposing that one or more DEX markets be used as the pricefeed source, to prevent future claims of manipulation as a reason to break the bitasset pegs.

On a centralized exchange, a large fake amount of BTS can theoretically be created, then sold to drive down the price on that exchange. But BTS supply cannot be faked on the DEX markets, so this attack is not possible.

A further part of such a theoretical supply-based attack is for a large amount of fake volume to be generated on the CEX that is being used to manipulate the BTS price, because the pricefeeds scripts used by witnesses use volume-weighted pricing between multiple CEXS. If a lot of wash-trading is done on a CEX market to create fake volume, the pricefeed scripts would then let the price from that CEX be the dominant factor in its price calculation, effectively setting the BTS price based on that single CEX.

In summary, the attack against BTS price at the current moment is potentially possible by finding an exchange where the BTS liquidity is relatively low (so that there is not resistance to price movement by the attacker), generate a lot of wash trades on that CEX to convince pricefeeds it is the best source of pricing data, then make your wash trades drive down the price on that CEX. An even more easy attack is if the CEX itself is involved in the price manipulation, in which case it can generate fake BTS and drive down the price on that exchange against any resistance by BTS buyers.

What market on the DEX should be used?

I would suggest using an ETH/BTS market from one or more reliable gateways. By reliable, I mean a gateway where the deposit and withdrawal paths for ETH are operational. I suggest ETH as the pairing asset because it is asset supported on most centralized exchanges (CEXs), has good volume, and is fast enough to support efficient arbitraging paths between the DEX and CEXs.

Why are arbitraging paths needed?

Arbitraging paths aren’t strictly needed, if the DEX was the primary market for BTS buying and selling. But at the current time, it is not the primary market, CEXs are. So to get the “true” fair price for BTS, the DEX market(s) used for the BTS pricefeed calculation need to be arbitragable against the CEX markets.

Is the DEX market itself manipulatable?

Well, clearly it’s not manipulatable in a supply sense, because the BitShares blockchain is the final arbiter on what the supply of BTS is. So an attack based on fake BTS supply cannot be executed.

But some people have raised concerns about the current low trading volume on the DEX relative to CEXs. At the current time, an aggressive buyer could fill all the existing buy orders on the ETH/BTS market, for example, then do a fake wash trade (a trade with themselves) at a lower price than the prevailing price on more liquid exchanges.

How do we prevent a liquidity-based attack on the DEX market used for the pricefeed?

The essential defense against a liquidity-based attack to drive the price of BTS down is to incentize a group of people to defend that price by placing “buy orders” on the DEX market. As it happens, if the pricefeeds are based solely on that DEX market, we already have a group of people who are so incentivized: the marginers who create BitUSD and BitCNY by putting up BTS as collateral. If the price of BTS is being driven down by a liquidity-based attack, they have a strong incentive to place and maintain BTS buy orders to counter the attack.

Do the marginers have sufficient funds to defend against a liquidity based attack?

They certainly should have, because they have collaterized their BTS to obtain other assets (e.g. bitUSD and bitCNY) and these funds can then be used to obtain other assets to place defensive buy orders on a market like ETH/BTS which is being used for the pricefeed. In practice, marginers are the largest holders of BTS in the entire blockchain. If they don’t have the resources to defend the price, no one does.

If there’s an extended attack against the DEX market and the attacker is willing to relentlessly sell their BTS at lower price to eliminate the buy orders on the DEX, then the marginers can take the BTS they obtain from these sales, sell it at the higher prices available on CEXes, then use the resulting profits to add more buy orders on the DEX (i.e. the marginers can arbitrage to prevent the DEX market price from being driven down beyond the generally available market price).

But wait, if marginers are defending the price of BTS, maybe the BTS price on DEX will go too high?

If the BTS price used for the pricefeed becomes higher than the “true price”, then the bitasset peg will still be broken (which is bad). And marginers will certainly have this incentive in a dropping market for BTS. So who will place the sell orders to keep the price fair? In a word, arbitragers. And especially arbitragers who also hold bitassets and want the price peg to be maintained. Just like marginers are incentivized to place buy orders on the DEX by the pricefeed, bitasset holders are incentivized to place sell orders on the DEX to maintain the peg.

So if marginers put up orders to buy BTS at higher prices than can be obtained on CEXs, arbitragers looking to profit will buy up the lower cost BTS on CEXs, then sell that BTS to the marginers, forcing the price on the DEX market into alignment with generally prevailing prices.

Beneficial side-effect: Increase liquidity on the DEX

A nice potential side benefit of this change is it incentivizes marginers and bitasset holders to increase liquidity of the market(s) used to make the pricefeed. Wouldn’t it be nice if serious investors actually came to the BitShares blockchain first to buy their BTS?

Sort:  

"I would suggest using an ETH/BTS market from one or more reliable gateways. By reliable, I mean a gateway where the deposit and withdrawal paths for ETH are operational. "

What give as the guarantee that they remain reliable and they will not stop deposits/withdrawals at any point to get advantage of the "new" mechanism?

Would it be not better we use multiple bts/bitASSETs dex pairs (+ bts/gateway-ETH if so important)?

In theory, bts/bitasset pairs would be fine, but in bitshares there tends to never be nearly as much liquidity for the bitassets versus external assets like BTC and ETH. For this reason, I think it would be better to stick with ETH for now. But using pairs from multiple gateways is a good idea assuming there are multiple reliable gateways as this would prevent disruption in the case that one of the gateways has it's deposits/withdrawals temporarily disabled.

Just a few comments:

  • Witnesses were not convinced to fake the price feed. They were coerced. Several witness reported to have been outvoted for refusing to do the faking.

  • Funny I thought this was the way it was designed. Before even knowing about witnesses.

  • I mentioned in one of the telegram channels that, in order to overcome the lack of liquidity in the DEX, and still use it for feeding price, instead of taking market price we could use the average of a given time window, let's say the last 4 hours.

It's true that they were coerced, but part of the narrative that explained away the coercion was the claim about manipulation on CEXs. If this claim can be proven false, then witnesses can't kid themselves that they are protecting poor marginers who are being unfairly attacked. And marginers would have to consider more strongly the damage they were doing to the ultimate value of BTS by such an obviously corrupt action.

Averaging over a time window might work, but it risks a case of insufficient collateral in the case where there's an abrupt drop in price. Margin calls have to be made rapidly in such cases.

I tried to get setup on Bitshares a while ago, but I ran into issues. I thought I had my account setup but then it wouldn't let me access it. It was all a giant mess. I say all of that because it is still something that interests me and I think this article would have been really good for me if I had been able to get setup. I am definitely going to keep it as a favorite in case I can finally get things worked out and I need to come back to reference it.

You talked about the marginers...love that part. Thank for sharing with us..regards

don't talk much but when you do, hmm ... 'colluding to protect' hm ... there's worse things in life ... coming together on coming grounds always sounds a lot better to me than 'teamwork' lol .. after that you go your own way ...

a fine theory, i'll make sure to heed it when my income rises above 5 cents ;-) (that's actually not sarcasm aimed at you ... i need to put in five disclaimers per two words recently when i speak ...)

wish they would cap STEEM instead of inflate it to DOGE levels, and come together to get it up to a certain level, a bit like you describe here but

pigs might yet fly ...

talking steem, not -it ... how a capped amount (can even BURN some to make it even less lol) would translate to the primal DAPP thats confused by half the populace of steemtown for the chain itself is something i think best left to the bots, they seem to be creative enough when it comes to saving their money supply lol ... wellwell okay ... (and nevermind ... :D )

(it would make it attractive to a lot to dump after a drought ofc. but thats why the real bigguns should / need to do that , moreover a capped amount at a certain price is a lot more attractive to real Winklevoss-class money-holders imo, why would they care about spare change if you can make 100k with BTC overnight if you have 'some' (i mean 'some' according to their notion of what 'some' would constitute) anywhere between $5 or $10 would be a good start maybe, but without the inflation fixed i think its beeeeeeeeep ..(but i hope im wrong ofc...)

animated-have-a-nice-day-image-0008.gif

(ah well .. .i always make five or six edits because my name is chaos, the son of Kaos and the Cat, unstuck in time, see , when the world was young i remember trying some math and BTC at 8 digits could in theory have held the value of all dollar in the world when all 21 mln were mined, you don't need a trillion coins, just enough digits ... it certainly seems to work for them) (here i go again i was gonna stop with the meme tsss....) good night to you then

so good blocktrades bch to steem exchange pls.

I think using DEX is the right step to prevent counterfeiting of BTS and other abuse.

This seems like a big problem for market stability. Maintaining a peg to soverign currencies while keeping the BTS market running is just as impossible when large flows of capital move the USD or CNY prices or when large liquidations of BTS drain liquidity. Its a similar situation to a central bank of small country trying to maintain a peg to the USD; when things are calm and business as usual it works but when the markets moves there simply isn't enough liquidity to maintain price parity. Arbitrage can help find the new equlibrium of prices but can't stop the movement of prices as arbitragers also have finite resources and they will look to maximise return by finding the low point to buy and the high point to sell, their incentives are to put the peg under pressure and ultimately break it if they can.

Nice post

Posted using Partiko Android

Great post..very helpful!!!

Posted using Partiko Android

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 63672.27
ETH 3126.79
USDT 1.00
SBD 3.87