Odds Mathematics
Fanify introduces a decentralized model where odds are calculated transparently based on real-time social sentiment ("hype"). Here's how the process works:
Workflow Overview
- Data Collection: Social media posts are gathered based on a campaign-specific hashtag (e.g.,
#Chiliz_CHExPSG_20250713
). - Sentiment Classification: AI models classify each post with a probability of support for each team.
Example:
Tweet: "Vai PSG!!!" → Team A: 93%, Team B: 17% - Vote Aggregation: Each post contributes its scores to a weighted count.
Team A: 92, Team B: 48 → Total Votes: 140 - Hype Calculation: The system calculates the normalized hype share using a time-smoothed approach (see Anti-Spam section):
- HypeA = 92 / 140 = 65.71%
- HypeB = 48 / 140 = 34.28%
- Odds Generation: Using the hype distribution, the system calculates initial odds, subject to refinement based on the size of each betting pool.
- On-chain Storage: All hype and match data is stored in a decentralized oracle and used in prize calculation within the smart contract.
Smart Contract Summary
The Fanify.claim
contract performs the following:
- Validates if the user is eligible to claim a prize (match ended, no draw, valid bet, winner).
- Fetches hype data and match result from the oracle.
- Computes dynamic odds using
_getOdds()
. - Calculates prize based on user's stake, odds, and the final pool.
- Deducts house fee and distributes rewards proportionally.
Mathematical Model
Let:
- , : Hype scores (e.g., 0.6571 and 0.3428)
- , : Total amount staked on Team A and B
- , : Calculated odds for Team A and B
- : Amount the user staked
- : Winning team
- : House fee (e.g., 5% → )
- : Total prize pool
1. Odds Calculation
Odds are inverse to the normalized hype score, adjusted to reflect risk:
2. Prize Pool after Fee
3. Total Weighted Winning Side
4. User Payout
Anti-Spam: Hype Normalization & Weighting
To mitigate spam, sybil attacks, and manipulation by influencers, we propose a multi-layered data weighting system that ensures hype changes gradually, requiring consistent support over time:
1. Reputation-Weighted Posts
Each post receives a weight based on:
- Account age
- Follower count
- Verified status
- Engagement (likes, RTs)
- Bot score (inverse)
Where are tunable coefficients.
To limit the influence of any single user or coordinated group (e.g., an influencer and their followers), the weight is capped:
Where is the maximum weight per post (e.g., 10).
2. Penalizing Coordinated Posts
To prevent influencers from coordinating similar posts, a penalty is applied based on post similarity (e.g., using text embedding cosine distance):
Where is a penalty factor (e.g., 0.5), and measures how similar the post is to others.
3. Time Decay (Opcional)
Weight diminishes over time before match start to avoid last-minute manipulation:
Where:
- : timestamp of post
- : decay constant
4. Exponential Moving Average for Hype
To ensure hype changes gradually and resists sudden manipulation, an exponential moving average (EMA) is used. For each time interval (e.g., hourly), the hype for Team A is updated as:
Where:
- : Hype for Team A at time
- : Weighted average support in the current interval, calculated as:
- : Support probability for Team A (Team B gets )
- : Smoothing factor (e.g., 0.1), controlling how slowly hype changes
- : Hype from the previous interval
The hype for Team B is:
This ensures the sum of all influence is bounded and requires consistent, high-quality posts over time to significantly alter the hype.
Benefits
- Sybil and influencer resistance: Weighted participation, capped weights, similarity penalties, and EMA ensure that no single user or group can dominate hype without sustained effort.
- Transparent math: All formulas can be audited and reproduced.
- Composable: Can be extended with additional on-chain data sources (e.g., verified Discord accounts, fan NFTs, etc.)