How I Built 3 Chainlink CRE Workflows in One Week — FBA Oracle, Privacy Payroll & DeFi Intelligence at 3 AM
Author: Venkateshwar Rao Nagala
GitHub: https://github.com/tenalirama2025-creator/chainlink-prediction-settler
Competition: Chainlink Convergence Hackathon 2026
Demo Video
▶️ Watch the full pipeline in action:
https://youtu.be/YD14xtCYnM0
My Story
I worked on blockchain projects earlier using JavaScript, RUST and Python for settlement of forex transactions across banks. The blockchain forex settlement enabled banks to settle forex transactions within minutes down from weeks. This blockchain experience helped me in my decision to be part of this Convergence Hackathon 2026.
Last month I won the Velocity Award at the Solo.io MCP & AI Agents Hackathon
for building a COBOL→Rust modernization pipeline with zero-trust AgentGateway
security. This month I applied that same velocity to the Chainlink Convergence
Hackathon.
My interest in Chainlink did not start in February 2026 when I received the
hackathon email. It started on May 1, 2021 — I have the MIT Open email to
prove it — when I watched Lex Fridman's podcast with Sergey Nazarov on Smart
Contracts and Chainlink. That podcast planted a seed. I have followed Chainlink
Foundation activities ever since — Smart Conferences, Bootcamps, developer
updates. Five years later, at 3 AM in Secunderabad, I was watching Chainlink
CRE workflows simulate green on my terminal.
On February 28, 2026 — just one week before the March 8 deadline — I received
the Chainlink Convergence hackathon email. I was still finishing the Solo.io
submission. Another round of late nights was about to begin.
I have 30 years of software experience — from writing Fortran for gearbox
manufacturing simulations in my final year of Mechanical Engineering, to 10
years of IBM Assembler programming for insurance companies in the USA
(Homecomm/Lifecomm), to Core Banking reconciliation at RBC, to Big Data
Analytics at AIG, to Assembler and COBOL at Thrivent. I gathered all of that
experience and decided to compete.
The Problem That Started It All
Prediction markets need trustworthy, automated settlement. But a single AI
oracle can hallucinate. A single LLM can be wrong with high confidence.
A single data source can be compromised.
I had studied Byzantine fault tolerance throughout my career in distributed
systems. I knew about Stellar's Federated Byzantine Agreement protocol. The
question was: could FBA be applied to LLM oracles?
The answer became this project.
The "Aha Moment"
Initially I decided to go with claude-opus-4-6 LLM for prediction, but
decided to add another LLM that is GPT-4o. If anyone of the LLM
hallucinates then one of them will give the correct prediction,
but the problem was how to decide which one is correct and other
is not correct. The solution is Byzantine Consensus Algorithm.
I knew that consensus on blockchain networks is achieved through Byzantine
algorithms. I had three project ideas initially — a prediction market settler,
a privacy-preserving payroll workflow, and a DeFi market intelligence tool.
After seeing the scope, I decided to combine all three as individual MCPs in
a single unified project.
The "aha moment" came when I saw the FBA consensus result appear — Claude
Opus saying NO at 99% confidence, GPT-4o saying NO at 95% confidence, the
FBA engine confirming quorum intersection — and knowing that result was about
to be written to a smart contract on the blockchain via MetaMask. That moment
made every late night worth it.
What I Built
A complete AI-powered prediction market settlement system with:
ai_prediction_mcp — FBA consensus oracle (Claude Opus + GPT-4o) via
Chainlink CRE. Both LLMs independently evaluate a prediction statement.
FBA computes quorum intersection. On agreement: auto-settle on-chain.
On disagreement: autonomous settlement BLOCKED — human review triggered.payroll_mcp — Privacy-preserving batch payroll settlement. Recipient
addresses and salary amounts never appear on-chain. Only a keccak256 batch
hash is recorded. CRE Confidential Compute keeps all sensitive data private.hyperliquid_mcp — Hyperliquid DEX market intelligence. Queries 229
perpetual markets via CRE Confidential HTTP. Fetches live prices for
BTC, ETH and DOGE simultaneously. API credentials managed at DON level
— never exposed.
I had previously built a private Hyperliquid project where I discovered
all 229 perpetual markets. Without that foundation I would never have
known how to connect the hyperliquid_mcp workflow to live DEX data via
CRE Confidential HTTP.
Rust CLI — FBA consensus engine (TypeScript port of Stellar's SCP),
fetch-fed, simulate, and status commands.PredictionMarket.sol — Solidity smart contract deployed and verified
on Ethereum Sepolia. Verified on Sourcify, Blockscout, and Routescan.
Live FBA Result:
Statement: "Did the Fed cut rates at March 2025 FOMC?"
Claude Opus: NO | 99% confidence
GPT-4o: NO | 95% confidence
FBA Outcome: NO | 97% confidence
Quorum: ✅ INTERSECTED
Safety: ✅ CLEARED
Action: SETTLE NO — Fed held rates confirmed
Live Hyperliquid DEX Prices:
🎯 Monitoring: BTC, ETH, DOGE
📡 API: https://api.hyperliquid.xyz/info
✅ BTC: $68,129.50 | Spread: 0.10 bps
📈 Bid: $68,128.82 📉 Ask: $68,130.18
✅ ETH: $1,982.65 | Spread: 0.10 bps
📈 Bid: $1,982.63 📉 Ask: $1,982.67
✅ DOGE: $0.09 | Spread: 0.10 bps
📈 Bid: $0.09 📉 Ask: $0.09
🏦 Market Depth: 229 perpetual markets
🔗 Source: Hyperliquid DEX via CRE Confidential HTTP
Chainlink Validates This Approach
While researching the CRE platform I made three important discoveries:
Discovery 1 — Chainlink's own blog lists this exact use case:
Chainlink's official blog "5 Ways to Build with the Chainlink Runtime
Environment" lists item 3 as:
"AI-Powered Prediction Market Settlement"
That is exactly what I built — with FBA Byzantine fault tolerance added
on top. Chainlink themselves identified this as a key CRE use case.
Discovery 2 — CRE deployment is Early Access:
The CRE docs clearly state:
"Deploy your workflows (Early Access) — EARLY ACCESS DISCLAIMER"
This means having all 3 workflows deployed and active on the Chainlink
DON — confirmed by the Chainlink team — is an exclusive achievement.
Not every developer has deployment access yet.
Discovery 3 — Chainlink's own Prediction Market template uses 1 LLM:
The CRE Templates Hub features a "Prediction Market Demo" created by
Chainlink Labs — using Google's Gemini AI and Firebase.
My project goes further:
Chainlink template: 1 LLM (Gemini) + Firebase
My project: 2 LLMs (Claude Opus + GPT-4o)
+ FBA Byzantine fault tolerance
+ Privacy payroll
+ DeFi market intelligence
+ Rust consensus engine
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ CHAINLINK CRE LAYER │
│ │
│ ┌──────────────┐ ┌──────────────────┐ ┌──────────────────┐ │
│ │ payroll_mcp │ │ hyperliquid_mcp │ │ ai_prediction │ │
│ │ │ │ │ │ _mcp │ │
│ │ Privacy- │ │ DEX Market │ │ FBA Oracle │ │
│ │ preserving │ │ Intelligence │ │ (Claude+GPT-4o) │ │
│ │ batch settle │ │ BTC/ETH spreads │ │ │ │
│ └──────┬───────┘ └────────┬─────────┘ └────────┬─────────┘ │
└─────────┼───────────────────┼──────────────────────┼────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ RUST CLI (settler) │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ FBA CONSENSUS ENGINE │ │
│ │ Claude Opus ──┐ │ │
│ │ ├──► Quorum Intersection ──► SETTLE │ │
│ │ GPT-4o ────┘ (Stellar Protocol) or REVIEW │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ ETHEREUM SEPOLIA (Smart Contract) │
│ PredictionMarket.sol │
│ 0xEA856dF995C58DEc18221C907DC221c4487Ae499 │
│ Question: "Did the Fed cut rates at March 2025 FOMC?" │
└─────────────────────────────────────────────────────────────────┘
The Three Thrillers
Thriller 1: The MetaMask Maze 🦊
When I wanted to install MetaMask, I searched for it online. The search showed
a page full of websites. I clicked one that instructed me to download a .msi
file for Windows. The downloaded files ended up in my project folder — around
10,000 files in two separate folders. This filled my C drive completely.
I only discovered this during the GitHub upload — the files showed up in git
and I immediately deleted them from VSCode and GitHub.
The MetaMask website itself was a maze for a first-time visitor. They clearly
display browser extension options — Chrome, Edge, Firefox — but when I clicked
the Chrome extension, the GET button was greyed out with a message:
"You can't add or remove items when in Incognito or Guest mode."
I was in Incognito mode on Edge. I switched to normal mode. Same message.
I eventually found the Chrome Web Store option — but that led to another
problem.
I created Account 1 and added a wallet. Then imported Account 1, creating an
"Imported Account 1." I got 0.05 Sepolia ETH from the Google faucet and added
it to Account 1.
When I tried to Deploy & Run my Solidity contract in Remix, MetaMask picked
the Imported Account 1 — which had no funds. I was confused. I had just added
tokens!
I investigated. I went back to the MetaMask Chrome extension and discovered
that Account 1 and Imported Account 1 had DIFFERENT wallet addresses. MetaMask
prioritises the Imported Account during Deploy & Run.
I deleted the Imported Account 1. Recompiled. Deployed. This time MetaMask
used Account 1 with the funds — and the contract was deployed successfully.
Thriller 2: The Wrong Contract Address 📋
After deployment I committed the contract address to GitHub — but I captured
the wrong URL. The address I saved was for the default Remix Storage contract,
not my PredictionMarket.sol.
The same wrong address was deployed to CRE by Thomas from the Chainlink team. Two days
before submission I discovered the mistake.
I corrected the address everywhere — .env, config files, README. Then I
informed Thomas from the Chainlink team and requested redeployment with the
correct address. Waiting for Thomas to complete the redeployment — with the
submission deadline two days away — was nothing short of watching a thriller
movie.
Thriller 3: The 3 AM CRE Debugging Session 🌙
The night of March 3-4, 2026. It was past midnight in Secunderabad. I was
trying to get all three CRE workflows simulating.
The errors came one after another:
✗ ConfigPath must be a valid existing file: ./config.staging.json
✗ environment variable PAYROLL_API_KEY_VALUE not found
✗ 'btoa' is not defined
✗ Expected identifier but found "," (double comma syntax error)
✗ Buffer.from base64 encoding required
Each error revealed the next. Missing config file. Wrong secrets format.
Wrong base64 encoding function. Double comma from a PowerShell replace command.
At 1:42 AM the terminal showed:
╭──────────────────────────────────────────────────────╮
│ Simulation complete! Ready to deploy your workflow? │
╰──────────────────────────────────────────────────────╯
All three workflows. Green. That moment made every late night worth it.
CRE Workflow Deep Dive
ai_prediction_mcp — FBA Consensus Oracle
The key innovation: secrets fetched at DON level, passed into node mode as
arguments. API keys for Claude and OpenAI never leave Chainlink's confidential
compute environment.
// Fetch secrets at DON level — same pattern as payroll_mcp
const claudeSecret = runtime.getSecret({ id: config.claudeApiKeySecretName }).result();
const openaiSecret = runtime.getSecret({ id: config.openaiApiKeySecretName }).result();
// Pass both keys into runInNodeMode
const result = runtime
.runInNodeMode(
runFbaConsensus,
consensusIdenticalAggregation<SettlementResult>()
)(claudeApiKey, openaiApiKey)
.result();
payroll_mcp — Privacy-Preserving Settlement
Only the batch hash is recorded on-chain. Amounts and recipient addresses
stay inside CRE confidential compute:
// PRIVATE — never written on-chain
type PayrollEntry = {
recipient: string;
amount: number;
memo: string;
};
// Only this is recorded on-chain
return {
batchHash: computeBatchHash(batch),
privacy: "recipient_addresses_and_amounts_not_recorded_onchain"
};
hyperliquid_mcp — DeFi Market Intelligence
CRE Confidential HTTP — API credentials managed at DON level.
Multi-coin support — BTC, ETH, DOGE simultaneously:
// Normalize coin to array — supports single or multiple coins
const coins = Array.isArray(config.coin)
? config.coin
: [config.coin];
// allMids returns live prices for ALL 229 markets
body: Buffer.from(
JSON.stringify({ type: "allMids" })
).toString("base64"), // CRE requires base64 encoded body
// Loop through each coin — real live prices
const coinResults: CoinResult[] = coins.map((coin) => {
const mid = parseFloat(data?.[coin]) || 0;
...
});
Configure any coins in config.staging.json:
"coin": ["BTC", "ETH", "DOGE"]
Key Technical Lessons
On Hyperliquid API:
Use type: "allMids" not type: "meta" to get live prices.
allMids returns a flat map of all 229 coin prices instantly.
Supports array of coins in config — "coin": ["BTC", "ETH", "DOGE"].
Prior experience with a private Hyperliquid project was essential —
without knowing the 229 perpetual markets existed, this workflow
would never have been built.
On CRE secrets:
Use secretsNames format in secrets.yaml — not a secrets list. Each
workflow needs its own local ./secrets.yaml — sharing ../secrets.yaml
causes cross-workflow secret conflicts.
On CRE HTTP:
The CRE HTTPClient requires request body as base64. Use
Buffer.from(JSON.stringify(body)).toString("base64") — not btoa() which
is not available in the CRE runtime.
On MetaMask:
Always install as a Chrome extension from the Chrome Web Store. Never download
desktop packages. Delete any Imported Accounts before deploying — they take
priority over regular accounts during Remix deployment.
On contract verification:
Always click the Contract tab on Blockscout after deployment and verify the
contract name matches your Solidity file — not the default Remix Storage
contract.
On FBA for LLMs:
Byzantine fault tolerance is not just for distributed databases. Applied to
LLM oracles, FBA provides quorum intersection guarantees — a hallucinating
model cannot unilaterally settle a market.
Thomas — Chainlink Team Deployment Confirmation
Thomas from the Chainlink team redeployed all 3 workflows after pulling
the latest repository. His email confirmed:
✓ Transaction confirmed https://etherscan.io/tx/0x....e8a
✓ Workflow deployed successfully
Workflow Name: ai-prediction-fba-staging
Workflow ID: 00.....c5fd
✓ Transaction confirmed https://etherscan.io/tx/0x....530
✓ Workflow deployed successfully
Workflow Name: hyperliquid-market-intelligence-staging
Workflow ID: 00..............488e
✓ Transaction confirmed https://etherscan.io/tx/0x....058
✓ Workflow deployed successfully
Workflow Name: payroll-settlement-staging
Workflow ID: 00.......0c6
Thomas could not share a dashboard screenshot as other workflows were
deployed on his account. His professionalism throughout this hackathon
was exceptional. Thank you Thomas! 🙏
Quick Start
Prerequisites
1. Install Rust:
winget install Rustlang.Rust.MSVC
2. Install Bun:
winget install Oven-sh.Bun
3. Install CRE CLI:
bun x cre-setup
4. Clone and build:
git clone https://github.com/tenalirama2025-creator/chainlink-prediction-settler
cd chainlink-prediction-settler
cargo build
Run Everything with One Command
.\deploy.ps1
That's it! An interactive menu handles everything:
╔══════════════════════════════════════════════════════════════╗
║ Chainlink Prediction Settler — FBA Consensus Oracle ║
║ 3 CRE Workflows: FBA Oracle + Privacy Payroll + DeFi ║
╚══════════════════════════════════════════════════════════════╝
Select an option:
[1] Simulate FBA Consensus (FREE — no API keys needed)
[2] Live FBA Consensus (requires Claude + OpenAI API keys)
[3] Run ALL 3 CRE Simulations (requires CRE CLI)
[4] Run payroll_mcp simulation (requires CRE CLI)
[5] Run hyperliquid_mcp — Live DEX prices BTC/ETH/DOGE (requires CRE CLI)
[6] Run ai_prediction_mcp simulation (requires CRE CLI)
[7] Check contract status (FREE — no API keys needed)
[8] Deploy to CRE (requires CRE Early Access)
[9] Exit
Start with Option 1 — free, no API keys, no CRE account needed.
Option 3 runs all 3 CRE workflows in sequence automatically.
Prize Tracks
| Track | Amount | How This Project Qualifies |
|---|---|---|
| Prediction Markets | $16,000 | FBA consensus settles real on-chain predictions |
| Privacy | $16,000 | payroll_mcp — batch hash only, amounts never on-chain |
| CRE & AI | $17,000 | 3 production CRE workflows running on DON |
| Risk & Compliance | $16,000 | FBA blocks unsafe settlements — human review triggered |
| DeFi | $16,000 | hyperliquid_mcp — DEX intelligence via confidential HTTP |
Total potential: $81,000
My Message to You
Please take the risk if you enjoy the thrills that accompany such projects
with tight deadlines.
Two days before submission you realize the contract URL is wrong. The same
mistake was deployed to CRE by Thomas from the Chainlink team. Requesting
Thomas to redeploy after correcting the mistake, and waiting for him to
complete the redeployment, is nothing short of watching a thriller movie.
I received the hackathon email one week before the deadline. I had a Solo.io
submission still in progress. I had never built a CRE workflow before.
I entered anyway.
The MIT Open email from May 1, 2021 — the Lex Fridman podcast with Sergey
Nazarov that started this journey — sits in my inbox. Five years from that
email to this submission.
Take the risk. The thrill is worth it.
Recording the demo video took 8 retakes. The first 6 takes I forgot to
include Thomas's deployment confirmation. 8th time lucky! 😄
The final video is 3 minutes 44 seconds. Under the 5 minute limit.
Every second counts when the deadline is today.
About Me
Venkateshwar Rao Nagala
- GATE 1994 AIR 444 — Top 0.4% of India's engineering graduates
- Fortran — Final year Mechanical Engineering project: Computer Assisted Manufacturing of Gear Boxes
- 1994-2004 — IBM Assembler expert, insurance companies USA (Homecomm/Lifecomm)
- RBC — Senior Project Manager, Core Banking (RDDA/BDDA)
- AIG — Manager Big Data Analytics
- Thrivent — Consultant, Assembler 80% / COBOL 20%
- Solo.io 2026 — Velocity Award 🏆
- Chainlink follower since May 1, 2021 (MIT Open — Sergey Nazarov podcast)
📧 tenalirama2019@gmail.com
📱 +91-9701908080
🐙 https://github.com/tenalirama2025-creator
Built with Rust. Orchestrated with Chainlink CRE. Settled on Ethereum Sepolia.
From Assembler to blockchain — one late night at a time. 🚀
GitHub: https://github.com/tenalirama2025-creator/chainlink-prediction-settler
Contract: 0xEA856dF995C58DEc18221C907DC221c4487Ae499 (Sepolia)
Demo: https://youtu.be/YD14xtCYnM0
Top comments (0)