Create index assets in the Bitshares DEX

in #bitshares6 years ago

https://github.com/bitshares/bsips/blob/master/bsip-0037.md

The BSIP will allow to create index based asset names like SP500, NASDAQ100 and so on.

Bitshares-Core will support this new feature in the mainnet after the hardfork date of July, 19, 2018.

By the way, all bitshares nodes must upgrade before that date to the last release of the software.

In the testnet, hardfork date already passed so here is a cli_wallet session how to do this.

Create asset:

unlocked >>>create_asset oxarbitrage-test CRYPTO50 5  { "max_supply" : 10000, "market_fee_percent" : 1, "max_market_fee" : 100, "core_exchange_rate" : { "base": { "amount": 21, "asset_id": "1.3.0"},"quote": { "amount": 76399,"asset_id": "1.3.1"}},"whitelist_authorities" : [],"blacklist_authorities" : [],"whitelist_markets" : [],"blacklist_markets" : [],"description" : "Index asset name"} {} true
{
  "ref_block_num": 62341,
  "ref_block_prefix": 311549236,
  "expiration": "2018-06-13T14:38:48",
  "operations": [[
      10,{
        "fee": {
          "amount": 500000000,
          "asset_id": "1.3.0"
        },
        "issuer": "1.2.4136",
        "symbol": "CRYPTO50",
        "precision": 5,
        "common_options": {
          "max_supply": 10000,
          "market_fee_percent": 1,
          "max_market_fee": 100,
          "issuer_permissions": 79,
          "flags": 0,
          "core_exchange_rate": {
            "base": {
              "amount": 21,
              "asset_id": "1.3.0"
            },
            "quote": {
              "amount": 76399,
              "asset_id": "1.3.1"
            }
          },
          "whitelist_authorities": [],
          "blacklist_authorities": [],
          "whitelist_markets": [],
          "blacklist_markets": [],
          "description": "Index asset name",
          "extensions": []
        },
        "bitasset_opts": {
          "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": []
        },
        "is_prediction_market": false,
        "extensions": []
      }
    ]
  ],
  "extensions": [],
  "signatures": [
    "1f333fd802fff9f709897474065b54259325e93ee0e5cc1f9151740b7a24c89c146bdb542d19151853fdd3b2dbef0fd352afba4231990605736a1e936e8d5688ea"
  ]
}
unlocked >>>

Check created asset:


unlocked >>> get_asset CRYPTO50
get_asset CRYPTO50
{
  "id": "1.3.943",
  "symbol": "CRYPTO50",
  "precision": 5,
  "issuer": "1.2.4136",
  "options": {
    "max_supply": 10000,
    "market_fee_percent": 1,
    "max_market_fee": 100,
    "issuer_permissions": 79,
    "flags": 0,
    "core_exchange_rate": {
      "base": {
        "amount": 21,
        "asset_id": "1.3.0"
      },
      "quote": {
        "amount": 76399,
        "asset_id": "1.3.943"
      }
    },
    "whitelist_authorities": [],
    "blacklist_authorities": [],
    "whitelist_markets": [],
    "blacklist_markets": [],
    "description": "Index asset name",
    "extensions": []
  },
  "dynamic_asset_data_id": "2.3.943",
  "bitasset_data_id": "2.4.253"
}
unlocked >>>