Autonomous Arbitrage Agent System between Frax Finance and KRWQ
Built with ADK-TS Patterns | Uses Mock Data for Demo Purposes
FraxArb-KRW is a hackathon demo showcasing an autonomous arbitrage agent that monitors price spreads between Frax Finance and KRWQ markets, making intelligent trading decisions based on market conditions.
- Real-time Market Monitoring: Continuously fetches mock market data every 5 seconds
- Intelligent Decision Making: Agent analyzes spreads and executes trades based on:
- BUY when spread < -0.2% (KRWQ undervalued)
- SELL when spread > 0.5% (KRWQ overvalued)
- HOLD when spread is within normal range
- Chain of Thought Reasoning: Full transparency into agent's decision process
- Professional Terminal UI: Beautiful colored output using
chalkandora - Cross-chain Bridge Simulation: Mocks FraxSwap bridge transactions
npm installnpm startThe agent will start monitoring markets and making autonomous trading decisions. Press Ctrl+C to stop.
frax-arb-krw/
├── src/
│ ├── types.ts # TypeScript interfaces
│ ├── tools/
│ │ └── market.ts # Mock market data & swap execution
│ ├── agent.ts # ArbAgent class with decision logic
│ └── index.ts # Main application loop
├── package.json
├── tsconfig.json
└── .env
- TypeScript: Type-safe development
- ts-node: Direct TypeScript execution
- chalk: Terminal colors and styling
- ora: Elegant terminal spinners
- dotenv: Environment configuration
- FRAX Price: ~$1.00 (±$0.002 variance)
- KRWQ Price: ~$0.00072 (with intentional variance to trigger BUY opportunities)
- Spread Calculation:
((KRWQ - impliedKRWQ) / impliedKRWQ) * 100 - Transaction Delay: 1.5 seconds to simulate real blockchain latency
- ✅ Professional ASCII header banner
- 📊 Color-coded spread indicators (Green/Yellow/Red)
- 🔄 Loading spinners for async operations
- 🤖 Chain of thought reasoning display
- 💱 Real-time market rate updates
- Analyzes liquidity pools across both chains
- Calculates arbitrage opportunities
- Estimates profit potential
- Shows confidence levels (0-100%)
Edit .env file for custom settings (currently uses mock data only).
MIT
This demo is designed to showcase:
- ADK-TS design patterns
- Autonomous agent decision-making
- Cross-chain arbitrage concepts
- Professional terminal UI/UX
Note: All data is mocked. No real API connections or blockchain transactions are made.
Powered by Frax Finance & KRWQ 🚀