Create a Bitshares MPA

MPA is a price stable asset in Bitshares, for more information you could refer to the official document MPA

Well the instruction of creating/using the MPA is scattered around the documentations, so I rearranged here to demonstrate a complete example.

Create the asset

The whole command line:

create_asset nathan CNY 5 { "max_supply": "1000000000000000", "market_fee_percent": 0, "max_market_fee": "1000000000000000", "issuer_permissions": 80, "flags": 0, "core_exchange_rate": { "base": { "amount": 10000, "asset_id": "1.3.0" }, "quote": { "amount": 80000, "asset_id": "1.3.1" } }, "whitelist_authorities": [], "blacklist_authorities": [], "whitelist_markets": [], "blacklist_markets": [], "description": "", "extensions": [] } { "feed_lifetime_sec": 86400, "minimum_feeds": 1, "force_settlement_delay_sec": 86400, "force_settlement_offset_percent": 0, "maximum_force_settlement_volume": 2000, "short_backing_asset": "1.3.0", "extensions": [] } true

The two options in the command line are:

{
  "max_supply": "1000000000000000",
  "market_fee_percent": 0,
  "max_market_fee": "1000000000000000",
  "issuer_permissions": 80,
  "flags": 0,
  "core_exchange_rate": {
    "base": {
      "amount": 10000,
      "asset_id": "1.3.0"
    },
    "quote": {
      "amount": 80000,
      "asset_id": "1.3.4"
    }
  },
  "whitelist_authorities": [],
  "blacklist_authorities": [],
  "whitelist_markets": [],
  "blacklist_markets": [],
  "description": "",
  "extensions": []
}
{
  "feed_lifetime_sec": 86400,
  "minimum_feeds": 1,
  "force_settlement_delay_sec": 86400,
  "force_settlement_offset_percent": 0,
  "maximum_force_settlement_volume": 2000,
  "short_backing_asset": "1.3.0",
  "extensions": []
}

Update feed producer

update_asset_feed_producers CNY [nathan] true

Put producer account in the bracket.

Publish Feed

publish_asset_feed nathan CNY { "settlement_price": { "base": { "amount": 10, "asset_id": "1.3.5" }, "quote": { "amount": 10, "asset_id": "1.3.0" } }, "maintenance_collateral_ratio": 1750, "maximum_short_squeeze_ratio": 1200, "core_exchange_rate": { "base": { "amount": 10, "asset_id": "1.3.5" }, "quote": { "amount": 10, "asset_id": "1.3.0" } } } true

The feed option is

  "settlement_price": {
    "base": {
      "amount": 10,
      "asset_id": "1.3.5"
    },
    "quote": {
      "amount": 10,
      "asset_id": "1.3.0"
    }
  },
  "maintenance_collateral_ratio": 1750,
  "maximum_short_squeeze_ratio": 1200,
  "core_exchange_rate": {
    "base": {
      "amount": 10,
      "asset_id": "1.3.5"
    },
    "quote": {
      "amount": 10,
      "asset_id": "1.3.0"
    }
  }
}

Make sure the asset_id equals to the one you created.

Borrow the asset

Now, you can borrow the MPA.

unlocked >>> list_account_balances nathan
list_account_balances nathan
9999468458 BTS

unlocked >>> borrow_asset nathan 10 CNY 20 true

unlocked >>> list_account_balances nathan
list_account_balances nathan
9999468418 BTS
10 CNY

Sounds we use 40 BTS for 10 CNY. A little expensive.

Return the asset

Then you can return the asset, but not sure whether we need to pay some fee?

unlocked >>> settle_asset nathan 10 CNY true

unlocked >>> list_account_balances nathan    
list_account_balances nathan
9999468218 BTS
0 CNY
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末涧狮,一起剝皮案震驚了整個(gè)濱河市炕矮,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌者冤,老刑警劉巖肤视,帶你破解...
    沈念sama閱讀 219,110評(píng)論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異譬嚣,居然都是意外死亡钢颂,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,443評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門拜银,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)殊鞭,“玉大人,你說我怎么就攤上這事尼桶〔俨樱” “怎么了?”我有些...
    開封第一講書人閱讀 165,474評(píng)論 0 356
  • 文/不壞的土叔 我叫張陵泵督,是天一觀的道長(zhǎng)趾盐。 經(jīng)常有香客問我,道長(zhǎng)小腊,這世上最難降的妖魔是什么救鲤? 我笑而不...
    開封第一講書人閱讀 58,881評(píng)論 1 295
  • 正文 為了忘掉前任,我火速辦了婚禮秩冈,結(jié)果婚禮上本缠,老公的妹妹穿的比我還像新娘。我一直安慰自己入问,他們只是感情好丹锹,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,902評(píng)論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著芬失,像睡著了一般楣黍。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上棱烂,一...
    開封第一講書人閱讀 51,698評(píng)論 1 305
  • 那天租漂,我揣著相機(jī)與錄音,去河邊找鬼。 笑死窜锯,一個(gè)胖子當(dāng)著我的面吹牛张肾,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播锚扎,決...
    沈念sama閱讀 40,418評(píng)論 3 419
  • 文/蒼蘭香墨 我猛地睜開眼吞瞪,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了驾孔?” 一聲冷哼從身側(cè)響起芍秆,我...
    開封第一講書人閱讀 39,332評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎翠勉,沒想到半個(gè)月后妖啥,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,796評(píng)論 1 316
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡对碌,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,968評(píng)論 3 337
  • 正文 我和宋清朗相戀三年荆虱,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片朽们。...
    茶點(diǎn)故事閱讀 40,110評(píng)論 1 351
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡怀读,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出骑脱,到底是詐尸還是另有隱情菜枷,我是刑警寧澤,帶...
    沈念sama閱讀 35,792評(píng)論 5 346
  • 正文 年R本政府宣布叁丧,位于F島的核電站啤誊,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏拥娄。R本人自食惡果不足惜蚊锹,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,455評(píng)論 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望稚瘾。 院中可真熱鬧枫耳,春花似錦、人聲如沸孟抗。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,003評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)凄硼。三九已至,卻和暖如春捷沸,著一層夾襖步出監(jiān)牢的瞬間摊沉,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,130評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工痒给, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留说墨,地道東北人骏全。 一個(gè)月前我還...
    沈念sama閱讀 48,348評(píng)論 3 373
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像尼斧,于是被迫代替她去往敵國(guó)和親姜贡。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,047評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,334評(píng)論 0 10
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 9,511評(píng)論 0 23
  • The Bill Management Tool is a complete and easy-to-use, h...
    1734喜歡閱讀 326評(píng)論 0 0
  • 很多人都想成一個(gè)好媽媽母怜,努力地讓孩子不犯錯(cuò)誤,成為一個(gè)完美的人缚柏。 媽媽們用所謂正確的觀念苹熏,來(lái)左右孩子的思想,讓孩子...
    鴻雁長(zhǎng)空閱讀 398評(píng)論 6 4
  • 如果將所有女人都看作紅粉骷髏美好總是這樣容易流逝其存在的價(jià)值在于什么币喧?男人總是需要一個(gè)女人來(lái)證明自己擁有一個(gè)完美的...
    RainyMorning閱讀 971評(píng)論 0 0