Multi-chain monitoring, smart-account automation, live financial simulators, and an AI agent layer — all production-running on hardware I control. The goal: manage real on-chain capital with the same discipline a fund engineering team brings to a paid product.
Web-based simulators for two DeFi strategies, each with sliders for every parameter, live on-chain data integration, and quarterly time-walk projections. Math libs shared with CLI tools; same formulas validated against documented reference cases.
Multiple system crons watching protocol state across 4 chains. Notification routing by severity to in-app, Telegram, and email. 12h dedupe via message-tag matching prevents alert fatigue.
Safe Protocol Kit integration across all four chains. Multi-step transactions batched into single executions. Retry wrapper for intermittent Safe gateway failures, with all retries logged to an audit table.
Plugin-style skill system: 30+ agent-callable functions for DeFi actions (borrow, swap, bridge, transmute). Skills are first-class — schema-defined, registry-mounted, callable by either Claude or local models.
Treated as a real system from day one. Hourly backup pipeline with USB mirror and encrypted Google Drive push. Daily portfolio snapshots driving the advisory engine. Every state-changing operation written to a wallet audit log.
Strategy detail pages showing live position state, APR projections, range visualizations, and on-chain P&L. Hydration-safe SSR — server-rendered with no client/server state drift.
The web UI: dashboards, simulators, playbook controls. Static export option for the marketing site.
Background jobs run as micro-workflows. Backed by structured DB with schema migrations and a wallet audit log.
Direct on-chain reads & writes via custom RPC pool with fallback transports. All ABIs vendored from upstream sources.
┌─────────────────────────────────────────────────────────────┐
│ Browser (Next.js client) │
│ Strategy dashboards · Simulators · Playbook controls │
└────────────────────────┬────────────────────────────────────────┘
│
┌────────────────────────▼────────────────────────────────────────┐
│ Next.js server (App Router) │
│ SSR · API routes · Hydration-safe live data fetching │
└─────┬───────────────────┬───────────────────┬──────────────────┘
│ │ │
┌─────▼─────┐ ┌─────▼─────┐ ┌─────▼──────┐
│ SQLite │ │ Cron worker│ │ viem pool │
│ + Drizzle │◄──────│ pnpm worker│──────►│ 4-chain RPC│
│ 60+ tbls │ │ 11 jobs │ │ fallback │
└─────▲─────┘ └─────┬──────┘ └─────┬──────┘
│ │ │
│ ┌──────▼──────┐ │
│ │ Notifications│ │
│ │ in-app · TG │ │
│ │ email · web │ │
│ └──────────────┘ │
│ ▼
│ ┌─────────────┐
└─────── Anthropic SDK ◄───────────│ Smart │
Local LLM (Ollama) │ account │
Skill registry (30+) │ Safe SDK │
└─────────────┘Different chains, different reliability profiles, different block times. Naïve single-RPC code dies the first time Alchemy throttles.
Custom transport layer with per-chain fallback URL lists, configurable timeouts, and lazy client construction. Arbitrum's L1-cadence block timing handled as a special case in time-to-X calculations.
A cron-job table felt redundant when we already had workflows with schedule triggers, agent nodes, run history, and pause/resume.
Crons are 2-node workflows (Trigger + Action). Calendar UI surfaces them alongside user-defined jobs. System crons hardcoded in scheduler module for visibility but use the same dispatch path.
Server-rendered components with `useState(true)` for loading state cause hydration mismatches when Next.js 16 / React 19 tightens attribute serialization.
Initialize loading flags to `false`; flip true after mount via useEffect. Net effect: server-rendered HTML matches first client paint exactly, then the fetch fires.
Modeled an external protocol's redemption math from public documentation that uses inconsistent formulas (compound yield in one slide, simple in another).
Built simulator with both modes toggleable. Validated against documented reference cases — slide-4 fit exact, slide-1 within rounding. Honest documentation of remaining heuristics rather than hiding the approximations.
Safe's transaction relay gateway has intermittent timeouts. Single-shot operations occasionally hang for 30+ seconds then fail.
Retry wrapper around both single and batch paths with exponential backoff. Every retry recovery logged to the wallet audit log so operational pattern is visible. Failure mode: log with diagnostic context, don't silently swallow.
A platform managing real on-chain money needs more than a working web app: backups, alerts, post-mortems, evolution.
Hourly DB backup with USB + encrypted Google Drive mirroring (full restore tested). Bi-weekly self-review bot reads commits + state, emails actionable suggestions. Every commit follows a tight feat/fix/docs convention.
piggyfi started as a personal tool to manage on-chain capital with the same rigor a small team would apply to a paid product. It became a serious solo build — months of evening and weekend work — touching every layer from cron schedulers to AI agents to UI hydration edge cases.
The work shipped here demonstrates breadth: modern frontend, real backend ops, complex financial math, integration with multiple external APIs, and a deliberate posture of production discipline (backups, alerting, schema migrations, audit logs). The DeFi domain is the substrate, not the point — the point is end-to-end ownership of a non-trivial system.
Looking for environments where this depth of breadth is wanted. Comfortable owning a system from glue-code to architecture, with a strong preference for getting the small details right.