Rogue Docs
  • Rogue Protocol
    • Introduction
  • Rogue Trader
    • Rogue Trader pages
      • Home page
      • Connect wallet page
      • Rogue Index page
      • RogueBot page
      • ROGUE bankroll page
      • High Rollers NFTs page
      • My account page
      • Deposit page
      • Withdraw page
    • Self-custodial & trustless
    • No KYC or geo-blocking
  • Rogue Index
    • Overview
    • Zero house edge betting
    • Binary options reimagined
    • How to play
    • Price update mechanism
    • Bet lifecycle
    • Provably-fair price updates
    • Leaderboard
    • Smart contracts
    • Place bets programmatically
  • RogueBots
    • High volatility token trading
    • RogueBot mechanics
    • RogueBot token pricing
    • RogueBot token page
    • RogueBot trading tools
    • RogueBots list
    • RogueBot 7 day lifespan
    • RogueBot smart contracts
    • Trade tokens programatically
  • ROGUE Bankroll
    • Adding liquidity to bankroll
    • Removing liquidity from bankroll
    • Pool token price calculation
    • Bankroll mechanics
    • Bankroll smart contract
    • Why does the house win?
  • ROGUE Token
    • Native gas token
    • Zero-fee betting token
    • Supply & distribution
    • Public token sale
    • ROGUE information
    • ROGUE bridge
    • Buy ROGUE
    • Earn ROGUE
  • Rogue Chain
    • Arbitrum Orbit AnyTrust
    • Instant time-to-finality
    • Ultra-low gas fees
    • Chain information
    • Block explorer
  • Rogue NFTs
    • Revenue sharing NFTs
    • NFT pricing & availability
    • Get ETH on Arbitrum
    • RHRC smart contracts
    • RHRC information
Powered by GitBook
On this page
  • Send Bet Transactions Directly To The Rogue Index Smart Contract
  • Step 1: Build a Node App That Listens To Events Emitted From Rogue Index Smart Contract
  • Step 2: Build a Node App That Sends Bet Transactions To The Rogue Index Smart Contract

Was this helpful?

Export as PDF
  1. Rogue Index

Place bets programmatically

PreviousSmart contractsNextRogueBots

Last updated 18 days ago

Was this helpful?

The Rogue betting protocol is a fully on-chain and decentralized system of smart contracts. Therefore, anything that you can do on the Rogue Trader GUI you can also do programmatically. You can completely bypass using the website UI and instead build your own betting bots that follow whatever betting strategies and algorithms you can devise.

With zero house edge, zero fees on winnings, ultra-low gas fees and a maximum bet size of $50,000, Rogue is the only gambling platform in the world where high volume/low margin betting strategies are viable and potentially massively profitable.

Building your own bot that follows your betting strategy 24/7 without ever getting tired or deviating from the plan or getting emotional about the results is relatively simple and requires only basic coding knowledge. Here's how to do it:

Send Bet Transactions Directly To The Rogue Index Smart Contract

To send bet transactions directly to the smart contract you will use the open source software ethers.js and Rogue Chain's public RPC endpoint.

  • Ethers.js documentation:

  • Rogue Chain RPC: https://rpc.roguechain.io/rpc

  • Rogue Chain Websockets RPC: wss://rpc.roguechain.io/ws

Step 1: Build a Node App That Listens To Events Emitted From Rogue Index Smart Contract

By listening to the events emitted by the smart contract, your app will know the current price of the Rogue Index. Specifically, you need to listen for the PriceUpdated event so you can feed it into your bot's logic for choosing when to bet and with how much and in what direction and for what bet duration.

Here's a simple node app that listens to the PriceUpdated event in the Rogue Index smart contract:

Step 2: Build a Node App That Sends Bet Transactions To The Rogue Index Smart Contract

When your app decides to place a bet it must call the placeBet function on the smart contract. Here's an example node app that calls that function and returns the bet placement confirmation:

https://docs.ethers.org/v5/