# Sportsbook

**Concept**

Many decentralized betting platforms fall short of true decentralization. Often, they grant specific actors or roles the authority to create events and determine outcomes, which can lead to significant control and potential manipulation of the protocol. Some platforms labeled as “decentralized” only utilize blockchain for deposit and withdrawal functions while keeping the core infrastructure centralized.

Conversely, decentralized betting protocols that implement peer-to-peer (P2P) betting models, while decentralized in theory, impose substantial operational burdens on users. These platforms require users to create their own events, set odds, and find matching bets, leading to an inefficient and cumbersome experience.

Our objective is to establish a genuinely decentralized betting platform where all processes are automated, eliminating the need for human intervention. We aim to deliver an experience comparable to traditional betting platforms while ensuring complete backend decentralization.

**Architecture**

To build an efficient and reliable betting platform, we leverage the mature Solana ecosystem for robust, out-of-the-box solutions and integrate them with our proprietary smart contracts. The platform architecture comprises three primary components:

**1. Event Layer**

* **Functionality:** This component acts as an event oracle, continuously providing sports and other event data to the blockchain. The events, including possible outcomes and associated odds, are then displayed on our platform. The use of decentralized oracles ensures trustlessness and maintains the integrity of decentralization.

**2. Settlement Layer**

* **Functionality:** The settlement smart contract manages bets by interfacing with other modules and storing relevant information. It operates as a proxy smart contract and performs the following tasks:

  * **Integration with Monaco Protocol:** Utilizes the Monaco Protocol for decentralized event management, including event creation, betting, bet matching, and odds discovery.
  * **Event Referencing:** Associates bets with specific events provided by the oracle, allowing the contract to resolve outcomes based on oracle data.

  **Workflow:**

  * Receive a new bet and decide whether to create a new event or place a bet on an existing event.
  * Execute the bet or event creation through the Monaco Protocol.
  * Store the reference to the oracle event and its parameters.

**3. Outcome Layer**

* **Functionality:** Once an event outcome is available, it must be finalized and funds distributed. This is facilitated by the proxy settlement smart contract through the following processes:

  * **Outcome Oracle Interaction:** Allows the settlement function to be triggered by any participant, maintaining decentralization.
  * **Monaco Protocol Integration:** Issues instructions to close the bet and distribute funds according to the outcome provided by the oracle.

  **Workflow:**

  * Monitor for new outcomes from the outcome oracle using an off-chain agent.
  * Initiate a transaction to trigger the outcome function in the settlement smart contract.
  * Validate the outcome from the oracle and identify the relevant event.
  * Close the event by instructing the Monaco Protocol and finalizing the process in the settlement smart contract.
