How gschurck/tradoge works
Purpose and Runtime
TraDOGE is a Go-based automated Binance isolated-margin trading bot. It polls Elon Musk’s Twitter/X posts for configured DOGE keywords, buys DOGE using available leveraged quote-currency balance, then sells after a configured delay. Its executable entry point is tradoge.go; normal deployment is containerized through Dockerfile and docker-compose.yml.
Bootstrap and Configuration
Startup loads operator-supplied credentials and trading settings from YAML, based on the checked-in template. Configuration is the central boundary for Twitter authentication, Binance API access, quote currencies/pairs, keywords, polling interval, leverage-dependent buying behavior, and sell timing.
• tradoge.go
• internal/config/config_loading.go
• config/config.example.yaml
Persistent/runtime data is expected under data/, mounted or retained by the container deployment rather than committed.
Application Orchestration
The main process composes configuration, logging, Twitter monitoring, trading, heartbeat, and server-facing functionality. Shared domain structures provide the contract between tweet detection and order execution rather than exposing provider-specific objects across the application.
• tradoge.go
• internal/types/types.go
• internal/logger/logger.go
Twitter/X Detection Stage
The Twitter integration authenticates and searches/polls posts from Elon Musk using configured DOGE-related terms. A qualifying new tweet is the primary event that initiates trading. The README’s query behavior excludes replies; detection should be treated as an external-service boundary subject to credentials, API availability, and polling latency.
• internal/twitter/twitter.go
• internal/types/types.go
Trading Decision and Execution
The trading layer consumes detection events and applies the configured trading-pair and timing policy. Binance margin execution is isolated behind a Binance-specific implementation: it determines usable isolated-margin funds, places DOGE purchase orders, and later performs the sell action. This boundary carries the financial side effects and depends on Binance margin permissions, account balances, and leverage configured at Binance.
• internal/trading/trading.go
• internal/trading/binance_margin.go
• internal/types/types.go
Service/Operational Interfaces
A lightweight server component and heartbeat subsystem provide operational process functionality alongside the bot loop; their exact external surface is implemented internally. Logging is the primary observed status channel in Docker usage. CI builds/tests the Go project through GitHub Actions.
• internal/server/server.go
• internal/heartbeat/heartbeat.go
• .github/workflows/ci.yml
Infrastructure and External Dependencies
The production runtime is Docker Compose, with configuration and data supplied from host directories. Material external services are Twitter/X for tweet retrieval and Binance for authenticated isolated-margin trading. The host must provide Docker; users must provision Twitter credentials and Binance API keys with margin-trading access.
• docker-compose.yml
• Dockerfile
• config/config.example.yaml
Main entry points: tradoge.go TraDOGE process · docker-compose.yml Docker Compose · twitter.go Twitter monitor · trading.go Trading policy
Components 16
Bot Runtime
- TraDOGE process · Composes and runs the bot subsystems.
tradoge.go - Configuration loader · Loads credentials and trading policy.
internal/config/config_loading.go - Shared domain types · Carries detection and trading data between subsystems.
internal/types/types.go - Twitter monitor · Polls Elon Musk posts for configured DOGE keywords.
internal/twitter/twitter.go - Trading policy · Applies pair, buy, and delayed-sell policy to detections.
internal/trading/trading.go - Binance margin adapter · Uses isolated-margin funds and places buy and sell orders.
internal/trading/binance_margin.go - Heartbeat
internal/heartbeat/heartbeat.go - Server
internal/server/server.go - Logging · Primary observed status channel in Docker usage.
internal/logger/logger.go
External Services
- Twitter/X API · Authenticated post search and retrieval.
- Binance isolated margin · Requires margin permissions, balances, and API keys.
Deployment & CI
- Config template · Operator-supplied runtime settings.
config/config.example.yaml - Docker Compose · Supplies configuration and retains mounted runtime data.
docker-compose.yml - Container image
Dockerfile - Runtime data · Host-mounted or retained operational data.
- GitHub Actions CI · Builds and tests the Go project.
.github/workflows/ci.yml
Connections 17
- Config template → Configuration loader: defines settings
- Configuration loader → TraDOGE process: loads at startup
- TraDOGE process → Twitter monitor: starts polling
- TraDOGE process → Trading policy: starts trading flow
- TraDOGE process → Heartbeat: starts
- TraDOGE process → Server: starts
- TraDOGE process → Logging: emits status
- Twitter monitor → Twitter/X API: searches posts
- Twitter monitor → Shared domain types: produces detections
- Shared domain types → Trading policy: qualifying tweet
- Trading policy → Binance margin adapter: buy then delayed sell
- Binance margin adapter → Binance isolated margin: places margin orders
- Docker Compose → Container image: builds image
- Docker Compose → TraDOGE process: runs container
- Docker Compose → Config template: mounts configuration
- Docker Compose → Runtime data: retains data
- GitHub Actions CI → TraDOGE process: builds and tests