Comprehensive Study Guide: B-Book V3 Systems and Risk Management
This study guide provides an exhaustive overview of the B-Book V3 system, designed to manage risk, detect sharp betting patterns, and optimize profitability in sports betting.
1. Introduction to B-Book Operations
What is a B-Book?
In sports betting, a B-Book (also known as "book-making") occurs when a betting operator decides to keep a player's bet rather than forwarding it to an external exchange like Betfair.
- The Analogy: Think of it like insurance. The operator "insures" the bet. If the player loses, the operator keeps the money as profit. If the player wins, the operator pays the player out of their own funds.
- The Strategy: Most operators use a Hybrid Model. They "A-Book" (forward) bets from "sharp" players who win often, and "B-Book" (keep) bets from recreational players who typically lose over time.
A-Book vs. B-Book Comparison
| Model | Mechanism | Risk | Profit Potential |
|---|---|---|---|
| A-Book | 100% of bets forwarded to an exchange. | Zero risk to the operator. | Low (2–5% commission). |
| B-Book | Operator keeps selected bets. | High exposure risk. | High (15–40% margin). |
2. The Agent Hierarchy and Cascade Engine
Hierarchy Structure
The system operates on a "tree structure" of agents.
- Platform Agent: The top-level operator (root). Anything not kept by lower agents ends up here.
- Regional/Master Agents: Mid-level managers.
- Direct Agents: The agents who interact directly with players.
- Visibility: Agents can see and manage everything below them in the tree, but nothing above them.
The Cascade Engine
The Cascade Engine is the brain of the system. It decides how much of a bet to keep at each level as the bet "flows" from the player up to the platform.
The Step-by-Step Bet Flow:
- Health Check: If the system is lagging or Betfair is down, the system automatically forwards 100% of bets to avoid "blind" risk.
- Top-Slice Reservations: Parent agents can "skim" a percentage (e.g., 10%) off the top before the cascade starts to ensure guaranteed revenue.
- Stake Reduction: The system checks limits. If a potential win is too high (e.g., over 50,000) or a player has already won too much today (200,000 limit), the stake is reduced.
- Per-Level Processing: At each agent level, the system checks:
- The Matrix: What percentage should be kept based on the bet type?
- Exposure Limits: Does the agent have enough "capacity" left to take this risk?
- Terminal Level: Anything remaining at the top is "hedged" (placed as a real bet) on Betfair.
3. Matrix Rules and Sharp Detection
The 5-Dimensional (5D) Forwarding Matrix
Agents don't just pick a random number to keep. They use a 5D Matrix to set granular rules.
| Dimension | Description |
|---|---|
| Market Type | What kind of bet is it? (e.g., Match Odds, Over/Under) |
| Sport Type | Which sport? (e.g., Cricket, Soccer) |
| Event Phase | Is it Pre-Match or Live (during the game)? |
| Source Type | What kind of bettor is it? (Normal, Sharp, VIP) |
| Liquidity Band | Is there a lot of money moving in this market? (High, Medium, Low) |
- Specificity Rule: If two rules match, the more specific one wins. For example, a rule for "Cricket" is more specific than a wildcard (*) rule for "All Sports."
Sharp Detection: The 5 Pillars
The system identifies "Sharp" bettors (professionals who win consistently) using five independent methods:
- CLV (Closing Line Value): Measures if a player consistently gets better odds than the final price when the game starts. (Weight: 30%)
- Device Fingerprinting: Detects if one person is using multiple accounts on the same phone/computer. (Weight: 15%)
- IP/Network Correlation: Identifies users sharing the same internet connection. (Weight: 10%)
- Betting Pattern Similarity: Flags users who place the exact same bets at the same time. (Weight: 20%)
- Payment Overlap: Flags accounts sharing the same bank accounts or UPI IDs. (Weight: 25%)
4. Risk Management and Safety Features
Exposure Management
The system tracks how much an agent stands to lose across different "Scopes":
- Global: Total risk across all bets.
- Sport/Market: Risk limited to a specific sport or event.
- Night/Weekly: Limits for specific times of the week.
- NO_NEW_RISK: If a limit is hit, the system stops keeping bets and forwards everything until the risk clears.
Book Balancing
This feature encourages "natural" balancing.
- Hedging Bet: If a bet helps balance the books (e.g., betting on the opponent of a heavily backed team), the agent gets a 10% bonus capacity.
- Worsening Bet: If a bet makes the risk more one-sided, the system may reduce how much the agent keeps.
Panic Mode (Emergency Control)
In an emergency, an agent can hit the "Panic Button."
- Immediate Action: 100% of new bets are forwarded; all current positions are immediately hedged on Betfair.
- Cost: To prevent abuse, the 1st and 2nd activations are free, but the 3rd+ activation costs the agent 100% of the hedging spread.
- Cooling-Off: Once activated, there is a mandatory 30-minute wait before deactivation.
5. System Integrity and Operations
Settlement and Reconciliation
- Settlement: When a game ends, the system calculates P&L. If the agent kept a losing bet, they profit (the stake). If they kept a winning bet, they lose (the payout).
- Reconciliation: Every night at 4:00 AM IST, the system compares its "Fast Tier" (Redis) with its "Source of Truth" (PostgreSQL) to ensure every paisa is accounted for.
Dead Letter Queue (DLQ)
When a bet fails to process, it goes to the DLQ.
- Retry Pipeline: The system tries 4 times immediately, then 3 more times at 5, 15, and 30-minute intervals.
- Escalation: If it still fails, it becomes "Escalated" and requires a human admin to manually fix or void it.
Alert System
| Severity | Examples | Notification |
|---|---|---|
| P1 (Critical) | Betfair Down, Hedge Failed, Agent Frozen. | Slack & Telegram |
| P2 (Warning) | Nightly Mismatch, DLQ Entry. | Slack |
| P3 (Info) | General system updates. | UI Dashboard |
6. User Interface (UI) Overview
Agent-Facing Pages
- Dashboard: Features the "Sleep-Well Number" (utilization %) and "Risk Thermometer."
- Bet History: Ledger of all bets with "Routing Badges" (Retained, Forwarded, Split).
- Exposure Drill-Down: Detailed view of risk across all sports and markets.
- Matrix Editor: Where agents set their 5D forwarding rules.
- Bet Simulator: A "dry-run" tool to see how a potential bet would be handled.
- User Management: Tool for classifying players (Normal vs. Sharp).
- Sharp Analytics: Deep dive into the 5 pillars for specific players.
- Collusion Detection: Monitors if agents are "gaming" player classifications.
- Hierarchy Visualization: A tree-view map of agents and players.
- Settings: Configuration for defaults, limits, and timezones.
- Setup Wizard: Onboarding for new agents (Conservative, Moderate, or Aggressive presets).
Admin-Facing Pages
- Admin Dashboard: System-wide health and circuit breaker states.
- Failed Bets (DLQ): Management of failed operations.
- Reconciliation Page: Tool to trigger manual recomputes of exposure data.
7. Glossary of Key Terms
- Paisa: 1/100th of a currency unit; used for integer arithmetic to avoid rounding errors.
- Liability: The amount an agent stands to lose on a bet.
- Hedge: Placing a bet on an external exchange to offset risk held internally.
- Cooling-Off Period: A mandatory waiting time before a change (like a classification or Panic Mode) can be reversed.
- Circuit Breaker: A safety mechanism that stops certain operations to protect the system during outages.
- Top-Slicing: A guaranteed percentage of a bet taken by a parent agent before anyone else.
8. Practice Questions
Short-Answer
- What is the difference between an A-Book and a B-Book?
- List the 5 dimensions used in the Matrix Rule engine.
- What happens to a bet if the "Health Check" fails?
- Describe the two tiers of the Exposure Ledger.
- Explain the "3rd activation" rule for Panic Mode.
Essay Prompts for Deeper Exploration
- Risk vs. Reward: Analyze why an operator might choose an "Aggressive" setup in the Setup Wizard versus a "Conservative" one. What are the long-term implications for their margin?
- Combating Fraud: How does the combination of Sharp Detection and Collusion Detection protect the integrity of the Platform Agent? Explain the importance of the "Cooling-Off Period" in this context.
- The Role of Automation: Discuss how the Dead Letter Queue and the Cascade Engine work together to ensure that "no money is created or lost" (Stake Conservation).