BitShares Forum

Main => Technical Support => Topic started by: alt on December 08, 2015, 02:08:37 am

Title: issue for collateral with non BTS
Post by: alt on December 08, 2015, 02:08:37 am
I am testing for private MPA which  collateral with non BTS(bitCNY) now
some issue about this will post at this thread.

Title: Re: issue for collateral with non BTS
Post by: alt on December 08, 2015, 02:10:20 am
update_asset: can't update the asset without parameter core_exchange_rate, and core_exchange_rate must include  asset BTS,
infact the core_exchange_rate update here is useless, it's depend on feed price.
Code: [Select]
unlocked >>> get_asset BETA
get_asset BETA
{
  "id": "1.3.2",
  "symbol": "BETA",
  "precision": 4,
  "issuer": "1.2.17",
  "options": {
    "max_supply": "1000000000000000",
    "market_fee_percent": 0,
    "max_market_fee": "1000000000000000",
    "issuer_permissions": 511,
    "flags": 16,
    "core_exchange_rate": {
      "base": {
        "amount": 1,
        "asset_id": "1.3.2"
      },
      "quote": {
        "amount": 128,
        "asset_id": "1.3.1"
      }
    },
    "whitelist_authorities": [],
    "blacklist_authorities": [],
    "whitelist_markets": [],
    "blacklist_markets": [],
    "description": "",
    "extensions": []
  },
  "dynamic_asset_data_id": "2.3.2",
  "bitasset_data_id": "2.4.1"
}
unlocked >>> update_asset BETA null {"flags": 0, "issuer_permissions": 511, "core_exchange_rate": {"base": {"amount": 1,"asset_id": "1.3.2" }, "quote": { "amount": 128$ "asset_id": "1.3.1" }}}  true
update_asset BETA null {"flags": 0, "issuer_permissions": 511, "core_exchange_rate": {"base": {"amount": 1,"asset_id": "1.3.2" }, "quote": { "amount": 128, "asset_id": "1.3.1" }}}  true
10 assert_exception: Assert Exception
core_exchange_rate.base.asset_id.instance.value == 0 || core_exchange_rate.quote.asset_id.instance.value == 0:
    {}
    th_a  asset_ops.cpp:216 validate

    {"symbol":"BETA","new_issuer":null,"new_options":{"max_supply":"1000000000000000","market_fee_percent":0,"max_market_fee":"1000000000000000","issuer_permissions":51
1,"flags":0,"core_exchange_rate":{"base":{"amount":1,"asset_id":"1.3.2"},"quote":{"amount":128,"asset_id":"1.3.1"}},"whitelist_authorities":[],"blacklist_authorities":[
],"whitelist_markets":[],"blacklist_markets":[],"description":"","extensions":[]},"broadcast":true}
    th_a  wallet.cpp:1107 update_asset
Title: Re: issue for collateral with non BTS
Post by: alt on December 08, 2015, 02:16:11 am
GUI is totally incorrect for mpa collateral with non BTS, include page balance, borrow, market , fee calculate(transfer/trade)...
Title: Re: issue for collateral with non BTS
Post by: alt on December 08, 2015, 03:50:37 am
"max_supply" not work
this issue is for all MPA, even can set this parameter to 1, the limit for supply didn't work
Title: Re: issue for collateral with non BTS
Post by: xeroc on December 08, 2015, 07:34:56 am
update_asset: can't update the asset without parameter core_exchange_rate, and core_exchange_rate must include  asset BTS,
infact the core_exchange_rate update here is useless, it's depend on feed price.
transactions fees have to be paid in BTS .. independent of what the assets is.
The core exchange rate describes the price at which people can trade their asset to BTS from the asset's fee pool automatically on tranfers .. hence people can pay the fee in BETA (unless the pool is empty)

GUI is totally incorrect for mpa collateral with non BTS, include page balance, borrow, market , fee calculate(transfer/trade)...
Yhea .. thought that would happen. The webdevs may not have known about the possibility at all .. though I think this can be fixed

"max_supply" not work
this issue is for all MPA, even can set this parameter to 1, the limit for supply didn't work
Ui .. interesting .. @bytemaster?
Title: Re: issue for collateral with non BTS
Post by: svk on December 08, 2015, 08:34:35 am
The GUI assumes all collateral is in BTS for now, but should be easy to update that.
Title: Re: issue for collateral with non BTS
Post by: alt on December 10, 2015, 05:37:13 am
The GUI assumes all collateral is in BTS for now, but should be easy to update that.
can you put this in your plan?
I want to create a smart coin collateral with non BTS
Title: Re: issue for collateral with non BTS
Post by: alt on December 12, 2015, 01:45:34 pm
I have a question
if fee pools for each asset is fund by BTS
then core_exchange_rate should always be a price for exchange between this asset and BTS right?

if this is correct, there is a problem, I can't publish asset feed's core_exchange_rate with price for BTS
Code: [Select]
unlocked >>> publish_asset_feed nathan BETA {"settlement_price":{"quote":{"amount":128,"asset_id":"1.3.1"},"base":{"amount":1,"asset_id":"1.3.2"}}, "core_exchange_rate":{"quote":{"amount":5000,"asset_id":"1.3.0"},"base":{"amount":1,"asset_id":"1.3.2"}}, "maintenance_collateral_ratio": 1001, "maximum_short_squeeze_ratio": 1001} true
publish_asset_feed nathan BETA {"settlement_price":{"quote":{"amount":128,"asset_id":"1.3.1"},"base":{"amount":1,"asset_id":"1.3.2"}}, "core_exchange_rate":{"quote":{"amount":5000,"asset_id":"1.3.0"},"base":{"amount":1,"asset_id":"1.3.2"}}, "maintenance_collateral_ratio": 1001, "maximum_short_squeeze_ratio": 1001} true
10 assert_exception: Assert Exception
feed.settlement_price.quote.asset_id == feed.core_exchange_rate.quote.asset_id:
    {}
    th_a  asset_ops.cpp:142 validate

    {"publishing_account":"nathan","symbol":"BETA","feed":{"settlement_price":{"base":{"amount":1,"asset_id":"1.3.2"},"quote":{"amount":128,"asset_id":"1.3.1"}},"maintenance_collateral_ratio":1001,"maximum_short_squeeze_ratio":1001,"core_exchange_rate":{"base":{"amount":1,"asset_id":"1.3.2"},"quote":{"amount":5000,"asset_id":"1.3.0"}}},"broadcast":true}
    th_a  wallet.cpp:1219 publish_asset_feed
unlocked >>>
Title: Re: issue for collateral with non BTS
Post by: abit on December 15, 2015, 01:30:49 am
@alt: Good catch. I submitted an issue on Github for you which links to this thread: https://github.com/cryptonomex/graphene/issues/480
Title: Re: issue for collateral with non BTS
Post by: abit on December 15, 2015, 11:29:05 pm
I have a question
if fee pools for each asset is fund by BTS
then core_exchange_rate should always be a price for exchange between this asset and BTS right?

if this is correct, there is a problem, I can't publish asset feed's core_exchange_rate with price for BTS

@alt FYI the new release v2.0.151215 introduced a workaround for this issue. See https://github.com/bitshares/bitshares-2/releases/tag/v2.0.151215. Hopefully other issues will be fixed eventually.
Title: Re: issue for collateral with non BTS
Post by: alt on December 16, 2015, 12:10:07 am
I have a question
if fee pools for each asset is fund by BTS
then core_exchange_rate should always be a price for exchange between this asset and BTS right?

if this is correct, there is a problem, I can't publish asset feed's core_exchange_rate with price for BTS

@alt FYI the new release v2.0.151215 introduced a workaround for this issue. See https://github.com/bitshares/bitshares-2/releases/tag/v2.0.151215. Hopefully other issues will be fixed eventually.
thanks, this seems fixed this issue