The Inspiration: The Paradox of the "Quiet Trade"
In the world of high finance, institutional investors face a brutal paradox. When a pension fund or a large bank needs to move a massive block of shares, they cannot do it on public exchanges without triggering a "price crash." To solve this, they use Dark Pools—private exchanges designed for anonymity.
However, we discovered a "Research Gap": Modern AI can now "sniff out" these hidden trades by analyzing tiny patterns in public data, leading to predatory high-frequency trading (HFT). We were inspired to build ShadowMarket AI to answer one question: Can we create a market that is mathematically incapable of leaking information? How We Built It: A Multi-Layered Approach
We designed a system that fuses Machine Learning, Secure Multi-Party Computation (SMPC), and Blockchain to create a "Trustless Dark Pool."
- The Privacy Layer (SMPC)
Instead of storing trade volumes as raw integers, we implemented Additive Secret Sharing. When a user wants to sell V shares, the system "shreds" the value into n fragments: V=(v1+v2+v3)(modP)
where P is a large prime. These fragments are distributed across independent nodes. No single node knows the true volume, but the system can still perform arithmetic to find a match.
- The Intelligence Layer (MARL)
We moved beyond static matching engines. We built a Multi-Agent Reinforcement Learning (MARL) environment.
Liquidity Agents negotiate the "Midpoint Price" without revealing the parties' maximum "pain points."
An Anomaly Detection AI (Isolation Forest) monitors the pool for "sniffing" behavior, automatically increasing "Differential Privacy noise" (ϵ) if predatory patterns are detected.
- The Trust Layer (Motoko & Internet Computer)
The backend is built using Motoko on the Internet Computer (ICP). This allows us to use "Canisters" as decentralized, tamper-proof vaults. We implemented an Atomic Swap protocol that ensures assets are only exchanged once the AI confirms a match via a Zero-Knowledge Proof. What We Learned: The Complexity of Anonymity
This project was a deep dive into Market Microstructure. We learned that:
Information Asymmetry is not a bug; it's a feature of finance.
Price Discovery is fragile. If you make a market too dark, it becomes impossible to value assets. We had to implement a "Hybrid Oracle" that pulls public prices while keeping trade intent private.
Latency vs. Privacy: Secure computation is slow. We learned to optimize our Python backend to handle secret-sharing math in near real-time.
Challenges We Faced
The Cold Start Problem: An empty dark pool has zero liquidity. We solved this by creating "Market Maker Agents" that provide baseline liquidity during the demo.
Motoko-Python Integration: Connecting a Python-based AI agent to a Motoko canister required a custom middleware bridge using FastAPI. We had to ensure the "Handshake" between the AI's matching logic and the Blockchain's settlement was cryptographically secure.
Preventing Sniffing: We struggled with "input-output leakage." If a user buys 100 shares, they shouldn't know if they bought them from one person or ten. We implemented Bucketized Matching to obscure individual counterparty details.
The Impact
ShadowMarket AI represents a future where Privacy = Stability. By protecting large-scale liquidity from predatory algorithms, we reduce unnecessary market volatility and empower institutions to trade without fear of exploitation.
Built With
- fastapi
- motoko
- numpy
- pandas
- pettingzoo
- pysyft
- python
- raylib
- react
- scikit-learn
Log in or sign up for Devpost to join the conversation.