Skip to content

About

πŸ† Winner, Opinion Builders Program (Phase 2 grant). Telegram bot for trading Opinion prediction markets.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Β 
Β 

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Winner of the Opinion Builders Program, Phase 2 grant

BidAsk Bot

BidAsk Bot is a Telegram interface for trading prediction markets on Opinion. The hosted bot is documented with floating limit orders that follow market prices, plus order and price notifications.

πŸ† Winner of the Opinion Builders Program, Phase 2 (grant): announcement on X

Links

What is in this repository

  • bot/main.py β€” an aiogram Telegram bot with wallet registration and a /make_market flow. It reads a market and its order book, collects the amount, YES/NO side and price offset, then asks for confirmation before placing a limit order.
  • simple_flow.py β€” an interactive command-line flow for checking market details, spread and liquidity, choosing a side and price offset, and placing a limit order.

Repository code and hosted bot

The public bot documentation describes additional hosted features, including floating orders and notifications. The source in this repository currently exposes /make_market and a one-time limit-order workflow; it may not match every command or feature available in the hosted bot. Use the documentation for the hosted bot's current instructions.

Run locally

Install the dependencies and create a local environment file:

git clone https://github.com/AstralEX1/opinion_trade_bot.git
cd opinion_trade_bot
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
cp .env.example .env

Edit .env locally. Do not commit it.

Variable Used by Purpose
BOT_TOKEN Telegram bot Telegram bot token.
MASTER_KEY Telegram bot A random 32-byte key encoded as 64 hexadecimal characters. It encrypts and decrypts saved user data.
RPC_URL Both BNB Chain RPC endpoint (the code uses chain ID 56).
ADMIN_TELEGRAM_ID Telegram bot, optional Telegram user ID for the admin database-export command.
API_KEY simple_flow.py Opinion API key.
PRIVATE_KEY simple_flow.py Wallet private key for the standalone order flow.
MULTI_SIG_ADDRESS simple_flow.py Wallet or multisig address used by the SDK.

simple_flow.py requires API_KEY, RPC_URL, PRIVATE_KEY and MULTI_SIG_ADDRESS. Add any missing values to your local .env; keep them out of source control.

Start the Telegram bot from the repository root:

python bot/main.py

Run the standalone order flow instead:

python simple_flow.py

Security and trading risks

The Telegram implementation asks users for a wallet address, private key and Opinion API key. It encrypts those values with AES-GCM and stores them in bot/users.db; the running process uses MASTER_KEY to decrypt them when needed. Anyone operating a hosted instance controls that runtime and must protect both the key and database. Review the code and trust the operator before sending wallet credentials to a bot.

Use a wallet dedicated to this bot, keep only the funds needed for trading, and verify each market and order before confirming. Prediction-market trading can lose funds; this project is not financial advice and does not guarantee returns.

About

πŸ† Winner, Opinion Builders Program (Phase 2 grant). Telegram bot for trading Opinion prediction markets.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages