Seoul Bowl Hackathon 2025 | Track: Autonomous Finance & FinTech
An autonomous financial agent for group expense management built with AI + Web3. Aegis Pay acts as a decentralized treasurer that automates fund collection, expense verification, and settlement using SpoonOS and Neo N3 blockchain.
- Frontend: https://frontend-three-ashen-38.vercel.app
- Backend API: https://aegis-pay-backend-872951985428.asia-northeast3.run.app
- Agent Server: https://aegis-pay-agent-872951985428.asia-northeast3.run.app
- Smart Contract:
0x8f616d5ead7dbd85ccea2f61c2fff36bea53ba6b(Neo N3 TestNet)
Traditional bill-splitting apps only calculate debt - they don't collect money or execute payments. Aegis Pay automates the entire flow:
- Platform-Independent Links: Share a vault link through any messenger (KakaoTalk, Discord, Slack, WhatsApp)
- Auto-Deduction: When participants accept, funds are automatically deposited to escrow smart contract
- AI-Powered Verification: Upload receipt β GPT-4o Vision extracts total amount
- HITL Approval: 60-second countdown for participants to reject expenses (auto-approve on timeout)
- Autonomous Settlement: Agent calculates optimal payouts and executes blockchain transfers
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 1: Directives (What to do) β
β - Natural language SOPs in directives/ β
β - Define goals, inputs, outputs for each workflow β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 2: Orchestration (Decision making) β
β - SpoonOS SCDF graph-based workflows β
β - ReAct agent pattern β
β - HITL interrupts for approval flows β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 3: Execution (Deterministic) β
β - Python scripts (execution/) β
β - Neo N3 smart contracts (contracts/) β
β - Express.js backend (backend/) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Agentic Runtime: SpoonOS (SCDF framework)
- AI: GPT-4o Vision (OCR only)
- Blockchain: Neo N3 TestNet (smart contracts)
- Backend: Express.js + Prisma + SQLite
- Frontend: Next.js 14 + Tailwind CSS + shadcn/ui
- State: MCP+ (Model Context Protocol)
- Deployment:
- Frontend: Vercel
- Backend & Agent: GCP Cloud Run
- Database: SQLite (ephemeral)
- Infrastructure: Docker, Cloud Build
Before setting up locally, try the live demo:
- Visit: https://frontend-three-ashen-38.vercel.app
- Connect NeoLine Wallet (Neo N3 TestNet)
- Create a Vault or join an existing one
- Upload Receipt to test OCR
- Share Link via any messenger
- Docker & Docker Compose
- Node.js 18+
- Python 3.10+
- Neo N3 wallet with TestNet GAS
git clone <repo-url>
cd aegis-pay
# Run automated setup
chmod +x scripts/setup.sh
./scripts/setup.shThis will:
- Start MySQL via Docker
- Install backend dependencies
- Run Prisma migrations
cd backend
npm run devBackend API runs on http://localhost:4000
cd contracts
# Compile contract
neo3-boa compile vault.py
# Deploy to Neo N3 TestNet (see contracts/README.md)
# Update backend/.env with contract hashcd agent # If agent folder exists
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
pip install -r requirements.txt
python main.py # Start agent servercd frontend # If frontend folder exists
npm install
npm run devFrontend runs on http://localhost:3000
aegis-pay/
βββ backend/ # Express.js API + Prisma
β βββ src/
β β βββ server.js # Entry point
β β βββ routes/ # API routes
β β βββ services/ # Business logic
β β βββ lib/ # Utilities
β βββ prisma/
β β βββ schema.prisma
β βββ package.json
β
βββ contracts/ # Neo N3 smart contracts
β βββ vault.py # Main escrow contract
β βββ README.md
β
βββ directives/ # Agent SOPs (Layer 1)
β βββ vault_creation.md
β βββ ocr_receipt.md
β βββ hitl_approval.md
β βββ settlement.md
β
βββ execution/ # Deterministic scripts (Layer 3)
β βββ ocr_extract.py
β βββ calculate_split.py
β βββ neo_deploy.py
β βββ neo_transfer.py
β
βββ src/ # Frontend components
β βββ components/
β βββ lib/
β βββ styles/
β
βββ docs/ # Documentation
β βββ PRD.md
β βββ ARCHITECTURE.md
β βββ SMART_CONTRACT.md
β βββ SPOONOS_WORKFLOW.md
β
βββ scripts/
β βββ setup.sh # Quick setup script
β
βββ docker-compose.yml # MySQL container
βββ CLAUDE.md # Agent instructions
βββ README.md # This file
cd backend
# Development with hot reload
npm run dev
# Database management
npm run prisma:studio # Visual DB editor
npm run prisma:migrate # Create new migration
# Testing
curl http://localhost:4000/healthcd contracts
# Compile
neo3-boa compile vault.py
# Deploy to TestNet
# See contracts/README.md for deployment options
# Test
python test_vault.pycd frontend
# Development server
npm run dev
# Build for production
npm run build
# Type checking
npm run type-checkGET /health
POST /api/vaults # Create vault
GET /api/vaults/:id # Get vault details
POST /api/vaults/:id/join # Join vault
POST /api/vaults/:id/expenses # Upload expense receipt
POST /api/vaults/:id/close # Close vault and settle
cd backend
curl -X POST http://localhost:4000/api/vaults \
-H "Content-Type: application/json" \
-d '{
"name": "Test Vault",
"target_participants": 3,
"amount_per_person": 10,
"created_by": "NQtest123..."
}'cd contracts
python test_vault.py
# Or use neo-express
neoxp contract invoke <hash> create_vault [params...]See backend/prisma/schema.prisma for full schema. Key models:
- Vault: Main vault entity
- Participant: Users who joined vault
- Expense: Receipt uploads with OCR data
- Transaction: Blockchain transaction records
# Local Development
DATABASE_URL="mysql://root:password@localhost:3306/aegis_pay"
NEO_NETWORK="TestNet"
NEO_RPC_URL="https://testnet1.neo.coz.io:443"
NEO_CONTRACT_HASH="0x8f616d5ead7dbd85ccea2f61c2fff36bea53ba6b"
NEO_WALLET_WIF="YOUR_WIF_KEY"
NEO_WALLET_PASSWORD="YOUR_PASSWORD"
AGENT_URL="http://localhost:8000"
FRONTEND_URL="http://localhost:3000"OPENAI_API_KEY="sk-proj-..."
OPENAI_MODEL="gpt-4o-2024-08-06"
SPOONOS_API_KEY="sk-or-v1-..."
BACKEND_URL="http://localhost:4000"
NEO_RPC_URL="https://testnet1.neo.coz.io:443"
NEO_WALLET_WIF="YOUR_WIF_KEY"
NEO_WALLET_PASSWORD="YOUR_PASSWORD"
NEO_CONTRACT_HASH="0x8f616d5ead7dbd85ccea2f61c2fff36bea53ba6b"
NEO_NETWORK="TestNet"
AGENT_HOST="0.0.0.0"
AGENT_PORT="8000"
HITL_APPROVAL_TIMEOUT="60"
POLLING_INTERVAL="5"NEXT_PUBLIC_API_URL="http://localhost:4000"
NEXT_PUBLIC_AGENT_URL="http://localhost:8000"
NEXT_PUBLIC_AGENT_WS_URL="ws://localhost:8000/ws"
NEXT_PUBLIC_NEO_NETWORK="TestNet"
NEXT_PUBLIC_NEO_RPC_URL="https://testnet1.neo.coz.io:443"
NEXT_PUBLIC_VAULT_CONTRACT_HASH="0x8f616d5ead7dbd85ccea2f61c2fff36bea53ba6b"All services are deployed with production environment variables configured in:
- Backend: Cloud Run environment variables
- Agent: Cloud Run environment variables
- Frontend: Vercel environment variables
- Backend API with SQLite (deployed on Cloud Run)
- Neo N3 smart contract (deployed on TestNet)
- Frontend vault creation UI (deployed on Vercel)
- Shareable link generation
- Receipt OCR with GPT-4o Vision
- Auto-deduction on vault join
- SpoonOS agent integration (deployed on Cloud Run)
- HITL approval flow
- Automated settlement
- SpoonOS agent integration
- WebSocket real-time updates
- Email notifications
- Receipt search with BeVec
- Mobile app
- Multi-vault management
- Mainnet deployment
- Advanced analytics
All services are deployed and running:
- URL: https://frontend-three-ashen-38.vercel.app
- Framework: Next.js 14
- Region: Washington, D.C. (iad1)
- URL: https://aegis-pay-backend-872951985428.asia-northeast3.run.app
- Region: asia-northeast3 (Seoul)
- Database: SQLite (
/tmp/aegis_pay.db) - Auto-scaling: 0-10 instances
- URL: https://aegis-pay-agent-872951985428.asia-northeast3.run.app
- Region: asia-northeast3 (Seoul)
- Features: OCR, HITL, Settlement workflows
- Auto-scaling: 0-10 instances
- Hash:
0x8f616d5ead7dbd85ccea2f61c2fff36bea53ba6b - Network: TestNet
- RPC: https://testnet1.neo.coz.io:443
- PRD - Product Requirements
- Architecture - System Design
- Smart Contracts - Contract Specs
- SpoonOS Workflows - Agent Implementation
- UI Components - Frontend Design
- API Conventions - API Standards
# Check if container is running
docker ps
# View logs
docker logs aegis-pay-mysql
# Restart
docker-compose restart mysql# Regenerate client
cd backend
npm run prisma:generate
# Reset database (β οΈ deletes all data)
npx prisma migrate reset# Check TestNet GAS balance
# Get more from: https://neowish.ngd.network/
# Verify RPC endpoint
curl https://testnet1.neo.org:20331- MVP First: Ship working demo, polish later
- 3-Layer Separation: Directives β Orchestration β Execution
- Self-Annealing: When errors occur, fix + document + strengthen system
- Platform Independence: Work across any messenger via links
- HITL by Default: Human approval required, auto-timeout as fallback
This is a hackathon project. Contributions welcome after Seoul Bowl 2025!
MIT
Aegis Pay Team - Seoul Bowl Hackathon 2025
Built with: SpoonOS | Neo N3 | GPT-4o | Next.js | Express.js
Hackathon Deadline: December 21, 2025, 23:59 KST