Skip to content

RoboBetBot v1.3.0

Latest

Choose a tag to compare

@yzRobo yzRobo released this 26 Aug 04:30
· 2 commits to main since this release

RoboBetBot v1.3.0

True Peer-to-Peer Betting System

This release implements proper stake calculation based on odds, fixing a fundamental economic flaw where both players wagered the same amount regardless of odds. Now favorites risk more to win less, while underdogs risk less to win more - ensuring the pot always balances.

What's New

Proper Peer-to-Peer Economics

Balanced Stake Calculation

  • Previous Issue: Both players always staked the same amount, creating phantom money for payouts
  • Solution: Stakes now vary based on odds to ensure pot equals winner's total return
  • Result: Mathematically sound betting where all money comes from participants

Stake vs Payout Display

  • Change: Bets now show "Stake" (what you risk) and "To Win" (potential profit) separately
  • Benefit: Clear understanding of risk vs reward before joining a bet
  • Example: Favorite might stake $75 to win $25, while underdog stakes $25 to win $75

How It Works

  • Underdog (higher odds): Stakes less money for bigger potential win
  • Favorite (lower odds): Stakes more money for smaller potential win
  • Winner: Gets the entire pot (their stake back + opponent's stake)
  • Loser: Loses only their stake amount

Example Scenarios

Even Odds (+100 both sides):

  • Both stake: $25
  • Both to win: $25
  • Total pot: $50

Typical Spread (-110 both sides):

  • Both stake: $27.50
  • Both to win: $25
  • Total pot: $55

Heavy Favorite (-300) vs Underdog (+250):

  • Favorite stakes: $75 to win $25
  • Underdog stakes: $25 to win $75
  • Total pot: $100

Migration Instructions

Fresh Install (Recommended)

# Stop bot and delete old database
rm bets.db
# Update to v1.3.0
git pull origin main
# Start fresh with proper stake system
npm start

Preserve Existing Bets

# Update to v1.3.0
git pull origin main
# Run migration script
node scripts/migrate-stakes.js
# Restart bot
npm start

Docker/Dockge Users

docker-compose down
git pull origin main
docker-compose build --no-cache
docker-compose up -d

Portable Users

Download v1.3.0 release and replace files (keep .env and optionally bets.db)

Important Changes

For Bet Creators

  • The "amount" parameter now represents the base amount to win, not the stake
  • Bot automatically calculates proper stakes based on odds
  • You'll see different stake amounts for each side when odds differ

For All Users

  • Stats now track actual money wagered (stakes), not base amounts
  • Bet history shows your actual stake for each bet
  • Leaderboard reflects true profit/loss based on stakes

Backward Compatibility

  • Existing bets continue to work
  • Database auto-calculates stakes for old bets if not migrated
  • No breaking changes to commands or interface

Technical Details

Database Changes

  • Added side_a_stake and side_b_stake columns to bets table
  • Automatic calculation for legacy bets without stake data
  • Migration script available for updating existing records

Files Modified

  • commands.js: New stake calculation logic and display updates
  • database.js: Support for stake columns with backward compatibility
  • scripts/migrate-stakes.js: New migration script for existing databases

Full Changelog: v1.2.1...v1.3.0