Pages:
Author

Topic: GBLSE assets data spreadsheet (Read 4749 times)

hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
July 05, 2012, 08:46:38 PM
#47
Again, added 11 more assets to the list. They will be up to date in a few minutes.
hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
June 22, 2012, 05:43:23 PM
#46
More assets added.  Grin
hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
June 09, 2012, 08:58:57 AM
#45
Updated the OP with more links to different formats (HTML,PDF,CSV,TSV).  Wink
Use the CSV to import to Excel and do shorting by any column etc...
hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
June 05, 2012, 08:45:17 AM
#44
Now it also gets the days between dividents automatically and uses the API to get everything.

BTW a little tip about the colors in the spreadsheet. They are mostly useful for me. Blue means that they are updated by the script in the background. Yellow are cells with formulas. And green are cells updated manually by me when needed.

I also added some more assets.
hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
June 05, 2012, 07:45:20 AM
#43
Added market capitalization. Which is (last price)*(securities issued). Is that correct?



It is not correct. As number of securities you can use the number of shares for which dividend was paid last time, but as a lot of assets didn't pay any dividend yet and also some of them are bought back on a monthly basis (PPT bonds) just after dividend payment, you have no way to find out exact number of shares outstanding on the market until GLBSE will show this number or issuers of those assets will tell you (if you want to update those numbers manually)

You can check the thread I started here: https://bitcointalksearch.org/topic/market-capitalization-of-top-20-most-traded-glbse-assets-84399

I've hid the column for now. I'll consider putting it back in the future. Maybe I'll only do it for those that pay dividents since I can get that data automatically.
hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
June 05, 2012, 07:42:08 AM
#42
So I was fooling around and made this: http://snipurl.com/glbsedata

Interesting, thank you. Please update that we pay dividends every 30 days, and that we are ID verified on the GLBSE. Thanks!

Done and done. You broke up your last divident payment into three payments though so it is a bit messed up. If you pay in a single payment next month it will be fine. But the code currently just picks the last payment and uses that alone.
sr. member
Activity: 389
Merit: 250
June 04, 2012, 02:45:12 PM
#41
This is what I've been using, hopefully it helps some
Code:
//Shrink an array down to at most 3 elements
//Helper function
function get3(info) {
//If you want more or less payouts, change this 3
  while(info.length > 3)
    info.shift();
  return info;
}

//Fetches asset info based on ticker
function getInfo(ticker) {
  return glbseCachedFetch("/api/asset/" + ticker);
}

//Fetches dividend info based on ticker
function getDiv(ticker) {
  return glbseCachedFetch("/api/dividends/asset/" + ticker);
}

//Fetches the price of an asset
//Returns first non-zero price from the list of 24h average, 5 day average, 7 day average, or last trade
function getPrice(ticker) {
  var info = getInfo(ticker);
  return (info.t24havg/100000000) || (info.t5davg/100000000) || (info.t7davg/100000000) || (info.latest_trade/100000000);
}

//Gets the average dividend from passed in array
function getDivArray(info) {
  Logger.log("Into getDivArray");
  if(info === null) return null;
  if(info.length == 0) return 0;
  Logger.log("Not null or zero length");
  var divTotal = 0;
  for(var i = 0; i < info.length; i++) {
    divTotal += info[i].pps;
    Logger.log("Step " + i + "/" + info.length + " " + String(divTotal));
  }
  Logger.log(String(divTotal));
  return divTotal / info.length / 100000000;
}
//Gets average dividend of all payouts
function getAvgDividend(ticker) {
  Logger.log("Into getAvgDividend " + ticker);
  var info = getDiv(ticker);
  Logger.log(info);
  Logger.log("Got Info");
  return getDivArray(info);
}
//Gets Average dividend of last 3 payouts
function get3AvgDividend(ticker) {
  var info = get3(getDiv(ticker));
  return getDivArray(info);
}

//Fetches info from GLBSE, caches when fetched and attempts to use the cache
//Caches info for 30 minutes
function glbseCachedFetch(apiUrl) {
  var publicCache = CacheService.getPublicCache();
  var cached = publicCache.get("http://glbse.com" + apiUrl);
  if(cached !== null && JSON.parse(cached).length > 1 ){
    return JSON.parse(cached);
  } else {
    getSleep();
    //Browser.msgBox("Fetching");
    Logger.log("Fetching");
    var response = UrlFetchApp.fetch("http://glbse.com"+apiUrl);
    //check for status code
    var result = response.getContentText();
    if(response.getResponseCode() < 300)//Only save if good fetch
      publicCache.put("http://glbse.com"+apiUrl, result, 60 * 30);//30 * 60 seconds - 30 minutes
    return JSON.parse(result);
  }
}

//Allows small delay between multiple fetches to lighten the load on GLBSE site
function getSleep() {
  var delay = 50;
  var date = new Date();
  var now = date.getTime();
  var cache = CacheService.getPublicCache();
  var cacheKey = "sleepUntil";
  var timeString = cache.get(cacheKey);
  var time = parseInt(timeString);
  var sleep = time - now;
 
  Logger.log(cacheKey + " " + timeString);
  Logger.log("parseInt " + time);
  Logger.log("sleeping " + sleep);
 
  if((timeString === null) || (timeString == "NaN") || (time === null) || (time == NaN) || (sleep < 0)) {
    cache.put(cacheKey, String(now + delay));
  } else {
    cache.put(cacheKey, String(time + delay));
    Utilities.sleep(sleep);
  }
}
//Days between payouts, based on all payouts
function daysBetween(ticker) {
  var info = getDiv(ticker);
  if(info === null) return null;
  if(info.length < 2) return Infinity;
  var first = info[0];
  var last = info.pop();
  return (last.timestamp - first.timestamp) / info.length / 3600 / 24;
}
//Days between payouts, based on the last 3 payouts
function daysBetween3(ticker) {
  var info = get3(getDiv(ticker));
  if(info === null) return null;
  if(info.length < 2) return Infinity;
  var first = info[0];
  var last = info.pop();
  return (last.timestamp - first.timestamp) / info.length / 3600 / 24;
}
These are the functions I'm using in my sheet, and while I'm not quite ready to show off the whole thing I hope this might be helpful to someone. I'm looking to get these published to the gallergy, but approval takes a while. These can be used regularly in a sheet as a docs formula or as a function on other scripts. These may be used as if under any license or as public domain where available.

Tips to 18ef54UQ3t9ieqU3MebyqMHjCpzKrZzS5N are greatly appreciated if you've got the spare coin and find these useful.
sr. member
Activity: 350
Merit: 257
Trust No One
June 02, 2012, 12:47:29 AM
#40
Added market capitalization. Which is (last price)*(securities issued). Is that correct?



It is not correct. As number of securities you can use the number of shares for which dividend was paid last time, but as a lot of assets didn't pay any dividend yet and also some of them are bought back on a monthly basis (PPT bonds) just after dividend payment, you have no way to find out exact number of shares outstanding on the market until GLBSE will show this number or issuers of those assets will tell you (if you want to update those numbers manually)

You can check the thread I started here: https://bitcointalksearch.org/topic/market-capitalization-of-top-20-most-traded-glbse-assets-84399
member
Activity: 64
Merit: 10
June 01, 2012, 09:14:21 PM
#39
to get dividends call:

/api/dividends/asset/ticker_symbol

for actively traded assets go to:


/api/market/assets

It's not mentioned on the info page.
hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
June 01, 2012, 04:11:33 PM
#38
I won't have proper Internet for two days.  I'll see if I can give more export formats when I get back.  Currently I parse the asset's page to see the dividents. That API would be helpful.
hero member
Activity: 784
Merit: 1000
0xFB0D8D1534241423
June 01, 2012, 03:37:45 PM
#37
Cool, I'll wait.
Thanks
legendary
Activity: 2618
Merit: 1007
June 01, 2012, 03:35:12 PM
#36
Dividends will hopefully soon be part of the official API, an inofficial version is already working (https://bitcointalksearch.org/topic/m.911270), the rest of your data is calculable from that and/or already available.
hero member
Activity: 784
Merit: 1000
0xFB0D8D1534241423
June 01, 2012, 03:12:34 PM
#35
Hmm... is there a way to export GLBSE in a nice parse-able format? I want to create a list of securities, sorted in descending order by
Code:
x = share_ask_price/average_dividend/average_time_between_dividends
Excluding Pirate bonds, I think that Tygrr-bond-B has the highest x value when calculated in that manner; am I right?

Edit: Going even further, I'd like to be able to create simple line graphs, which start at (-ask) and increase by the average payment period and the average dividend. This way, you could easily see how long it would take for a share of FOO.PPPPT to be more profitable than Tygrr-bond-P Cool

Edit2: Just checked, and Foo.PPPPT is now .11/share cheaper than before, and it's only .02 more expensive than Tygrr-bond-P
hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
May 31, 2012, 10:34:50 AM
#34
Changed the title.
Added BIB.PIRATE. It will fetch the divident automatically when it is first paid, I can't hardcode it into the spreadsheet.
Added market capitalization. Which is (last price)*(securities issued). Is that correct?

full member
Activity: 155
Merit: 100
May 31, 2012, 09:29:49 AM
#33
Can we have such useful summary threads sticked?
hero member
Activity: 518
Merit: 500
May 31, 2012, 09:23:17 AM
#32
Great resource!

Could you please add BIB.PIRATE. It's a BS&T pass-through that pays weekly dividends of 0.0675 per bond.

Also, I suggest you change the thread title, since your spreadsheet covers more than just mining companies.
hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
May 31, 2012, 09:17:23 AM
#31
Added 007. No idea how I missed that...
I didn't see anything wrong with PUREMINING. It's 1Mhash/s at 100% PPS (100%=1).
member
Activity: 75
Merit: 10
hero member
Activity: 640
Merit: 500
Vanity of vanities; all is vanity...
May 30, 2012, 08:20:59 PM
#29
No 007?  Wink

Does the puremining entry PPS need fixing?

What do you mean 007?

I'll check puremining tommorow when I'll be on my computer again. :-)
member
Activity: 75
Merit: 10
May 30, 2012, 08:14:46 PM
#28
No 007?  Wink

Does the puremining entry PPS need fixing?
Pages:
Jump to: