BitShares Forum

Main => General Discussion => Topic started by: kadawum on January 10, 2018, 06:07:41 pm

Title: Why is Current Supply not equal to the sum of all Margin Positions?
Post by: kadawum on January 10, 2018, 06:07:41 pm
I would like to get a better knowledge about the inner workings of SmartAssets.
On the BitUSD Asset Page it is listed with a "Current supply" of 28,558,281.0318 bitUSD.
But on the bottom of the page in the "Margin Positions" tab, the sum of all Debt ( BitUSD) is 19,849,062.7291 bitUSD.

I always assumed that the "Current Supply" should be exactly equal to the sum of all margin positions. Isn't bitUSD completely borrowed into existence? But then where is the excess supply of 8,709,218.3027 bitUSD coming from? I am wondering, if everyone would want to cash out, there would not be enough collateral BTS left at some point. Please, could someone help me understand where the additional bitUSD is created, if not by borrowing. Thank you very much.
Title: Re: Why is Current Supply not equal to the sum of all Margin Positions?
Post by: yvv on January 10, 2018, 06:20:24 pm
Link to page?
Title: Re: Why is Current Supply not equal to the sum of all Margin Positions?
Post by: kadawum on January 10, 2018, 06:29:40 pm
https://wallet.bitshares.org/#/asset/USD (https://wallet.bitshares.org/#/asset/USD)
Title: Re: Why is Current Supply not equal to the sum of all Margin Positions?
Post by: yvv on January 10, 2018, 06:53:20 pm
I don't see no sum of all debt at the bottom.
Title: Re: Why is Current Supply not equal to the sum of all Margin Positions?
Post by: kadawum on January 10, 2018, 07:09:16 pm
I copied the full table to a spreadsheet and calculated the sum of the Debt column. So the sum is not displayed there because I calculated it myself.
Title: Re: Why is Current Supply not equal to the sum of all Margin Positions?
Post by: zapata42 on January 11, 2018, 12:44:05 am
It seems that the UI only display the 300 earliest position to be called.

The request made by the UI is:
    {"method":"call","params":[2,"get_call_orders",["1.3.121",300]],"id":32}

The documentation of the API:
  http://docs.bitshares.org/api/database.html#_CPPv2NK8graphene3app12database_api15get_call_ordersE13asset_id_type8uint32_t

The code:
  https://github.com/bitshares/bitshares-ui/blob/master/app/components/Blockchain/Asset.jsx#L105


 
Title: Re: Why is Current Supply not equal to the sum of all Margin Positions?
Post by: kadawum on January 11, 2018, 01:19:20 am
Thank you for the explanation. Now I was able to confirm with the cli_wallet that the sum is matching to the current supply.