Bitcoin Forum
April 23, 2024, 12:56:49 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  

Warning: Moderators do not remove likely scams. You must use your own brain: caveat emptor. Watch out for Ponzi schemes. Do not invest more than you can afford to lose.

Pages: [1]
  Print  
Author Topic: [GLBSE] API Frontend to keep track of assets and returns.  (Read 1778 times)
Sp0tter (OP)
Sr. Member
****
Offline Offline

Activity: 285
Merit: 250


View Profile
June 26, 2012, 02:18:48 AM
Last edit: July 03, 2012, 06:38:43 PM by Sp0tter
 #1

I created a front-end script to access the GLBSE  api and display helpful information about assets and return on investments.  I hope you find it useful.  

Please report any bugs or feature requests here.



md5sum
source488b8027b4b7287cb2f9e262bb9464b9
assets_2012-07-03_1341340694.tar.gz



Instructions
1. Extract to a public html folder.
2. Edit the sample_key file and move it to a non-public folder.
3. Edit $key_file in assets.php to point to the key file.
4. Download/Copy your account_history.csv from GLBSE to the same folder as assets.php.  Update this file when you trade assets or receive dividends.  (Currently there is not a simple way through the private API to check dividends, therefore you must fetch the csv manually.  I have contacted support and it is on their todo list.)

If you do not have a web server set up, you can just run 'php assets.php > assets.html' in linux and then point your web browser to the html file.

Known Issues
1. Warning / Notice output will display if your web server is set to display all of these.  Will fix these.
2.  Currently per/share dividends are only reported correctly for assets which are paid weekly.  (This does not affect cumulative dividends, but only the return on investment estimates).
3.  Occasionally there will be a timeout because of how slowly glbse.com responds.

Please post feedback here or talk to me in #btcguild on irc.

Warning... use at your own risk... (it can't be riskier than 7% interest bonds though right?)  Please check the script and make sure there is nothing shady in there before using.  I do my best to test everything, but will not be responsible for any losses due to the use of this script.

http://allchains.info - First to provide difficulty estimates for forks.
1713877009
Hero Member
*
Offline Offline

Posts: 1713877009

View Profile Personal Message (Offline)

Ignore
1713877009
Reply with quote  #2

1713877009
Report to moderator
1713877009
Hero Member
*
Offline Offline

Posts: 1713877009

View Profile Personal Message (Offline)

Ignore
1713877009
Reply with quote  #2

1713877009
Report to moderator
1713877009
Hero Member
*
Offline Offline

Posts: 1713877009

View Profile Personal Message (Offline)

Ignore
1713877009
Reply with quote  #2

1713877009
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713877009
Hero Member
*
Offline Offline

Posts: 1713877009

View Profile Personal Message (Offline)

Ignore
1713877009
Reply with quote  #2

1713877009
Report to moderator
1713877009
Hero Member
*
Offline Offline

Posts: 1713877009

View Profile Personal Message (Offline)

Ignore
1713877009
Reply with quote  #2

1713877009
Report to moderator
Sp0tter (OP)
Sr. Member
****
Offline Offline

Activity: 285
Merit: 250


View Profile
June 26, 2012, 02:20:26 AM
 #2

reserved

http://allchains.info - First to provide difficulty estimates for forks.
exahash
Sr. Member
****
Offline Offline

Activity: 278
Merit: 250



View Profile
June 26, 2012, 03:05:02 AM
 #3

Thanks Sp0tter!  I made a cl script to do some of this, I like yours better tho.

I see you're doubling the div/day of YABMC... can you instead grab the last two dividends and divide by the actual number of days between them?  I suspect there may be more tickers with irregular (or non-weekly) dividends, such that always dividing by 7 and having to special-case them could be too much work.

FWIW - I see nothing shady in there. :-)
Sp0tter (OP)
Sr. Member
****
Offline Offline

Activity: 285
Merit: 250


View Profile
June 26, 2012, 03:14:33 AM
Last edit: June 26, 2012, 04:02:05 AM by Sp0tter
 #4

Thanks Sp0tter!  I made a cl script to do some of this, I like yours better tho.

I see you're doubling the div/day of YABMC... can you instead grab the last two dividends and divide by the actual number of days between them?  I suspect there may be more tickers with irregular (or non-weekly) dividends, such that always dividing by 7 and having to special-case them could be too much work.

FWIW - I see nothing shady in there. :-)


I have devoted attention so far to the assets that I actually have.  I will try to cover as manay as possible as time goes on.

Eventually I plan to make a separate data file that lists each asset and describes it's type and payout scheme.  For the mh/s bonds, I will calculate the current PPS and use what it "should be" for the dividend estimation.

Thanks for checking over the script and verifying it for others.  This is my first time using php, I do most of my life in c++, and most of my scripting in perl...  it's not so bad... php makes me feel like a really smart ...11 year old boy.   I appreciate the feedback.    Smiley


http://allchains.info - First to provide difficulty estimates for forks.
Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
June 26, 2012, 07:21:09 AM
 #5

I'd love to see how much I've bought my shares for and for how much I already sold them + dividends gained - fees paid.

Also, why PHP in the first place?

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
Sp0tter (OP)
Sr. Member
****
Offline Offline

Activity: 285
Merit: 250


View Profile
June 26, 2012, 07:23:29 AM
Last edit: June 26, 2012, 07:48:09 AM by Sp0tter
 #6

I'd love to see how much I've bought my shares for and for how much I already sold them + dividends gained - fees paid.

Also, why PHP in the first place?

Just for shits and giggles.  I wanted to do some php....  I wanted reports on my GLBSE.. bam!


Edit:
The avg cost is the average cost that you paid.. and that is all bought - all sold / count.

http://allchains.info - First to provide difficulty estimates for forks.
Nachtwind
Hero Member
*****
Offline Offline

Activity: 700
Merit: 507



View Profile
June 26, 2012, 08:18:03 AM
 #7

Useful little script :0)

I think this will be something to keep an eye on!
zerokwel
Sr. Member
****
Offline Offline

Activity: 464
Merit: 250



View Profile
June 26, 2012, 02:51:22 PM
 #8

I do use it. Its nice for me to see how much I am making or loosing a week Smiley.

I am going to toss sp0tter a share for his work (now what do I have that's cheap)

Sp0tter (OP)
Sr. Member
****
Offline Offline

Activity: 285
Merit: 250


View Profile
June 27, 2012, 06:56:49 AM
 #9

The numbers for all weekly dividend assets and all summary items should be correct now.  Several bugs have been fixed.  This should be ready to go Smiley  Please report any bugs or feature requests here.

final = balance + total_sells + total_withdrawals - total_deposits - fees_to_sell

http://allchains.info - First to provide difficulty estimates for forks.
ianspain
Donator
Full Member
*
Offline Offline

Activity: 164
Merit: 100



View Profile
June 27, 2012, 07:45:41 PM
 #10

sub

BlockChain Capital
Sp0tter (OP)
Sr. Member
****
Offline Offline

Activity: 285
Merit: 250


View Profile
June 27, 2012, 10:25:08 PM
 #11

Update:  Moved all rounding to right before display so it does not affect other calcuations.  Cleaned up presentation.  Added 'price gap' column.

http://allchains.info - First to provide difficulty estimates for forks.
vokain
Legendary
*
Offline Offline

Activity: 1834
Merit: 1019



View Profile WWW
July 03, 2012, 03:30:15 PM
 #12

looks very useful! unfortunately i can't download the archive to test it out Sad
Sp0tter (OP)
Sr. Member
****
Offline Offline

Activity: 285
Merit: 250


View Profile
July 03, 2012, 06:39:13 PM
 #13

looks very useful! unfortunately i can't download the archive to test it out Sad

Sorry, my vps was down.   It is back up now with the newest version Smiley

http://allchains.info - First to provide difficulty estimates for forks.
Sp0tter (OP)
Sr. Member
****
Offline Offline

Activity: 285
Merit: 250


View Profile
August 29, 2012, 05:22:39 AM
 #14

Will resume improving this now that pirate is a bust Smiley

http://allchains.info - First to provide difficulty estimates for forks.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!