-
-
Three risk profiles (Conservative/Balanced/Aggressive) with expected returns of +6.6%/+17.2%/+40.5% and agent budget allocation.
-
39 customizable parameters that users can adjust based on their strategies, with our system calculating potential risk and profit
-
Arbitrageur agent started with $53.75 but completed with 0 trades — session launched outside NASDAQ market hours (ends 20:00 UTC).
-
Analyzer screened 22 assets via Claude AI, selected 3 signals (GOOGL, NFLX, ETH-USD) at 36.55% Kelly allocation, published to Redis.
Xedge — Thin Markets, Thick Opportunity
Inspiration
We're driven by financial markets, math, and crypto. Before Xedge, we built an arbitrage bot that exploited pricing discrepancies for the same event across prediction market platforms. That project proved microstructure edges are real — and that expected value math never lies.
When Kraken launched xStocks perpetual futures, we saw the same pattern: thin markets, wider spreads, a bridge between NASDAQ and crypto pricing. Meanwhile, Polymarket achieves ~93% calibration accuracy on binary outcomes — a crowd-sourced probability prior that no quant fund uses. We combined both: Polymarket probabilities as a Bayesian prior, Claude AI as a research analyst setting direction and confidence ($\lambda$), and the Kelly criterion deciding capital. AI informs; math decides.
What We Learned
Every position is sized via fractional Kelly:
$$f = \lambda \cdot \max!\left(0,\;\frac{b \cdot p - q}{b}\right)$$
When $bp < q$, the formula returns zero — no trade, no override. We learned to trust it unconditionally.
We also learned that prediction market quality matters more than the probability itself — a 65% UP contract with \$200 liquidity is noise. We clamp AI probability deviation by market quality (high: ±12%, unreliable: ±35%). On the execution side, bid-ask spreads on xStocks can eat the entire edge, so we built a dynamic spread gate that scales with Kelly signal strength. And our Arbitrageur evolved from a fixed convergence assumption to Bayesian adaptive estimation — a Beta(4.20, 2.80) prior updated from its own trade history in Redis.
How We Built It
Four independent Python agents in Docker containers, coordinated via Redis Streams on AWS Fargate:
| Agent | Role |
|---|---|
| Analyzer | Polymarket + news + technicals into Claude AI, Kelly sizing, signal publishing |
| Trader | IOC order execution, TP/SL management, trailing stops, partial TP (50/50) |
| Arbitrageur | Event-driven WebSocket scanner for NASDAQ-xStocks divergences, 24/7 |
| TA Scanner | Independent RSI/MACD/Bollinger signals without Polymarket |
An EdgeValidator independently scores each Claude signal on momentum, trend, volatility, and volume — adjusting $\lambda$ without Claude's knowledge. It never vetoes; Kelly handles zero-edge trades naturally.
The React frontend (xedge.pl) lets users pick a risk profile and tune 39 parameters. Projected returns use a client-side daily edge model:
$$\text{dailyEdge} = \sum_{s} \alpha_s \cdot \lambda_s \cdot L \cdot w_s \cdot R$$
Deploy is one click: EIP-191 wallet signature, verified by a Cloudflare Worker, triggers GitHub Actions to build, push to ECR, and roll out on Fargate via Terraform. All infra is IaC — secrets in SSM, logs in CloudWatch, history in S3.
Challenges
Frontend-to-backend bridge — translating 39 env vars into an intuitive UI with sliders, three preset profiles, and a
computeDailyEdge()function that updates projected returns in real time as users adjust parameters.User-controlled deploy pipeline — EIP-191 wallet auth (no accounts), server-side parameter validation, and atomic Fargate deploys (
min_healthy=0%) to prevent duplicate trading.WebSocket-speed arbitrage — two concurrent feeds (Kraken L2 + Finnhub) into a 3-thread consumer queue, with mutex locking per ticker and 30s stale-data rejection. Non-stock tickers fall back to cached Yahoo Finance.
Partial TP on Kraken — trigger orders are all-or-nothing, so our 50/50 strategy re-enters 50% via IOC at the TP price and places fresh TP/SL for the remainder.
24/7 uptime across asset classes — crypto never sleeps but stocks have holidays. The Analyzer skips sessions on NYSE holidays; the Arbitrageur filters to crypto-only. ECS runs permanently with no scaling gaps.
Built for the Kraken xStocks Hackathon -- Cannes 2026
Built With
- aws-fargate
- cloudflare-pages
- kraken-xstocks-api
- polymarketgammaapi
- privy-(wallet-authentication)
- python-3.12
- react-18
- redis-7
- terraform-1.5+
- typescript-5.6
Log in or sign up for Devpost to join the conversation.