AI-powered FX risk monitoring agent for cross-border payments. Every AI decision is permanently stored on 0G Storage and recorded on 0G Chain — creating a verifiable audit trail.



Cross-border payment companies process billions in daily FX transactions. When exchange rates move sharply during settlement windows (T+0 to T+2), manual monitoring misses critical
moments — leaving no verifiable evidence for post-incident audits.
The gap: "AI makes decisions" and "AI decisions are auditable" are worlds apart. Most AI systems today produce outputs with no cryptographic trail.
FX Risk Agent is an autonomous AI agent that creates an immutable, verifiable audit trail of every decision on the 0G Network — not just "what the AI said," but "what the AI knew,
judged, and recommended at each moment."
How it works:
AI analyzes real-time FX data for 4 currency pairs (USD/CNY, EUR/USD, GBP/USD, USD/JPY)
Every decision — full reasoning + model metadata — permanently stored on 0G Storage
Risk alerts recorded on-chain via FXRiskOracleV2 with access control (only Agent INFT owner can submit)
Every session updates Agent INFT (ERC-7857 inspired) state → on-chain inferenceCount grows
Anyone can verify: on-chain rootHash → download full decision log from 0G Storage
Component | Status | Usage |
0G Storage | ✅ Live | Permanent, tamper-proof archive of AI decision logs (JSON) |
0G Chain | ✅ Live | FXRiskOracleV2 records alerts with agentTokenId + aiBackend fields |
0G Compute | ✅ Live | Dual AI backend via @0glabs/0g-serving-broker (verifiable inference) |
Agent ID (INFT) | ✅ Live | ERC-7857 inspired NFT tokenizes agent identity, tracks inferences on-chain |
Dual AI Backend: Doubao Seed 2.0 Pro (primary) + 0G Compute (Qwen 2.5 7B via TEE-capable broker)
Access Control: mintAgent onlyOwner + submitAlert requires INFT ownership → prevents forged "official" AI alerts
Reentrancy Protection: ReentrancyGuard on state-mutating functions
Hybrid Storage: Summary on-chain (gas-efficient) + full decision log off-chain on 0G Storage (verifiable via rootHash)
AI: Doubao Seed 2.0 Pro + 0G Compute (Qwen 2.5 7B)
Smart Contracts: Solidity 0.8.24, OpenZeppelin 5.6.1, Foundry
Backend: TypeScript, Node.js, ethers.js v6
0G SDKs: @0gfoundation/0g-ts-sdk, @0glabs/0g-serving-broker
Network: 0G Galileo Testnet (Chain ID: 16602)
FXRiskOracleV2: 0x2abde2687923ffb9a5be4c6df3aac68a4f0a93ca
FXRiskAgentINFT: 0xAA540f42f0d20588f183E3B92B3b617991fa22D1 (Token #0 minted)
FXRiskOracle V1: 0x12030bc39dd18E2e8e4F10e685b7B7E639F0925A (historical audit)
📊 Dashboard: https://smallironman666.github.io/fx-risk-agent/
📹 Demo Video: https://youtu.be/j2eaoJN18a8
✅ 28 Foundry tests passing (access control, reentrancy, DoS protection)
✅ 7 Architecture Decision Records (ADRs) documenting design rationale
Built by @0xSmallironman — 5 years cross-border payment infrastructure experience (FIX 4.4, SWIFT MT103, ISO 20022). "From SWIFT to Smart Contracts."
Since the Checkpoint submission, FX Risk Agent has completed all 4 0G infrastructure components and hardened the contract layer with production-grade security patterns.
Component | Status | Usage |
0G Storage | ✅ Live | Every decision log (reasoning, confidence, model metadata) uploaded with verifiable rootHash |
0G Chain | ✅ Live | FXRiskOracleV2 records alerts with |
0G Compute | ✅ Live | Dual-backend inference via |
Agent ID (INFT) | ✅ Live | ERC-7857 inspired NFT tokenizes agent identity, on-chain |
Access Control: FXRiskAgentINFT uses OpenZeppelin Ownable — only the official deployer can mint Agent identities, preventing forgery of "official" AI alerts
Authenticated Alerts: submitAlert requires INFT.ownerOf(tokenId) == msg.sender — every on-chain alert is cryptographically bound to a legitimate Agent
Reentrancy Protection: ReentrancyGuard on all state-mutating functions
DoS Protection: Query pagination capped at MAX_QUERY_COUNT = 100
Input Validation: Strict integer/range checks on all agent identifiers
FXRiskOracleV2: 0x2abde2687923ffb9a5be4c6df3aac68a4f0a93ca
FXRiskAgentINFT: 0xAA540f42f0d20588f183E3B92B3b617991fa22D1 (Token #0 minted)
FXRiskOracle V1 (historical): 0x12030bc39dd18E2e8e4F10e685b7B7E639F0925A
End-to-end validation: one full agent session completed across all 4 components — V2 alert recorded, INFT state updated, storage rootHash verifiable on-chain.
28 Foundry tests covering access control, ownership transitions, DoS boundaries, and multi-backend scenarios
14 TypeScript integration tests for off-chain components
7 Architecture Decision Records documenting key design choices (dual-backend strategy, V1/V2 coexistence, TEE trade-offs, etc.)
Solidity 0.8.24 + OpenZeppelin 5.6.1, built with Foundry
Dashboard migrated to GitHub Pages with auto-deploy workflow — globally accessible without regional DNS/CDN restrictions.
Live Dashboard: https://smallironman666.github.io/fx-risk-agent/
📊 Dashboard: https://smallironman666.github.io/fx-risk-agent/
📹 Demo Video: https://youtu.be/j2eaoJN18a8
🔍 V2 Explorer: https://chainscan-galileo.0g.ai/address/0x2abde2687923ffb9a5be4c6df3aac68a4f0a93ca
Implement tokenURI for INFT visibility in wallets and explorers
Record fresh demo showcasing the full verifiable decision flow
Not yet funded. Building as an independent project for the 0G APAC Hackathon.