In order to make testing easier for everyone, here are a few example CLI commands for creating a bitasset and generating a black swan. Also see
http://docs.bitshares.eu/api/wallet-api.html#asset-calls .
Issuer "crn" creates an asset with symbol "CLOSED.USD", 4 decimals and the given asset options (all permissions, override_authority flag, core exchange rate of .1 CLOSED.USD / 1 TEST) and bitasset options (1 hour pricefeed lifetime, 1 hour settlement delay, 50% maximum settlement ratio):
create_asset crn CLOSED.USD 4 {"issuer_permissions":511,"flags":4,"core_exchange_rate":{"base":{"amount":1000,"asset_id":"1.3.1"},"quote":{"amount":100000,"asset_id":"1.3.0"}}} {"feed_lifetime_sec":3600,"force_settlement_delay_sec":3600,"maximum_force_settlement_volume":5000} true
Show the new asset (note its ID, it is required for publishing feeds):
get_asset CLOSED.USD
Set the list of feed producers to the issuer account only (alternatively, set the witness_fed_asset or the committee_fed_asset flag):
update_asset_feed_producers CLOSED.USD ["crn"] true
Publish a feed price of .1 CLOSED.USD / .00001 TEST and a core exchange rate of .0001 CLOSED.USD / .01 TEST (you have to substitute the ID of your own asset in two places!).
Warning: with these settings someone can cheaply borrow CLOSED.USD and use them to empty the fee pool!
publish_asset_feed crn CLOSED.USD {"settlement_price":{"base":{"asset_id":"1.3.341","amount":1000},"quote":{"asset_id":"1.3.0","amount":1}},"maintenance_collateral_ratio":1750,"core_exchange_rate":{"base":{"amount":1,"asset_id":"1.3.341"},"quote":{"amount":1000,"asset_id":"1.3.0"}}} true
Account "crn" borrows 1000 CLOSED.USD from the blockchain, providing 0.2 TEST as collateral:
borrow_asset crn 1000 CLOSED.USD 0.2 true
Account "crn" settles 10 CLOSED.USD:
settle_asset crn 10 CLOSED.USD true
You have to wait for the settlement delay, i. e. 1 hour in the example, provided that there is a valid pricefeed at that time. If executed after a black swan, settlement happens immediately.
Account "crn" places a sell order of 10 CLOSED.USD for .01 TEST (no expiration, no fill-or-kill flag) on the market. The subsequent price feed update triggers the black swan (again, you have to substitute your asset ID twice):
sell_asset crn 10 CLOSED.USD .01 TEST 0 false true
publish_asset_feed crn CLOSED.USD {"settlement_price":{"base":{"asset_id":"1.3.341","amount":1000},"quote":{"asset_id":"1.3.0","amount":10}},"maintenance_collateral_ratio":1750,"core_exchange_rate":{"base":{"amount":1,"asset_id":"1.3.341"},"quote":{"amount":100,"asset_id":"1.3.0"}}} true
For the black swan it is required that the short position is margin called AND a sell order exists AND the short has insufficient collateral to cover the debt at the best sell price.