Settlement System
CloudBank uses an optimistic settlement model where market creators propose outcomes that are accepted after a liveness period unless disputed. This is supplemented by an AI-powered auto-settlement system for expired markets.
Optimistic Settlement Flow
The optimistic model minimizes oracle usage by assuming honest behavior and only escalating to an oracle when disputes arise.
Proposal Phase
After a market's end time passes, the creator calls proposeOutcome() with their reported result. This transitions the market from TRADING to PROPOSED and starts the liveness countdown. The creator's initial stake serves as a bond backing their proposal.
Liveness Period
During the liveness window, anyone can inspect the proposed outcome. If the outcome is correct, no action is needed — the market will settle automatically once the period expires. The liveness duration is configured per-market at creation time.
Dispute Mechanism
If a participant believes the proposed outcome is incorrect, they can call dispute() during the liveness period. This:
- Transitions the market to DISPUTED state.
- Escalates resolution to the SoraOracle.
- Pauses the liveness timer until the oracle responds.
The disputer does not need to post a counter-bond; the dispute mechanism is designed to be accessible.
SoraOracle
The SoraOracle is a minimal on-chain oracle designed for binary (yes/no) question resolution.
Resolution Flow
- A question is registered with the oracle, including a plaintext description and a designated provider address.
- The provider submits an answer (YES or NO).
- A 7-day refund period begins after the answer is submitted, during which the answer can be challenged or corrected.
- After the refund period, the answer is finalized and the SoraYesNoOracleAdapter translates it into a CTF-compatible payout vector.
Provider Model
Oracle providers are trusted addresses authorized to answer specific questions. The current implementation uses a single-provider model where each question is assigned to one resolver.
AI Auto-Settlement (Sora Keeper)
The Sora Keeper is an automated settlement agent powered by Coze AI that handles routine market resolution without human intervention.
Process
- Scan — The keeper periodically queries for markets past their end time that remain in TRADING state.
- Data Collection — For each expired market, the keeper fetches relevant data from multiple sources (news APIs, sports feeds, financial data providers).
- Cross-Validation — The AI cross-references data across sources to determine the outcome with high confidence.
- Submission — If confidence exceeds the threshold, the keeper submits a
proposeOutcome()transaction as the market creator's delegate. - Monitoring — The keeper monitors the liveness period for disputes and can provide evidence if challenged.
This system ensures markets resolve promptly even when creators are inactive, improving the user experience for position holders waiting to redeem.
CTF Redemption
After a market reaches RESOLVED state, position holders redeem their winnings through the Gnosis Conditional Tokens Framework:
- The CTF's
reportPayouts()has been called with the final payout vector (e.g.,[1, 0]for YES wins). - Holders of winning positions call
CTF.redeemPositions(), burning their ERC-1155 tokens. - The CTF releases the proportional collateral to the redeemer.
Losing positions have zero redemption value. In the case of a CANCELLED market, both YES and NO tokens are redeemable at equal value, returning the original collateral.
Anti-Spam Staking
To prevent low-quality or spam markets, creators must deposit a stake when creating a market. This stake:
- Is refunded upon valid settlement (market resolves normally).
- Is slashed if the market is cancelled due to invalid parameters, duplicate questions, or malicious intent.
- Serves as the creator's bond during the optimistic proposal phase.
The stake amount is configured globally by the platform administrator and can vary by market category.