Dcrticketbuyer -- New Tool For Automatic Ticket Purchase

Discussion in 'Proof-of-stake Mining' started by ceejep, May 3, 2016.

  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    #1 ceejep, May 3, 2016
    Last edited: Jun 3, 2016
    The old automatic ticket purchase function will be replaced soon by dcrtickeybuyer. This program is in alpha and will soon migrate to the main organization on github.com.

    In the meantime, it would be appreciated if people test it and give feedback. I would recommend testnet, so you can not lose any coins.

    https://github.com/decred/dcrticketbuyer

    To install:
    Code:
    go get -u -v github.com/decred/dcrticketbuyer
    cd $GOPATH/src/github.com/decred/dcrticketbuyer
    glide install
    go install
    dcrticketbuyer --help
     
    zero, Kandiru, Tivra and 2 others like this.
  2. root

    root Member

    Feb 3, 2016
    381
    76
    started on testnet, but :
    * noclienttls does not seem to be working, certificate required anyway
    * default values do not seem to be used, e.g. I had to specify dcrdserv
    * highpricepenality wrong spelling
    * waitfortickets is true by default, so how to set it to false ?
    and it is not buying tickets even after 20 blocks. Diff around 30, maxprice 37.
    No errors present in any log.
    I'll try to investigate ...
     
  3. Dyrk

    Dyrk Sr. Member
    Developer

    Jan 7, 2016
    518
    376
    Male
    Wonderland
    I didn't succeed too. Here is some output:

    Code:
    14:30:31 2016-05-04 [TRC] TKBY: Scaled fee is 0, but min fee is 0.01; using min
    14:30:31 2016-05-04 [TRC] RPCC: Sending command [setticketfee] with id 105
    14:30:31 2016-05-04 [TRC] RPCC: Received response for id 105 (result true)
    14:30:31 2016-05-04 [DBG] TKBY: Mean fee for the last blocks or window period was 0; this was scaled to 0.01
    14:30:31 2016-05-04 [TRC] TKBY: All tickets have been purchased, aborting further ticket purchases
    It says "All tickets have been purchased", but It didn't purchase any. Here is what I have in config file:
    testnet=true
    maxperblock=1
    txfee=0.00001
     
  4. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    Should be fixed, pull on master.

    Why it is not buying am not sure. Try to add '-d TKBY=trace' and see what gets print out.
     
  5. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    Do you have any more output? It may not have bought tickets because price was too high and exponential penalty said not to.
     
  6. root

    root Member

    Feb 3, 2016
    381
    76
    The reason of my previous problem may be here : https://forum.decred.org/threads/dd-9-v0-1-2-05-03-16.3576/#post-19504

    With the latest I get :
    (1) TKBY: Attempting to connect to dcrd RPC 127.0.0.1:19108
    is incorrect, I still have to use dcrdserv=localhost:19109
    (2) if balancetomaintain > actualBalance - numberOfTickets * ticketPrice; it refuses to buy even single one even if it still could

    other than that it seems to be buying tickets on testnet
     
  7. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    Thanks for testing. (1) is fixed, (2) I will look at today. Are there any other features you would like to see?
     
    root and Tivra like this.
  8. root

    root Member

    Feb 3, 2016
    381
    76
    I did go get -u -v ... and go build, but
    (1) still present
    (2) seems fine, purchased less than --maxperblock and stopped buying above balancetomaintain
    (3) waitfortickets is true by default, so how to set it to false ?

    great work, thanks !
     
  9. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    (1) Should be fixed.
    (3) Also fixed (is now --dontwaitfortickets).

    Many new features added today.
    Code:
          --minprice=           Attempt to prevent the stake difficulty from going
                                below this value by manipulation (default: 0.0 Coin)
          --feesource=          The fee source to use for ticket fee per KB (median or
                                mean, default: mean) (mean)
          --maxinmempool=       The maximum number of tickets allowed in mempool before
                                purchasing more tickets (default: 0)
    Of biggest important is minprice. Now you can set the software to automatically prevent the blockchain from going below some ticket difficulty if you have a enough money.

    New bug found that I am working on: If ticket address and pool address unset, setting expiry fails.
     
    chappjc and Tivra like this.
  10. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
  11. root

    root Member

    Feb 3, 2016
    381
    76
    That was a good one with minprice :)
    Thanks for updates, (1) seems fine, I'l check the rest hopefully soon
     
  12. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    Thanks. I am going to change maxprice to a new function and move old maxprice to "maxpriceabsolute" which does what that used to. New maxprice will prevent you from buying tickets if it drives the price too high based on estimates.

    Also will adjust how maxprice and minprice work to make them dynamic and based around the 'ideal' ticket price estimate, which is the (2880 block VWAP+ticket pool avg value)/2.
     
  13. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    OK, repository updated. maxprice and minprice have been replaced by maxpricescale and minpricescale.

    Please see the updated repo for more information about how they work. This should let most common users purchase tickets at the network average price while stabilizing the ticket price.
     
  14. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    Ticketbuyer has moved to the Decred org. Link has been updated.
     
    Tivra likes this.
  15. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    Adding a new graphic HTTP server interface so you can better see what the tool is doing. Will push soon.

    [​IMG]
     
    zero, Tivra, raedah and 4 others like this.
  16. dave

    dave New Member

    Jan 11, 2016
    27
    10
    This looks very cool....any plans for Windows version?
     
  17. root

    root Member

    Feb 3, 2016
    381
    76
    As @ceejep said it will give you "HTTP server interface", so you use a binary compiled for Windows with your favorite web browser.

    On the other hand I had a strange behaviour with
    --maxperblock=4
    I saw a lot of "All tickets have been purchased, aborting further ticket purchases". Even when some free funds were available.
    When restarted, dcrticketbuyer bought some more, but then again, some free funds, and no tickets bought.
    I have to check logs to get a better view on what happened.
    In the meantime I used --maxperblock=999 and --maxinmempool=4 and it worked fine, probably, but I have to double check ...

    Also https://docs.decred.org/mining/proof-of-stake/ points to the old cjepson repo.

    Thanks for great work !
     
  18. ceejep

    ceejep Sr. Member
    Developer

    Dec 14, 2015
    192
    220
    There is an exponential penalty applied when the price is above the average ticket price. Right now the average price is about 17 DCR. The software is intended to purchase tickets that trail the VWAP and average pool price of tickets over weeks or months. This is most useful for large stakers who are reinvesting constantly. If you wish to disable this, set highpricepenalty=1.0.
     
    Tivra likes this.
  19. root

    root Member

    Feb 3, 2016
    381
    76
    Looks really nice ! I am tempted to try on mainnet with real money ;)

    upload_2016-5-23_12-7-44.png
     
  20. root

    root Member

    Feb 3, 2016
    381
    76
    looking at "height" it seems like sometimes it is sorted left->right, sometimes right->left, sometimes numbers are not sorted at all.
    Observed on mainnet as well (ticket fees height is not sorted) :
    upload_2016-5-23_13-5-41.png
     
    Tivra likes this.

Share This Page