How enduserrr/bagbot works
Bagbot is a Bittensor alpha-staking bot. The principal workflow starts with the command-line entry point, which starts an asynchronous bot loop; the bot loads subnet and wallet settings, gathers blockchain stake and subnet data, displays a portfolio table, and makes buy/sell decisions that submit stake changes. The code also supports per-subnet trade limits and power-curve thresholds, validator discovery, and configurable display themes. The blockchain excerpt is partial, so the connection from its loop to trade execution is shown as unverified rather than asserted.
Main entry points: blockchain.py Bot loop · trade.py Trade rules · settings_loader.py Settings loader · bagbot.py CLI entry
Components 9
Configuration
- Settings loader
src/settings_loader.py - Bot settings
bagbot_settings.py
Trading
- Trade rules
src/trade.py
Portfolio display
- Portfolio table
src/printHelpers.py - Display themes
src/theme.py
Other components
- Operator
Connections 10
- Operator → CLI entry: starts
README.md - CLI entry → Bot loop: starts loop
bagbot.py - Settings loader → Bot settings: reads settings
src/settings_loader.py - Bot loop → Settings loader: uses settings
src/blockchain.py - Bot loop → Bittensor network: queries chain
src/blockchain.py - Bot loop → Portfolio table: prints portfolio
src/blockchain.py - Portfolio table → Display themes: gets theme
src/printHelpers.py - Trade rules → Settings loader: uses settings
src/trade.py - Bot loop → Trade rules: delegates trades
src/blockchain.py - Trade rules → Bittensor network: submits stake changes
src/trade.py