Skip to content

axatbhardwaj/Betting-Agent

 
 

BetChain Learning Service

A decentralized autonomous service that manages betting games comparing token holder counts between Arbitrum and Base networks using Olas framework and Open Autonomy.

🎯 Overview

This agent service facilitates a decentralized betting game where:

  • Users can place bets on which chain has more token holders - Arbitrum or Base
  • Agent service automatically:
    • Fetches current holder counts from Blockscout APIs
    • Determines winners based on actual holder numbers
    • Calculates prizes proportional to holder count differences
    • Executes prize payments and bet resolution transactions using Safe multisig
  • BETCHAIN_CONTRACT_ADDRESS=0x8209b8E7C2585D3Ac6F7DfEE462b6f166B71e1bE

🏗️ Architecture

Key Components:

📋 Prerequisites

  • Python >=3.10
  • Tendermint ==0.34.19
  • IPFS node ==0.6.0
  • Poetry
  • Docker Engine & Docker Compose

🚀 Quick Start

Clone repository

git clone https://github.com/akshat-solulab/academy-learning-service.git
cd academy-learning-agent

Setup environment

poetry shell
poetry install
autonomy packages sync --update-packages

Generate keys

autonomy generate-key ethereum -n 4

⚙️ Configuration

  1. Setup environment:
cp sample.env .env
  1. Configure variables:
ALL_PARTICIPANTS=["0xB953...74"]
GNOSIS_LEDGER_RPC=https://...
TRANSFER_TARGET_ADDRESS=0x...
SAFE_CONTRACT_ADDRESS=0x...
SAFE_CONTRACT_ADDRESS_SINGLE=0x...
BETCHAIN_CONTRACT_ADDRESS=0x...

🏃 Running

Single Agent:

bash run_agent.sh

Full Service (4 Agents):

bash run_service.sh

Monitor logs:

docker logs -f learningservice_abci_0

📜 License

Apache License 2.0

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.4%
  • Makefile 1.9%
  • Shell 1.7%