Developer Hub
🔮 For applications
Guides & Tutorials
Advanced integration
Live betting
Overview

Live betting overview

Azuro streamlines live betting, offering speed, security, and convenience.

For the bettors, it means that after approving a spending limit for the Relayer gas fees, users can go ahead and place bets just by signing messages in their Web3 wallet.

For the betting apps, it means that our smart contracts take care of monitoring live updates, creating and resolving events, as well as connecting relayers to send the prepared bets for processing.

ℹ️

Live smart contracts

HostCore: Registers a new game or maintains the life cycle of a game. It also registers game condition odds and provides essential game information to offchain interfaces.

LiveCore: Monitors the state of events, accepts bets based on parameters like outcome, odds, amount. Uses a snapshot-saving approach for late bets. Bets placed after the event's resolve time are saved with timestamps and are eligible for cancellation and refund.

Relayer: Sends prepared bets for execution and receives rewards for bet processing.

Getting live data: two approaches

The HostCore smart contract on the HostChain (currently Gnosis chain) stores all live games and markets data.

Adapting your UI

Live betting is very dynamic. We suggest you incorporate the following recommendations to improve user experience and keep your bettors well-informed.

Selective event display:

Not all the events you have in pre-match betting are going to be available to place live bets on.

ℹ️

When a game goes live, its ID is stored in a different smart contract. To display these live games in your UI, you'll need to fetch their details from the LiveDataFeed (opens in a new tab) subgraph. Games should be filtered by 'Created' status for live display. Make sure your UI reflects this. For example, it might be preferable to display for betting only those events that are actually available for live betting and not all events you get.

Relayer gas fees:

We suggest you make a disclaimer about Relayer fees to communicate to your users that neither your frontend, nor Azuro benefit from the Relayer gas fees.

ℹ️

Consider that before each order request you'll need to ensure that the user has approved enough tokens for bet itself and a fee for relayer that will compensate his native currency spending. So the spending limit should be equal or higher than order.amount + order.relayerFeeAmount.

EIP712 Signature:

Follow the implementation guide (opens in a new tab) and add a text message to capture user consent in the attention field (within 160 chars).

Error / bet status handling:

Implement clear communication regarding any errors (opens in a new tab) or changes in bet status.

ℹ️

Live bet data isn’t immediately displayed in the Graph, since a live bet goes through several steps before its transaction is processed by the blockchain:

  1. Created: a bet order has been registered in the system and waits a Relayer to handle it.
  2. Pending: relayer has started handling the order.
  3. Sent: transaction has been sent to a blockchain by a Relayer.
  4. Accepted: transaction succeeded, order has been accepted by a smart contract.
  5. Rejected: bet order has been rejected, display the error message (make sure to formulate error messages that are clear for the users - find a list of errors here (opens in a new tab))