cryptonomex / graphene

MIT License
1.05k stars 337 forks source link

Bitasset data #672

Open GhazarArm opened 7 years ago

GhazarArm commented 7 years ago

I have created a new bit asset data, but can't use

xeroc commented 7 years ago

You'll need to be more precise if you want people to answer you request. Why can't you use it?

Also, the official bitshares repo is no bitshares/bitshares-core

GhazarArm commented 7 years ago

I use "create_asset" method and create market-issued asset. When I use "issue_asset" method for issue new shares of an asset, method returns me " .... 10 assert_exception: Assert Exception !a.is_market_issued(): Cannot manually issue a market-issued asset. .... "

Thanks for your feedback. Ghazar.

abitmore commented 7 years ago

@GhazarArm market-issued asset can only be issued by the market but not the owner. Firstly you need to set price feeds for the asset, then use the "borrow_asset" command to create new tokens. This is by design. For more info (e.g. how to use and etc), please discuss / ask in the forum.

GhazarArm commented 7 years ago

I use publish_asset_feed() method to set price feed for the asset.

" publish_asset_feed hayq MCORE {"settlement_price": {"quote": {"amount": 1000000, "asset_id": "1.3.0"}, "base": {"amount": 8563, "asset_id": "1.3.474"}}, "core_exchange_rate": {"quote": {"amount": 8563, "asset_id": "1.4.474"}, "base": {"amount": 1050000, "asset_id": "1.3.0"}}} true

" And get this error

" 10 assert_exception: Assert Exception fc::to_uint64( s.substr( 0, first_dot ) ) == SpaceID && fc::to_uint64( s.substr( first_dot+1, second_dot-first_dot-1 ) ) == TypeID: Space.Type.0 (1.3.0) doesn't match expected value 1.4.474 {"TypeID":3,"SpaceID":1,"var":"1.4.474"} th_a object_id.hpp:208 from_variant

{"var":"1.4.474"}
th_a  object_id.hpp:210 from_variant

"

How to set price feeds ?

xeroc commented 7 years ago

The asset id in quote in core_exchange_rate is wrong .. it should be 1.3.xxx not 1.4.xxx

GhazarArm commented 7 years ago

I tried it

publish_asset_feed hayq MCORE {"settlement_price": {"quote": {"amount": 1000000, "asset_id": "1.3.0"}, "base": {"amount": 8563, "asset_id": "1.3.474"}}, "core_exchange_rate": {"quote": {"amount": 8563, "asset_id": "1.3.574"}, "base": {"amount": 1050000, "asset_id": "1.3.0"}}} true

10 assert_exception: Assert Exception feed.settlement_price.base.asset_id == feed.core_exchange_rate.base.asset_id: {} th_a asset_ops.cpp:141 validate

{"publishing_account":"hayq","symbol":"MCORE","feed":{"settlement_price":{"base":{"amount":8563,"asset_id":"1.3.474"},"quote":{"amount":1000000,"asset_id":"1.3.0"}},"maintenance_collateral_ratio":1750,"maximum_short_squeeze_ratio":1500,"core_exchange_rate":{"base":{"amount":1050000,"asset_id":"1.3.0"},"quote":{"amount":8563,"asset_id":"1.3.574"}}},"broadcast":true}
th_a  wallet.cpp:1246 publish_asset_feed

I don't understand how to get price_feed in publish_asset_feed()?

xeroc commented 7 years ago

Either your asset id is 1.3.574 or 1.3.474 not both

GhazarArm commented 7 years ago

I put in borrow_asset account_name 3000 asset_name 300 true and get this error

... exception: unspecified 10 assert_exception: Assert Exception enable_black_swan: Black swan was detected during a margin update which is not allowed to trigger a blackswan {} th_a db_update.cpp:250 check_for_blackswan

{}
th_a  db_market.cpp:547 check_call_orders

... 0 exception: unspecified 10 assert_exception: Assert Exception enable_black_swan: Black swan was detected during a margin update which is not allowed to trigger a blackswan {} th_a db_update.cpp:250 check_for_blackswan

{}
th_a  db_market.cpp:547 check_call_orders

{"o":{"fee":{"amount":2000000,"asset_id":"1.3.0"},"funding_account":"1.2.18","delta_collateral":{"amount":30000000,"asset_id":"1.3.0"},"delta_debt":{"amount":30000,"asset_id":"1.3.4"},"extensions":[]}}
th_a  market_evaluator.cpp:275 do_apply

{}
th_a  evaluator.cpp:51 start_evaluate

{}
th_a  db_block.cpp:662 apply_operation

...

How to fix that?

xeroc commented 7 years ago

you need more collateral to borrow that asset!