Guest User

Untitled

a guest
Aug 29th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. /**
  2. * purzi's Martingale bot V0.1
  3. */
  4.  
  5. const baseBet = 200 // how many satoshis to bet initially
  6. const target = 2.75 // target multiplier
  7. const betMultiplier = 1.7 // what to multiply the bet size by when we lose a wager
  8. const maxBet = 200000 // Maximum bet in satoshis
  9.  
  10. var bet
  11.  
  12. let lossCount = 0
  13.  
  14. this.log(`Starting martingale with a base bet of ${baseBet} satoshis.`)
  15.  
  16. while (lossCount < 3)
  17. {
  18. // make the bet and wait for the result
  19. const { multiplier } = await this.bet(betSize(lossCount), betMultiplier)
  20.  
  21. if (multiplier < target)
  22. { // loss
  23. if(bet >= maxBet)
  24. {
  25. lossCount = 0
  26. this.log(`Cut our losses and run!`)
  27. }
  28. else
  29. {
  30. lossCount++
  31. this.log(`Lost bet. Multiplying bet size by ${betMultiplier} for new bet size of ${betSize(lossCount)} satoshis.`)
  32. }
  33. }
  34. else
  35. { // win
  36. lossCount = 0
  37. this.log(`Won bet. Setting bet size to ${baseBet} satoshis.`)
  38. }
  39. }
  40.  
  41. function betSize(lossCount)
  42. {
  43. bet = baseBet * Math.pow(betMultiplier, lossCount)
  44.  
  45. return bet > maxBet ? maxBet : Math.round(bet / 100) * 100
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment