> For the complete documentation index, see [llms.txt](https://vizo.gitbook.io/vizo-exchange-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vizo.gitbook.io/vizo-exchange-docs/documentation/basics/images-and-media-1.md).

# 6. Core Betting Feature Module

## 6.1 Market Management Module&#x20;

* **Creation Phase**: Every Monday, the system automatically generates markets based on the asset's volatility from the previous week. Once a market is generated, it cannot be changed. The range for a single market should not exceed 5 to prevent excessive fund dispersion.
* **Cut-off Phase**: Betting stops 30 minutes before closing, the market is locked, and awaits settlement.
* **Settlement Phase**: After market close, the oracle fetches the official closing price, and the system determines the winner/loser based on the price and distributes the prize pool.
* **Dispute Phase (if triggered)**: If the oracle is abnormal or the price difference exceeds a threshold, it enters a 24-72 hour dispute window.
* **Archiving Phase**: After settlement is complete, the results and fund distribution are recorded on-chain and archived in historical market records.
* **Market Merging Mechanism**: If a market pool's depth is too low (depth $< X$ USDT), the system can automatically merge adjacent ranges to ensure market liquidity.<br>

***

## 6.2 Betting Process Module&#x20;

* **Feature Description**: Users can place bets from the market creation until 30 minutes before the US stock market closes. All funds enter an escrow contract and cannot be withdrawn early.
* **Sub-features**: Betting entrance, payment methods, prize pool display, limit mechanism, multi-market betting.
* **Technical Requirements**: Smart contracts support multi-market fund pools; front-end real-time prize pool update.
* **Single Account Betting Limit**: The betting amount for a single account on a single market ≤X% (suggested 5%) of the current market pool's total amount, or ≤Y USDC (whichever is lower).<br>

***

## 6.3 Settlement and Reward Module

* **Feature Description**: After market close, the oracle fetches the official closing price, and the system determines the winner/loser based on the price and distributes the prize pool.
* **Sub-features**: Price acquisition, result determination, prize pool distribution, result on-chain recording, historical archiving.
* **Technical Requirements:** Oracle multi-data source cross-validation; contract automatic settlement.
* **Settlement Formula (Parimutuel Contract Pool Model):**&#x20;
  * S<sub>i</sub>​: total bet amount for the i-th result (range/option).&#x20;
  * S<sub>all</sub>: Total amount in the entire pool&#x20;
  * T: Platform rake/fee rate (set to 0 during the testing period, so T=0)&#x20;
  * W: Set of winners corresponding to the actual result&#x20;
  * S<sub>w</sub>: Total bet amount for the winning option (sum of all winners' principal)&#x20;
  * S<sub>u</sub>: Bet amount of a certain winner&#x20;
* Then the final payout (including principal) for winner $u$ is:&#x20;

<details>

<summary><img src="/files/73udJrwPr06K2fWqW9lG" alt=""></summary>

</details>

**Notes**: After deducting fees from the entire pool (including the loser's money and the winner's principal), the amount is distributed according to the ratio of each winner's stake to the total stake of the winning side.<br>

***

## 6.4 Odds and Transparency Module&#x20;

* **Feature Description**: Provides real-time odds and potential profit display.
* **Sub-features**: Real-time odds, estimated profit, proof of fairness.
* **Technical Requirements**: Front-end synchronization of odds with the contract; data snapshot support.
* **Specific Odds Algorithm**&#x20;

  * **Range Type**:&#x20;

  Odds for Pool A = (Amount in Pool B + Amount in Pool C + ......) / Amount in Pool A + 1

  * **Crypto 10-Minute Up/Down Type**:&#x20;

  Odds for Up direction = Total amount in Down direction pool/Total amount in Up direction pool + 1

  * **Stock Daily Up/Down Type**:&#x20;

  Odds for Up direction = Total amount in Down direction pool/Total amount in Up direction pool + 1

  * **Dual-Asset Competition Type**:&#x20;

  Odds for Asset A = Total amount in Asset B pool / Total amount in Asset A pool + 1

***

## 6.5 History and Personal Center Module&#x20;

* Feature Description: Provides user's betting history, win rate, and profit data.
* Sub-features: Betting records, win rate statistics, profit curve.
* Technical Requirements: On-chain data indexing (The Graph); front-end chart visualization.<br>

***

## 6.6 Auxiliary Modules&#x20;

* Community Interaction: Discussion area, posting linked bets, leaderboard.
* AI Assistant: Data access, opinion summary, personalized recommendations.
* Follow Bet Feature: One-click follow bet, forming a social trading chain.<br>

***

## 6.7 Contract Permissions and Fund Security&#x20;

#### **1) Fund Escrow**:&#x20;

All betting funds enter an Escrow contract and cannot be withdrawn before settlement.

#### **2) Permission Allocation Table:**&#x20;

* Multisig Admin: Can only execute Emergency Pause, trigger Oracle update.
* DAO: Possesses market parameter governance rights and dispute arbitration rights.
* Contract Logic: Automatically responsible for receiving bets, market settlement, and prize pool distribution.

#### **3) Timelock Mechanism**:&#x20;

All administrator operations must be announced 24 hours in advance and written into an on-chain Timelock.

#### **4) Insurance Pool:**&#x20;

A portion of the transaction fees enters the insurance pool, used for processing arbitration refunds and systemic risks.

***

## 6.8 Oracle and Settlement Fallback Rules

**Data Source Priority:**&#x20;

1. Primary Data Source: Chainlink Consolidated Feed (aggregated Nasdaq/NYSE closing price).
2. Backup Data Source: Nasdaq/NYSE Official API.
3. Redundant Sources: Bloomberg / Yahoo Finance / AlphaVantage.<br>

**Determination Mechanism:**&#x20;

* If the primary data source is available → Use directly.
* If the primary data source is unavailable → Take the median of the backup and redundant sources.
* If the difference between the highest and lowest source data exceeds X% (default $0.5\\%$) → Enter the dispute window.<br>

**Dispute Mechanism:**&#x20;

* Dispute period is 24–72 hours, with the final price decided by DAO or Multisig arbitration.
* Arbitration results are publicly announced on-chain, and relevant evidence is archived.
* If there is no closing price due to a trading halt/delisting, the last available trading day price or the exchange announcement price shall prevail.<br>

***

## 6.9 Anti-Cheating Mechanism&#x20;

* **Multi-Account Detection:** Identifies malicious multi-opening based on device fingerprints and on-chain address graphs.
* **Large Order Alert**: If a single bet exceeds 20% of the market pool's total amount, a risk control review is triggered.
* **Anomaly Detection**: Uses an ML model to monitor betting frequency and amount distribution to identify arbitrage bots and cheating patterns.
* **User Protection**: Provides self-limit features (daily/weekly betting limit, cool-off period lock).<br>

***

## 6.10 Extreme Market Environments&#x20;

In case of large-scale trading halts, circuit breakers, or exchange technical failures, the markets will be automatically closed, settlement will be automatically delayed, and manual arbitration will be performed.

***

## 6.11 Asset Planning and Launch Pace (TBA)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vizo.gitbook.io/vizo-exchange-docs/documentation/basics/images-and-media-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
