How jacobryu/crypto-tracker-trader works
Crypto Tracker Trader is a Go API for managing crypto assets across wallets, exchanges, and DeFi, with price tracking and portfolio views. The main user workflow is authenticated API requests that reach domain services and stores; scheduled services also refresh prices and exchange/DeFi data. Portfolio aggregation combines wallet, exchange, DeFi, and price data. The README documents PostgreSQL-backed portfolio history and Ethereum balance fetching. Some source was not sampled, so uncertain integration links are omitted.
Main entry points: handler.go HTTP handlers · portfolio_aggregation_service.go Portfolio aggregation · price_service.go Price tracking · blockchain_data_fetcher_service.go ETH balance fetch
Components 21
API and identity
- HTTP handlers
internal/api/handler.go - JWT auth
internal/auth/jwt.go
Asset services
- User accounts
internal/service/user_service.go - Wallet management
internal/service/wallet_service.go - ETH balance fetch
internal/service/blockchain_data_fetcher_service.go - Exchange balances
internal/service/exchange_service.go - DeFi sync
internal/service/defi_sync_service.go - Price tracking
internal/service/price_service.go - Portfolio aggregation
internal/service/portfolio_aggregation_service.go - Portfolio history
internal/service/portfolio_service.go
External integrations
- Ethereum node
- Binance client
internal/client/exchange/binance/client.go - Uniswap client
internal/client/defi/uniswap/client.go - CoinGecko client
internal/client/coingecko/client.go - Kafka events
internal/event/kafka.go
Persistence
- Portfolio store
internal/store/portfolio_store.go - Wallet store
internal/store/wallet_store.go - Exchange store
internal/store/exchange_store.go - DeFi store
internal/store/defi_store.go - Price store
internal/store/price_store.go
Other components
- API user
Connections 21
- API user → HTTP handlers: requests
README.md - HTTP handlers → JWT auth: authenticates
internal/api/handler.go - HTTP handlers → User accounts: registers users
internal/api/handler.go - HTTP handlers → ETH balance fetch: fetches ETH
internal/api/handler.go - HTTP handlers → Exchange balances: manages balances
- HTTP handlers → Wallet management: manages wallets
- HTTP handlers → Portfolio history: requests history
README.md - HTTP handlers → Portfolio aggregation: requests summary
- ETH balance fetch → Ethereum node: reads balances
- Exchange balances → Binance client: fetches balances
- DeFi sync → Uniswap client: fetches positions
- Price tracking → CoinGecko client: fetches prices
- Price tracking → Kafka events: publishes events
internal/service/price_service.go - Exchange balances → Exchange store: reads and writes
internal/service/exchange_service.go - Price tracking → Price store: persists prices
internal/service/price_service.go - Portfolio aggregation → Wallet store: reads assets
internal/service/portfolio_aggregation_service.go - Portfolio aggregation → Exchange store: reads balances
internal/service/portfolio_aggregation_service.go - Portfolio aggregation → DeFi store: reads positions
- Portfolio aggregation → Price store: reads prices
internal/service/portfolio_aggregation_service.go - Portfolio history → Portfolio store: loads history
- ETH balance fetch → Portfolio store: saves balance