Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * purzi's Martingale bot V0.1
- */
- const baseBet = 200 // how many satoshis to bet initially
- const target = 2.75 // target multiplier
- const betMultiplier = 1.7 // what to multiply the bet size by when we lose a wager
- const maxBet = 200000 // Maximum bet in satoshis
- var bet
- let lossCount = 0
- this.log(`Starting martingale with a base bet of ${baseBet} satoshis.`)
- while (lossCount < 3)
- {
- // make the bet and wait for the result
- const { multiplier } = await this.bet(betSize(lossCount), betMultiplier)
- if (multiplier < target)
- { // loss
- if(bet >= maxBet)
- {
- lossCount = 0
- this.log(`Cut our losses and run!`)
- }
- else
- {
- lossCount++
- this.log(`Lost bet. Multiplying bet size by ${betMultiplier} for new bet size of ${betSize(lossCount)} satoshis.`)
- }
- }
- else
- { // win
- lossCount = 0
- this.log(`Won bet. Setting bet size to ${baseBet} satoshis.`)
- }
- }
- function betSize(lossCount)
- {
- bet = baseBet * Math.pow(betMultiplier, lossCount)
- return bet > maxBet ? maxBet : Math.round(bet / 100) * 100
- }
Advertisement
Add Comment
Please, Sign In to add comment