Skip to content

About

Personal investment intelligence platform. Aggregate data from multiple sources, track your portfolio, and make informed financial decisions.

Resources

Stars

8 stars

Watchers

1 watching

Forks

Repository files navigation

Greedy Eye logo

Greedy Eye

Personal investment intelligence platform. Aggregate data from multiple sources, track your portfolio, and make informed financial decisions.

Website: foxcool.github.io/greedy-eye — screenshots, what runs inside, and how to start your own instance.

Go Version License Status


What It Does

Aggregates everything you own — on-chain wallets, exchange accounts, broker positions, manually entered holdings — into one catalog, prices it, and shows what the total actually consists of.

Built as a personal, self-hosted system, and as a demonstration of production-shaped Go architecture for financial data.


Core Capabilities

Data Aggregation

  • On-chain balances across EVM chains, Substrate, TON, Solana, Bitcoin, Cosmos, Tezos and more — one WalletSyncer per ecosystem, routed by address shape
  • Exchange balances (Binance spot) via the account's own signed API key
  • Manual and LLM-assisted import of positions and transactions, with provenance
  • Prices from external providers on a budgeted schedule

Portfolio Truth

  • Multi-account position tracking with per-user ownership enforcement
  • Portfolio valuation that reports what it could not price (ValuationCoverage) instead of silently dropping those positions
  • Scam-filter verdicts on assets; flagged holdings are quarantined out of totals in the open, not subtracted quietly
  • Composite asset identity (symbol, market, type) plus contract-level identity, so a fake token cannot inherit a real ticker's price

Extensible Architecture

  • Adapter pattern for every external API; credentials live in the database, encrypted, resolved per account
  • Connect-RPC serves browser-friendly JSON and gRPC from one port
  • Modular monolith that can be split into services by configuration

Technology Stack

Backend:

  • Go 1.25+, Connect-RPC and Protocol Buffers (h2c on :8080)
  • PostgreSQL 17+ with pgx (raw SQL, no ORM)
  • Atlas declarative schema (schema.hcl)

Infrastructure:

  • Docker & Docker Compose; Traefik with psina forwardAuth in front
  • Testcontainers for integration tests
  • Structured logging (slog), Sentry

Integrations:

  • Prices: CoinGecko, Binance, CBR (FX), MOEX ISS, T-Invest
  • On-chain: Alchemy and Moralis (EVM), Subscan (Substrate), tonapi, Helius (Solana), Esplora (Bitcoin), Cosmos LCD, TzKT (Tezos), Blockchair
  • Notifications: Telegram
  • See docs/providers.md for what each one needs

Quick Start

Run your own instance

The whole stack (backend, frontend, auth, databases) from published images, on a machine with Docker, amd64 or arm64.

curl -O https://raw.githubusercontent.com/foxcool/greedy-eye/main/deploy/selfhost/compose.yaml
curl -o .env https://raw.githubusercontent.com/foxcool/greedy-eye/main/deploy/selfhost/env.example
# fill in the three secrets .env asks for, then:
docker compose up -d
# open http://eye.localhost:8080 and register

It answers on 127.0.0.1 only. Sign-up cannot be closed yet, so reach the instance from elsewhere through a VPN, not an open port: set EYE_BIND in .env to the host's VPN address (env.example lists what else to set). Wallets on TON, Bitcoin, Cosmos and Tezos sync with no API keys; see docs/providers.md for the rest. deploy/selfhost/compose.yaml explains each setting.

Develop

Prerequisites

  • Go 1.25+
  • Docker (for testcontainers and dev environment)
  • Atlas CLI (curl -sSf https://atlasgo.sh | sh)

Run Locally

# Clone and start
git clone https://github.com/foxcool/greedy-eye.git
cd greedy-eye

# Start dev environment
make up

# Server (Connect-RPC over h2c — REST + gRPC on one port):
# http://localhost:8080

Health Check

curl http://localhost:8080/eye/health

Run Tests

make test                    # All tests (unit + integration)
make test-unit               # Unit tests only
make test-integration        # Integration tests (uses testcontainers)

Project Structure

greedy-eye/
├── api/v1/                # Protobuf definitions + generated code
│   ├── marketdata.proto   # Assets, prices, valuation coverage
│   ├── portfolio.proto    # Portfolios, accounts, holdings, ledger, import
│   ├── automation.proto   # Rules + executions
│   ├── analytics.proto    # Heatmaps
│   └── apiv1connect/      # Generated Connect handlers and clients
├── cmd/eye/               # Binary: wiring, config, provider registration
├── internal/
│   ├── adapter/           # External API clients, one package per provider
│   │                      # + ratelimit/ (shared rate and quota budget per key)
│   ├── entity/            # Domain entities and provider interfaces
│   ├── middleware/        # User provisioning, ownership enforcement
│   ├── scamfilter/        # Asset identity scoring and verdicts
│   ├── scheduler/         # Cron: rule schedules + price sweep
│   ├── service/           # Connect handlers: marketdata, portfolio,
│   │                      # automation, analytics, credentials
│   └── store/postgres/    # pgx implementation + integration tests
├── schema.hcl             # Database schema (Atlas, declarative)
├── docs/                  # Architecture, development, providers
└── deploy/                # Dev compose; selfhost/ runs the whole stack from images

Documentation

  • Architecture Guide — System design, C4 diagrams, service structure
  • Development Guide — Setup, workflow, roadmap
  • API reference — the api/v1/*.proto files are the source of truth. Connect-RPC serves them as JSON and gRPC; there is no separate OpenAPI spec (Connect is not covered by the OpenAPI generator).

Development Status

Alpha, running in production by its author. One instance, one user, a real portfolio. The label is not modesty: the number the system reports is still being made trustworthy, and that is the current focus.

Done:

  • ✅ 5-service Connect-RPC monolith (MarketData, Portfolio, Automation, Analytics, Settings)
  • ✅ pgx raw SQL store; account credentials encrypted at rest (ADR-005), resolved per account (user → system; there is no environment tier)
  • ✅ Ownership enforced on every by-ID and list RPC
  • ✅ Wallet sync across 8 ecosystems; Binance spot sync; manual and LLM import
  • ✅ Scheduled price fetch, budgeted against each credential's remaining plan
  • ✅ Scam filtering with contract-level asset identity
  • ✅ Valuation coverage: the total says what it could not price

In progress / next:

  • 🔄 Quote confidence — a price with no market volume behind it must not enter the sum as if it were real
  • 🔄 Price coverage for non-crypto assets (MOEX, SPBEX, FX)
  • 🔄 Automation engines — DCA runs as paper trading on a manual account; rebalancing / stop-loss and real order placement are next
  • 📋 Metrics and monitoring beyond the health check

Beyond the feature work above, calling this beta would also need a documented upgrade path for someone else's instance, end-to-end tests in CI, and metrics. The schema has an ordered migration catalogue: schema.hcl is the authoring surface (make migrate-diff name=... turns an edit into a file in migrations/), make migrate-apply runs what a database has not run, make migrate-status shows executed vs pending and make migrate-drift what a live database has that schema.hcl does not. An instance created before the catalogue must be baselined once (make migrate-baseline version=<migration version>). Known risks and debt: docs/architecture.md §11.


Development

make up               # Start dev environment (docker compose)
make migrate-apply    # Run pending database migrations
make test             # Run all tests
make test-unit        # Run unit tests only
make test-integration # Run integration tests (testcontainers)
make buf-gen          # Generate protobuf code
make migrate-diff name=x # Turn a schema.hcl edit into a migration
make migrate-status   # What this database has run, what is pending

See Development Guide for details.


License

MIT License


Docs: Architecture • Development • API: api/v1/*.proto

About

Personal investment intelligence platform. Aggregate data from multiple sources, track your portfolio, and make informed financial decisions.

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages