Place bets programmatically
Last updated
Was this helpful?
Last updated
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:
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
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:
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: