BitShares Forum

Main => General Discussion => Topic started by: btsindex on April 09, 2018, 10:34:01 am

Title: S&P 500, Dow and other indexes as smart assets
Post by: btsindex on April 09, 2018, 10:34:01 am
We've created 3 new smart-assets: INDEXSPX (S&P 500), INDEXDJI (Dow Jones Industrial Average), INDEXNASDAQ with a precision of 8, paired them with BTS.
The script that gets latest index values, calculates price and pushes it to the blockchain is ready. Two separate 24/7 working servers are also ready to run the script. 
The question is how to do everything right? Should we convert the indexes to BTS price according to BTS/USD rate or just push the index value?

For example: Dow is 23,932.76 at the moment. Should we push 23,932 BTS or 23,932 / 0.144462 (USD/BTS rate)

Any other recommendations until its not too late?

Thanks!  :)
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: sschiessl on April 09, 2018, 11:36:50 am
Hello btsindex,

who is we in that case? Please consider the permission discussion in https://bitsharestalk.org/index.php?topic=26068.0.
Also, the price should reflect actual FIAT price of the asset.

Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: zapata42 on April 09, 2018, 01:54:02 pm
We've created 3 new smart-assets: INDEXSPX (S&P 500), INDEXDJI (Dow Jones Industrial Average), INDEXNASDAQ with a precision of 8, paired them with BTS.
The script that gets latest index values, calculates price and pushes it to the blockchain is ready. Two separate 24/7 working servers are also ready to run the script. 
The question is how to do everything right? Should we convert the indexes to BTS price according to BTS/USD rate or just push the index value?

For example: Dow is 23,932.76 at the moment. Should we push 23,932 BTS or 23,932 / 0.144462 (USD/BTS rate)


Both are valid.

It depends what do you intend to sell.. do you want to guaranty the Dow performance against USD or BTS.

Actually buyer expect to perform against USD. That's why BTWTY and SNPFH express it in USD (publish feed = index price / USD/BTS rate).

Note that you can use BitUSD as collateral, and publish the index price unchanged.

Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: pc on April 09, 2018, 07:19:59 pm
We've created 3 new smart-assets: INDEXSPX (S&P 500), INDEXDJI (Dow Jones Industrial Average), INDEXNASDAQ with a precision of 8, paired them with BTS.

Should we push 23,932 BTS or 23,932 / 0.144462 (USD/BTS rate)

Since you have paired them with BTS you *should* calculate and publish the index price in BTS, i. e. 23,932 / 0.144462 .
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: btsindex on April 10, 2018, 09:26:20 am
Thank you! It seems that pushing a price feed reflecting a USD value in BTS is a good idea.
Assets permissions is also important topic. Thanks!
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: btsindex on April 10, 2018, 12:51:22 pm
More general question - can we trust feed-producers we don't know? https://bitsharestalk.org/index.php?topic=26273.0 (https://bitsharestalk.org/index.php?topic=26273.0)
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: akledirs on February 12, 2019, 03:58:23 pm
btsindex, you give wrong price on INDEXSPX. Diff>20%. Error - you use bitUSD price in your feed.
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: akledirs on February 20, 2019, 07:56:47 am
Anybody know contacts bts-index? He stopped feedprice 15 feb 2019.
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: sschiessl on February 20, 2019, 08:22:52 am
In here is probably the best way
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: btsindex on February 20, 2019, 09:46:54 am
Sorry, there are multiple problems with the server script. Cli-wallet stopped working on Feb 15 (500 error). Because of frequent restarts by process manager, API that provides indexes prices blocked me. I'll try to fix that when i have some free time (probably at the end of the week). I could push the latest price for INDEXSPX manually to make it possible to settle the asset. It's the only asset i own that survived during the black-swan period with some amount still borrowed.
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: btsindex on February 20, 2019, 09:46:31 pm
Fixed the cli_wallet error, got a new API key. Restarted following assets:
INDEXSPX
INDEXDJI (in global settlement)
CUBED.USD (in global settlement)
CUBED.CNY (in global settlement)

I still can't get the feed for INDEXNASDAQ. The API returns an empty object. I'll check tomorrow.
P.S. Sorry about that downtime. It seems that the script is quite unstable so use the assets at your own risk.
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: akledirs on February 21, 2019, 07:30:38 am
Why you give price indexspx ~54500 bts if current price S&P=2792$, BTS= 0.0452$ and S&P=2792/0.0452=61769 BTS ? >13% different
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: btsindex on February 21, 2019, 08:44:33 am
Thanks, akledirs. You're right. That's because of the bitUSD global settlement. The script gets the BTS/USD price from the blockchain. And it doesn't make sense anymore. I'll probably update it later to get the price from the outside. That can trigger the global settlement for INDEXSPX. If anyone knows how to contact babydragon, please warn them about that. That's the only borrower at the moment. Don't borrow the asset until that update!
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: akledirs on February 22, 2019, 10:10:55 am
Thanks, akledirs. You're right. That's because of the bitUSD global settlement. The script gets the BTS/USD price from the blockchain. And it doesn't make sense anymore. I'll probably update it later to get the price from the outside. That can trigger the global settlement for INDEXSPX. If anyone knows how to contact babydragon, please warn them about that. That's the only borrower at the moment. Don't borrow the asset until that update!
His ratio 3.75, blackswan will not happen. Simple changing - use pricefeed from bts/usd but not market price.
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: clockwork on February 22, 2019, 03:43:14 pm
Thanks, akledirs. You're right. That's because of the bitUSD global settlement. The script gets the BTS/USD price from the blockchain. And it doesn't make sense anymore. I'll probably update it later to get the price from the outside. That can trigger the global settlement for INDEXSPX. If anyone knows how to contact babydragon, please warn them about that. That's the only borrower at the moment. Don't borrow the asset until that update!

You can update it to take the feed price from the chain rather than market and/or settlement...should be less code work
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: pc on February 22, 2019, 05:49:01 pm
Simple changing - use pricefeed from bts/usd but not market price.

Keep in mind that feed price may not match actual bts valuation either, see BSIP-42 and BSIP-58.
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: akledirs on March 10, 2019, 11:32:44 am
When update? I want settle this on true price.
Title: Re: S&P 500, Dow and other indexes as smart assets
Post by: akledirs on June 24, 2019, 11:41:24 am
btsindex, please give feedprice and do force settle for all if not can give feeds constantly. I few months not can close position on S&P.