Author Topic: Feature Discussion: automatically adjust core_exchange_rate of an asset  (Read 3315 times)

0 Members and 1 Guest are viewing this topic.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
I can write a bot for this that sets the CER at last_trade +5% or so .. or use the 24h average instead of last_trade.
What do you think makes most sense?
Here we go:
https://github.com/xeroc/python-graphenelib/commit/96c1380ad1ca96f15ede5572be5f64eb3a3d4a4a
@ccedk please check this
BitShares committee member: abit
BitShares witness: in.abit


Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I assume you mean the mid-price of the last 24h candle? .. mid price as in high-low?

mid price = (bid+ask)/2
Gotcha ..

Offline monsterer

I assume you mean the mid-price of the last 24h candle? .. mid price as in high-low?

mid price = (bid+ask)/2
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I can write a bot for this that sets the CER at last_trade +5% or so .. or use the 24h average instead of last_trade.
What do you think makes most sense?

Use the mid price, not the last trade
I can write a bot for this that sets the CER at last_trade +5% or so .. or use the 24h average instead of last_trade.
What do you think makes most sense?

Use the mid price, not the last trade
I assume you mean the mid-price of the last 24h candle? .. mid price as in high-low?

Offline monsterer

I can write a bot for this that sets the CER at last_trade +5% or so .. or use the 24h average instead of last_trade.
What do you think makes most sense?

Use the mid price, not the last trade
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I can write a bot for this that sets the CER at last_trade +5% or so .. or use the 24h average instead of last_trade.
What do you think makes most sense?

Offline Thom

I agree, bots for now. When we have more liquidity in BitAssets, particularly the fiat BitAssets (BitUSD, BitCNY etc) then the CER could be based on those. That's the whole point of those derivatives, to create a stable asset. If you need / want that in your UIA base it's value on a BitAsset. That is the way to go long term.
Injustice anywhere is a threat to justice everywhere - MLK |  Verbaltech2 Witness Reports: https://bitsharestalk.org/index.php/topic,23902.0.html

Offline roadscape

+5%

This would be a very useful feature when we have more liquid assets, but I think bots are the best way for now. Eventually users may demand something like this.
http://cryptofresh.com  |  witness: roadscape

Offline KenMonkey

  • Full Member
  • ***
  • Posts: 112
    • View Profile
  • BitShares: kmnk
In-built would be cool. Advanced users could use bots to set the CER for their asset. It can be their choice to publish the algorithm on the asset page. Or! Choose to opt-in to an auto-bitshares-bot algorithm to choose the CER.

With smart-coins I think we need price-feeds right now, but once the bitshares DEX blows up it could turn into a sort of feedback loop... in the case that real asset prices were at all actually determined by the bitshares DEX.

imagine that?

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
According to http://docs.bitshares.org/bitshares/user/assets-faq.html#fee-pool, to avoid unexpected loss, UIA issuers need to keep an eye on the fee pool as well as the market, adjust CER(core exchange rate) when needed.
Quote
What is the fee pool all about?
The fee pool allows participants in the network to deal with assets and pay for the transaction fees without the need to hold BTS. Any transaction fee can be paid by paying any asset that has a core exchange rate (i.e. a price) at which the asset can be exchange implicitly into BTS to cover the network fee. If the asset’s fee pool is funded, the fees can be payed in the native UIA instead of BTS.

Note
The core exchange rate at which a fee can be exchanged into BTS may differ from the actual market valuation of the asset. A user, thus, may pay a premium or spare funds by paying in BTS.

Warning
Make sure your core exchange rate is higher than the lowest ask, otherwise, people will buy your token from the market and drain your fee pool via implicit arbitrage.


It is the task of the issuer to keep the fee pool funded and the core exchange rate updated unless he wants the owner of his asset to be required to hold BTS for the fee.

The fee pool acts like the asset issuer placed a bid order (buy asset, sell BTS) in the system with CER as the price/rate. When a participant wants to pay a fee in the asset but not in BTS, actually she sells some asset to the issuer. If there is an ask order in the market which is selling some assets for less BTS, an opportunist can buy asset from market, then sell to the issuer to get an instant profit.

Currently, issues can run bots to adjust CER automatically.

So here comes an idea: why don't we have a built-in feature that adjusts CER automatically?

My proposal:
* issuer can set a parameter on the asset: P%, when the market moves, the system automatically adjust CER to "a_fair_base_price" * (1 + P%)
* make this feature opt-in, which means UIA issuers can enable it or disable it at will

Potential options for "a_fair_base_price" includes:
[easier to implement]
* current highest bid
* current lowest ask
* latest order filling price
* a calculation based on above values
[harder to implement]
* [weighted]average/lowest/highest filling_price/bid_price/ask_price in last X hours
* a calculation based on above values

In a liquid market, the automatic adjusting may work just fine (see price feeding for smart coins).
In an illiquid market, there may be people try to manipulate the price, so maybe automatic adjusting won't work.
 
Extended thoughts: probably we can adjust settlement_price of smart coins in similar way, so eliminate the need of price feeds?

More thoughts?
BitShares committee member: abit
BitShares witness: in.abit