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

Was this helpful?

Export as PDF
  1. RogueBots

RogueBot mechanics

RogueBots are autonomous ERC-20 liquidity pool smart contracts deployed on Rogue Chain that bet 24/7 on the Rogue Index with ROGUE tokens provided by our players.

When you buy RogueBot tokens what you are actually doing is depositing ROGUE tokens into the RogueBot's smart contract on Rogue Chain which then mints liquidity pool (LP) tokens and sends them to your wallet. Your ROGUE deposit and subsequent receipt of LP tokens is done in a single, trustless transaction.

The number of LP tokens you receive is exactly proportional to the amount of ROGUE you deposit. If your ROGUE deposit equals 20% of the bot's betting balance then you will receive 20% of the entire supply of LP tokens.

The LP tokens that you receive are ERC-20 tokens on Rogue Chain and you hold the tokens in your own self-custodial wallet.

Below is the function in each RogueBot's smart contract that receives your ROGUE deposit and mints and sends your LP tokens in return:

function depositROGUE() external payable returns(bool) {
        require(msg.value > 0);
        uint256 amountROGUE = msg.value;
        uint256 supplyLPToken = balance.pool_token_supply;
        uint256 actualBalance = balance.actual_balance;
        // balanceROGUE does not include latest deposit from user but assumes all unsettled bets will win
        uint256 balanceROGUE = actualBalance + (balance.unsettled_bets * 2); 
        uint256 amountLPToken;
        if (supplyLPToken == 0) {
            amountLPToken = amountROGUE;
        } else {
            amountLPToken = (amountROGUE * supplyLPToken) / balanceROGUE;
        }

        _mint(msg.sender, amountLPToken);

        balance.actual_balance = address(this).balance;
        balance.pool_token_supply = this.totalSupply();
        balance.pool_token_price_bid = (balance.actual_balance * 1000000000000000000) / balance.pool_token_supply; // assumes all unsettled bets will lose
        balance.pool_token_price_ask = ((balance.actual_balance + (balance.unsettled_bets * 2)) * 1000000000000000000) / balance.pool_token_supply; // assumes all unsettled bets will win
        //add event
        emit ROGUELiquidityDeposit(msg.sender, amountROGUE, amountLPToken);
        return true;
    }

The RogueBot places bets 24/7 on the Rogue Index using its ROGUE betting balance. If it wins then its betting balance increases and so therefore does the value of your LP tokens that represent that balance. If it loses then its betting balance decreases and so therefore does the value of your LP tokens that represent that balance.

With zero house edge and zero fees on winnings, Rogue Index is the fairest game of chance in the world, meaning that RogueBots can produce spectacular gains when they go on a winning streak. And winning streaks happen all the time, producing triple and quadruple digit percentage gains in their token price.

You can withdraw some or all of your ROGUE from the RogueBot's betting balance at any time by selling your RogueBot tokens. When you sell RogueBot tokens what you are actually doing is sending them back to the RogueBot's smart contract where they are immediately burned and your proportional share of the current ROGUE betting balance is sent to your wallet. This is all done in a single, trustless transaction.

The amount of ROGUE that you receive will be the exact same proportion as the amount of LP tokens you send to the smart contract. For example, if you send RogueBot tokens equal to 20% of the total supply of LP tokens then you will receive 20% of the ROGUE that is currently held by the smart contract.

So if you deposited 1,000,000 ROGUE into a RogueBot and then it had a winning streak and its LP token price increased in value by 1,000%, you will receive 10,000,000 ROGUE when you send those LP tokens back to the RogueBot's smart contract.

Below is the function in each RogueBot's smart contract that burns your LP tokens and sends back your proportional share of the ROGUE betting balance to your wallet:

function withdrawROGUE(uint256 amount) external returns(bool) {
        require(amount > 0);
        uint256 amountLPToken = amount;
        uint256 supplyLPToken = this.totalSupply();
        uint256 balanceROGUE = address(this).balance; // assumes any outstanding unsettled bets will lose
        uint256 amountROGUE = (amountLPToken * balanceROGUE) / supplyLPToken;
        require(amountROGUE <= balanceROGUE, "Insufficient ROGUE balance to make withdrawal.");

        _burn(msg.sender, amountLPToken);
        
        (bool sent,) = payable(msg.sender).call{value: amountROGUE}("");
        if (sent) {
            balance.actual_balance = address(this).balance;
            balance.pool_token_supply = this.totalSupply();
            balance.pool_token_price_bid = (balance.actual_balance * 1000000000000000000) / balance.pool_token_supply; // assumes all unsettled bets will lose
            balance.pool_token_price_ask = ((balance.actual_balance + (balance.unsettled_bets * 2)) * 1000000000000000000) / balance.pool_token_supply; // assumes all unsettled bets will win
            emit ROGUELiquidityWithdrawal(msg.sender, amountROGUE, amountLPToken);
            return true;
        } else {
            balance.actual_balance = address(this).balance;
            balance.pool_token_supply = this.totalSupply();
            balance.pool_token_price_bid = (balance.actual_balance * 1000000000000000000) / balance.pool_token_supply; // assumes all unsettled bets will lose
            balance.pool_token_price_ask = ((balance.actual_balance + (balance.unsettled_bets * 2)) * 1000000000000000000) / balance.pool_token_supply; // assumes all unsettled bets will win
            emit ROGUELiquidityWithdrawalFailed(msg.sender, amountROGUE, amountLPToken);
            return false;
        }
    }
PreviousHigh volatility token tradingNextRogueBot token pricing

Last updated 14 days ago

Was this helpful?