SellingScripts

Untitled

Oct 20th, 2018
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. const baseBet = 100 // how many satoshis to bet initially
  2. const target = 1.1 // target multiplier
  3. const betMultiplier = 10 // what to multiply the bet size by when we lose a wager
  4.  
  5.  
  6. let lossCount = 0
  7. this.log(`Starting martingale with a base bet of ${baseBet} satoshis.`)
  8.  
  9. while (true) {
  10. // make the bet and wait for the result
  11. const { multiplier } = await this.bet(betSize(lossCount), target)
  12.  
  13. if (multiplier < target) { // loss
  14. lossCount++
  15. this.log(`Lost bet. Multiplying bet size by ${betMultiplier} for new bet size of ${betSize(lossCount)} satoshis.`)
  16. } else { // win
  17. lossCount = 0
  18. this.log(`Won bet. Setting bet size to ${baseBet} satoshis.`)
  19. }
  20. }
  21. if (basebet > 10000) {
  22. stop("3 losses");
  23. }
  24.  
  25. function betSize(lossCount) {
  26. const bet = baseBet * Math.pow(betMultiplier, lossCount)
  27. return Math.round(bet / 100) * 100
  28. }
Advertisement
Add Comment
Please, Sign In to add comment