-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from Azuro-protocol/dev
Merge dev branch
- Loading branch information
Showing
28 changed files
with
243 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Callout } from 'components' | ||
|
||
# ClientCore (Live betting) | ||
|
||
<Callout type="warning"> | ||
The page is under construction | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Callout } from 'components' | ||
|
||
# HostCore (Live betting) | ||
|
||
<Callout type="warning"> | ||
The page is under construction | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Callout } from 'components' | ||
|
||
# Relayer (Live betting) | ||
|
||
<Callout type="warning"> | ||
The page is under construction | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
{ | ||
"get-games": "Get Games", | ||
"markets-and-outcomes": "Prepare Game Markets", | ||
"get-odds-values": "Get Odds Values", | ||
"real-time-odds-updates": "Real-time Odds Updates", | ||
"place-a-bet": "Place a Bet", | ||
"get-bets-history": "Get Bets History", | ||
"redeem-bets": "Redeem Bets", | ||
"handle-contract-errors": "Handle Contract Errors", | ||
"affiliate-ggr": "Get bets made on specific Front(Affiliate)", | ||
"azuro-score": "Azuro Score leaderboard", | ||
"prematch": "Prematch", | ||
"live": "Live betting", | ||
"freebets": "Freebets", | ||
"---": { | ||
"type": "separator" | ||
}, | ||
"freebets": "Freebets" | ||
"handle-contract-errors": "Handle Contract Errors", | ||
"affiliate-ggr": "Get bets made on specific Front(Affiliate)", | ||
"azuro-score": "Azuro Score leaderboard" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"overview": "Overview", | ||
"data-retrieval": "Data retrieval", | ||
"place-a-bet": "Place a bet" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { Callout } from 'components'; | ||
|
||
# Live data retrieval | ||
|
||
All the live games and markets data is stored in the [`HostCore`](/contracts/live-host-core) smart contract in the `HostChain` (currently is a Gnosis chain) | ||
and can be retrieved via a [`LiveDataFeed`](/subgraph/overview#live-endpoints) subgraph. | ||
|
||
Data structure is almost the same as the one in the main Subgraph for prematch core contracts. | ||
|
||
<Callout type="info"> | ||
Key differences in the entities structure comparing to prematch subgraphs: | ||
|
||
- Removed all entities and events related to bets (bets, freebets, expresses) and contracts (cores, liquidity pools). | ||
- Removed `selection` entity and its relations. | ||
- Entity `condition` doesn't have an `isExpressForbidden` field. | ||
- Event `GameShifted` changed to `GameUpdated` (triggers by changing game status and/or start time). | ||
- Event `ConditionShifted` completely removed. | ||
</Callout> | ||
|
||
Typical data feed lifecycle: | ||
|
||
1. `Game` appears in the `LiveDataFeed` subgraph in the `Created` state. It means that the game is in live state. | ||
2. `Conditions` start to appear in this game (usually they start to appear almost when the game starts and finish appearing in 5-10 minutes). | ||
3. During the game each `Condition` can change its state between `Paused` and `Created`. Also condition's odds can be changed. | ||
4. `Game` finishes and its status changes to `Finished`. | ||
5. After some period `Conditions` start to finalize their status to `Resolved`/`Canceled`. | ||
6. After all `Conditions` are resolved, the game change its status to `Resolved`. | ||
|
||
## How to display live games and markets | ||
|
||
Here we'll describe the logic of displaying live games and their markets. | ||
Supposed that you already have a frontend with setup prematch games. | ||
|
||
### Load live games | ||
|
||
When game goes live, it saves its id (so the same game in prematch and live subgraphs have the same `gameId` value), | ||
but it's stored in another smart contract, and you should load its info from another subgraph called [`LiveDataFeed`](/subgraph/overview#live-endpoints). | ||
|
||
We recommend you to call a snapshot of live games almost the same way you did it for prematch games (see [Get Games](/guides/prematch/get-games) section), but you need to filter them by `Created` status: | ||
|
||
```ts | ||
useQuery(QUERY, { | ||
variables: { | ||
where: { | ||
status: 'Created', | ||
hasActiveConditions: true, // Avoid this parameter if you want to get the game with no available markets | ||
}, | ||
}, | ||
}) | ||
``` | ||
|
||
<Callout type="warning"> | ||
While most of the games that we provide in prematch will go live, we don't guarantee it for each particular game. | ||
Consider this when planning your UX. | ||
</Callout> | ||
|
||
<Callout type="feature"> | ||
If you want to effectively update your games list without querying big snapshots each time, you need to listen to the following events in the `LiveDataFeed` subgraph: `NewGame`, `GameUpdated`, `GameCanceled`. | ||
For each new event you can get its `gameId` field and retrieve an actual game's info. | ||
</Callout> | ||
|
||
### Load markets | ||
|
||
For each live game you can request its markets (called `conditions`) the same way you do this for prematch games (see [Prepare game markets](/guides/prematch/markets-and-outcomes) section). | ||
|
||
<Callout type="warning"> | ||
Take into consideration that markets appear after the game created in the `HostCore` smart contract. | ||
It means that this is a normal situation if a game doesn't have any live markets for a while. | ||
You should continue to request game markets all the time and be ready to add a new ones until the game is finished. | ||
</Callout> | ||
|
||
### Get realtime markets updates | ||
|
||
As for prematch games, live game's markets are constantly updated: | ||
|
||
- Market can be stopped and unstopped. | ||
- Outcomes odds can be changed. | ||
|
||
For market stop/unstop action you need to listen to new `ConditionStopped` events in `LiveDataFeed` subgraph and then request the actual condition's state. | ||
|
||
For odds changes you need to listen to our `HostCore` smart contract event `OddsChanged` (the same way as described in [Real-time Odds Updates](/guides/prematch/real-time-odds-updates) section for prematch, just use the `HostCore` contract). | ||
|
||
### Finish a game | ||
|
||
When game finishes, its status changes on `Finished` until it has unsettled markets. | ||
When all markets are settled, its status changes on `Resolved`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Live betting overview | ||
|
||
Live betting, also known as in-play betting, allows users to place bets on sport events as they are happening. | ||
Unlike traditional betting, which is done before an event starts, live betting offers dynamic odds that change as the game progresses. | ||
|
||
In Azuro we are providing a live betting in the most user-friendly way to make it fast and convenient. | ||
It means that the user needs only to approve a spending limit of the betting token (only once) for our `Relayer` smart contract, | ||
and then he can place his bets just by signing messages in his EVM wallet. | ||
|
||
Technically, in Azuro, live betting feature is split by two major parts: | ||
|
||
- [Data feed](/guides/live/data-retrieval). | ||
- [Bets management](/guides/live/place-a-bet). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Callout } from 'components' | ||
|
||
# Place a bet | ||
|
||
<Callout type="warning"> | ||
The page is under construction | ||
</Callout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"get-games": "Get Games", | ||
"markets-and-outcomes": "Prepare Game Markets", | ||
"get-odds-values": "Get Odds Values", | ||
"real-time-odds-updates": "Real-time Odds Updates", | ||
"place-a-bet": "Place a Bet", | ||
"get-bets-history": "Get Bets History", | ||
"redeem-bets": "Redeem Bets" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 11/20 Live betting in Polygon Mumbai testnet | ||
|
||
## Introduction | ||
|
||
The Azuro Protocol team is excited to announce the launch of most anticipated feature - | ||
**live betting** in Polygon Mumbai testnet for all Azuro Protocol frontend operators. | ||
In this update, we introduce the concept of live betting, | ||
guides for markets data retrieval and gasless betting using Azuro Live Betting API. | ||
|
||
[Contracts](/contracts/live-host-core) / [Subgraph](/subgraph/overview#live-endpoints) / [Guides](/guides/live/overview) | ||
|
||
## Smart contracts | ||
|
||
We have added new smart contracts for live betting: | ||
|
||
- [`HostCore`](/contracts/live-host-core) in Gnosis chain for games and markets storing. | ||
- [`LiveCore`](/contracts/live-client-core) in Polygon Mumbai chain for bets storing. | ||
- [`Relayer`](/contracts/live-relayer) in Polygon Mumbai chain for processing a new bets. | ||
|
||
## Subgraph | ||
|
||
We have added new [Subgraphs](/subgraph/overview#live-endpoints) for indexing of new smart contracts: | ||
|
||
- `HostCore` subgraph for indexing of `HostCore` contract in the Host chain. | ||
- `LiveCore` subgraphs for indexing of `LiveCore` contracts in the Client chains. | ||
|
||
## Azuro Live Betting API | ||
|
||
We have added a new API for bets registering and processing. This API allows to place an [`order`](/concepts/glossary#order) (signed bet request) and track its status. | ||
|
||
- `POST /orders` endpoint for adding a new order. | ||
- `GET /orders/:id` for retrieving an order actual state. | ||
|
||
## Conclusion | ||
|
||
With implementing of Live betting feature we're expecting a significant increase in betting turnover and an interest in Web3 betting at all. | ||
|
||
We've tried to make a technical implementation of the feature as easy as possible. | ||
|
||
If you have any questions or need further assistance, please don't hesitate to reach out to the Azuro Protocol team. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.