14 May, 2026
Authors: Yemi (Ikeh Chukwuka Favour)
This project is a yield-generating vault that lets anyone deposit assets and earn returns from prediction market trading, without revealing how much they deposited, what positions the vault holds, or when they plan to withdraw. It is built on the Midnight blockchain, which is the only production blockchain today capable of keeping that information private while still allowing anyone to verify that the vault is solvent, that it has not exceeded its risk limits, and that every user's proportional claim is mathematically correct.
The vault accepts deposits from users, issues them a proportional share of ownership, and hands the deposited capital to an AI decision engine that identifies mispriced outcomes on Polymarket and similar prediction markets, places positions, and returns profits back to the vault. Users redeem their shares at any time through an asynchronous withdrawal queue that fills as liquidity becomes available. Every piece of business logic that governs the vault, from how shares are calculated to how withdrawal tickets are processed, is enforced by a smart contract on Midnight that anyone can read and verify. The AI is the manager. The contract is the regulator. Users are the beneficiaries.
Prediction markets like Polymarket have demonstrated something important about financial markets: when you allow people to bet real money on the outcome of future events, the prices that emerge are among the most accurate probability estimates available anywhere. The crowd of traders on Polymarket collectively predicted election outcomes, economic decisions, and major world events more accurately than most professional forecasters. Where there is accurate probability estimation, there is the opportunity to profit by finding markets where the crowd is temporarily wrong.
The problem is that doing this well at scale requires two things that are in direct tension with each other. The first is a systematic, data-driven approach to identifying mispriced markets and sizing positions appropriately, which is what an AI decision engine provides. The second is keeping that strategy private so that competitors cannot copy it the moment it starts generating alpha. On every existing blockchain, these two things cannot coexist. When a vault deploys capital to Polymarket through a smart contract on Ethereum or Polygon, every position is immediately visible on-chain. Any competitor can see exactly which markets the vault is betting on, how much capital it has deployed, and when it plans to exit. The strategy is reverse-engineered the moment it becomes profitable, which destroys the edge that justified the strategy in the first place.
There is a second problem that sits on top of the first one. Managed vaults that deploy capital to external strategies have historically required users to simply trust the manager. Users deposit and hope that whoever controls the deployment is competent and honest, because they have no way to verify vault health without the manager's cooperation. This is the same trust problem that keeps ordinary people out of hedge funds and sophisticated yield strategies. It should not require trust. It should require proof.
This project solves both problems simultaneously, which is something that has never been possible before because no blockchain had the right combination of programmable privacy and verifiable computation until Midnight went live.
A user who wants to earn yield from prediction market trading without managing positions themselves visits the vault interface, connects their Midnight wallet, and deposits an amount of the underlying token, which for this implementation is a stablecoin. The vault calculates how many shares to issue based on the current ratio of total assets to total shares outstanding, which is the vault's share price. The user receives those shares in their wallet, representing their proportional ownership of everything the vault holds.
From that point, the user does nothing. The AI manager monitors Polymarket's open markets, reads news feeds and public data sources, applies probability models to identify markets where the current price diverges from the estimated true probability, and submits capital deployment decisions to the vault. The vault enforces a maximum float cap, which is a configured limit on what percentage of total assets the manager can deploy at any given time, ensuring that a meaningful reserve always stays liquid for users who want to withdraw.
When a user is ready to withdraw, they submit a withdrawal request specifying how many shares they want to redeem. The vault creates a withdrawal ticket for that request and burns the shares into the ticket, removing them from circulation while preserving their claim on vault assets. When the vault has enough liquid assets to fill the ticket, which might be immediately or might require waiting for the manager to return deployed capital, the ticket is processed. The user receives the underlying token value of their shares at the time of processing and the ticket closes.
The key thing users never see is each other. A user's deposit amount is private. Their identity is not connected to their withdrawal request. The shares amount in a ticket is visible on-chain, but nothing links it to who the user is. Their share balance is private. What is public and verifiable is the total share supply, the total assets the vault holds, the share price at any given moment, and the vault's compliance with its configured risk parameters. The information that matters for trust is public. The information that enables exploitation is private.
Midnight is built around a distinction that most blockchains do not make: the difference between information that should be publicly verifiable and information that should remain known only to its owner. On Midnight, a smart contract simultaneously maintains a public ledger that anyone can read and a private state that only the relevant party can access, with zero-knowledge proofs connecting the two in a way that makes the private state verifiable without revealing it.
In the context of this vault, the public ledger stores the total share supply, the total float outstanding, the vault's configured parameters, and the pending withdrawal ticket count. Anyone can read these numbers and compute the share price. Anyone can verify that the float cap has not been exceeded. The Midnight network cryptographically attests that these numbers are correct and consistent with the actual state of the vault.
The private state is everything else. When a user deposits, the deposit amount is processed through a witness function that runs on the user's own machine. The output that goes on-chain is a zero-knowledge proof that the deposit happened correctly and that the vault's public numbers were updated accurately, without the actual deposit amount appearing anywhere on the public ledger. When the AI manager deploys capital to Polymarket, the positions are established through external transactions on Polygon where Polymarket operates, and the vault's float outstanding counter increments to reflect that capital has left, but no on-chain record connects the vault's float to specific Polymarket market positions. A competitor watching the Midnight blockchain sees only that the vault has deployed some amount of capital externally. They cannot see what markets the capital is in, which means they cannot copy the positions, front-run the exits, or reverse-engineer the strategy.
This is not just a privacy feature for user comfort. It is a structural competitive advantage that makes the strategy sustainable in a way that no EVM-based vault can replicate.
The AI manager is not a human watching a dashboard and manually executing trades. It is an autonomous agent that runs continuously, reads market data, applies analytical models, and produces capital allocation decisions that it submits to the vault contract for execution.
The agent's input layer aggregates several data sources in real time. Polymarket's Gamma API provides the full catalogue of open markets, current prices for YES and NO outcome tokens, trading volume, and resolution criteria. News APIs provide a stream of events and developments that affect the probability of outcomes in open markets. Historical Polymarket data provides a record of how prices moved in response to similar news events and how accurate the market's final prices were at various points in the market lifecycle.
The agent's decision layer applies a probability estimation model that compares the agent's computed probability of an outcome with the market's current implied probability. When the gap between these two estimates exceeds a threshold that accounts for the market's fee structure and the risk of the estimate being wrong, the agent identifies the market as a candidate for capital deployment. It then sizes the position based on a risk model that accounts for the agent's confidence in the estimate, the market's liquidity, and the vault's current float utilisation.
The agent's execution layer communicates with the vault contract to request float and then places orders on Polymarket through its CLOB client. When a position approaches resolution or when the agent's estimate of the outcome probability changes materially based on new information, the agent sends a signal to exit the position, returns capital to the vault, and the vault's float outstanding counter decrements accordingly.
The agent's performance is measurable. Every capital deployment and return is recorded on-chain as a change in float outstanding, and the net effect on total assets is visible in the share price over time. Users can verify that the vault is generating returns without knowing which specific markets those returns came from.
The vault operates on a share model that is mathematically equivalent to the ERC-4626 tokenised vault standard on Ethereum, adapted for Midnight's account model. Shares represent a proportional claim on the vault's total assets, where total assets is defined as the liquid balance held in the vault plus the float outstanding that the manager has deployed externally.
When a user deposits, they receive shares calculated as their deposit amount multiplied by the current total share supply divided by the current total assets. When the vault generates yield through successful prediction market positions, the total assets increase while the total share supply stays constant, which means each share becomes redeemable for more underlying tokens. This is how yield is distributed without any explicit distribution event. Users who hold shares simply find that their shares are worth more over time.
The share price at the time of a withdrawal request is not the price used to calculate the payout. The vault uses the share price at the time the withdrawal ticket is processed, which means users whose tickets sit in the queue while the vault generates profit receive that profit in their payout. This is the honest representation of what a managed vault is: a continuous claim on whatever the vault is worth at the moment of settlement, not a fixed promise made at the moment of request.
Rounding in all calculations goes against the user and in favour of the vault. When shares are calculated for a deposit, the depositor receives the floor of the mathematical result. When the payout for a withdrawal is calculated, the withdrawer receives the floor of their proportional claim. The fractional amounts that do not transfer accumulate in the vault as unclaimable dust, which effectively appreciates every share by an imperceptible amount over time. This is not an error. It is the same convention used by ERC-4626 and it is intentional at every calculation site.
The float cap limits the manager to deploying a maximum configured percentage of total assets at any time, expressed in basis points. If the cap is set at 8000 basis points, the manager can deploy up to 80 percent of total assets and must maintain at least 20 percent in liquid reserves at all times. This ensures the vault always has meaningful withdrawal capacity even when the manager is fully deployed.
No managed vault with verifiable on-chain accounting and private strategy execution has ever been built before, because no blockchain before Midnight supported both of those properties simultaneously. EVM-based vaults expose every position publicly. Privacy-focused blockchains like Zcash and Monero are not programmable enough to enforce the complex vault accounting logic. Midnight is the first chain where the computation required to run a vault with these properties is both expressible in a smart contract language and cryptographically private by default.
The combination of prediction market strategy with a tokenised vault wrapper is also novel. Polymarket has been used by individual traders and AI agents trading their own capital, but no vault product allows retail users to passively invest in a managed prediction market strategy the way they invest in a yield vault on Yearn or Morpho. The addressable market for this is every person who believes prediction markets generate alpha but lacks the time, capital, or technical ability to trade them directly.
The AI eligibility is genuine rather than incidental. The manager is not a human who happens to use an AI tool. The manager is an autonomous agent whose decisions are the only thing that determines whether the vault generates yield or not. The privacy of the strategy is only valuable because the AI is generating strategy worth protecting. The vault contract is only useful because the AI needs a trustless, permissionless mechanism to deploy and return capital without a custodian. Each component makes the others more valuable, which is the correct structure for a project that claims to be at the intersection of AI and privacy infrastructure.
The vault contract is written in Compact, Midnight's TypeScript-based smart contract language, and compiled to zero-knowledge circuits that run on the Midnight mainnet. The contract manages the share token, the withdrawal ticket queue, the float accounting, and the manager authority system entirely within its ledger and circuit logic.
The AI decision engine is a TypeScript application that runs off-chain. It reads from Polymarket's Gamma API and CLOB API, applies probability models built on historical market data and real-time news inputs, and calls the vault contract's manager circuits to request and return float based on its allocation decisions.
The user interface is a TypeScript web application that connects to the user's Midnight wallet, displays their current share balance and the vault's public metrics, and allows them to submit deposits and withdrawal requests.
In a world where Midnight has production interoperability with Polygon, the capital flow would be entirely on-chain and trustless. The Midnight vault contract would send a cross-chain message to a Polygon contract, that contract would fund the trading wallet or execute positions directly, profits would settle back on Polygon, and another cross-chain message would update the Midnight vault's float outstanding. No human or off-chain agent would need to touch capital in transit, and the ZK proofs on Midnight would verify the entire cycle.
For this demonstration, a Polygon wallet is pre-funded independently of the Midnight vault, which is the honest MVP scope of what we can show across a 48-hour hackathon window and reflects not a design choice but the current absence of a production bridge between Midnight and EVM chains. The off-chain coordination layer is a workaround for missing infrastructure, not something we consider a permanent feature of this architecture.
The reason we are optimistic rather than concerned is that the infrastructure to close this gap is already in motion. Charles Hoskinson confirmed at Consensus Hong Kong 2026 that the Cardano ecosystem, which Midnight is built upon as a privacy sidechain, will integrate with LayerZero, the omnichain interoperability protocol that currently supports over 120 blockchains and has secured more than 200 billion dollars in cross-chain transfer volume, enabling trustless message passing between Cardano-ecosystem chains and networks like Ethereum and Polygon. Midnight's own published roadmap includes a Hybrid DApps phase later in 2026 where the network's privacy layer becomes embeddable across multiple chains, which is precisely the architecture that would allow a Midnight vault to trustlessly move capital to Polygon for Polymarket execution and receive settlement back without the manager acting as a trusted intermediary for that flow. Solving the trustless capital path is not our problem to solve alone during this hackathon. It is the collaboration we are inviting by building the vault architecture that makes that solution worth having.
Midnight's mainnet genesis block was recently produced and the DeFi ecosystem on Midnight is essentially still budding. The Midnight DeFi Kernel, which is the foundation team's own project to bring private decentralised finance to the network, is still in research and development. And we're greatly excited to join this research and development effort to build a yield vault with managed funds generating returns through prediction market integrations.
This is the best possible time to build something foundational on a new network because being early means working on interesting and equally challenging problem sets that leads to experimentation and experience. Whatever vault design works on Midnight today will directly or indirectly inform every vault that follows, the same way Yearn's early designs informed how yield vaults work on Ethereum. The time is right, the field is completely open, and nothing has yielded yet.