Skip to content

Commit

Permalink
Merge pull request #64 from Azuro-protocol/live
Browse files Browse the repository at this point in the history
Re-grouped guides menu
  • Loading branch information
alvik48 authored Nov 20, 2023
2 parents 2f9ec37 + de4b0a8 commit 6e1a5fb
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion pages/contracts/proxy-front.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ProxyFront is a proxy contract designed to facilitate interaction with a Liquidity Pool contract. The contract provides functions for making bets and withdrawing payouts in batches.

Right now it provides 2 methods for [batch redeem](/guides/redeem-bets#batch-redeem) and [batch betting](guides/place-a-bet#place-a-batch-of-single-bets).
Right now it provides 2 methods for [batch redeem](/guides/prematch/redeem-bets#batch-redeem) and [batch betting](guides/place-a-bet#place-a-batch-of-single-bets).

### Reference

Expand Down
21 changes: 6 additions & 15 deletions pages/guides/_meta.json
Original file line number Diff line number Diff line change
@@ -1,20 +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",
"---": {
"type": "separator"
},
"prematch": "Prematch",
"live": "Live betting",
"freebets": "Freebets",
"----": {
"---": {
"type": "separator"
},
"live": "Live betting"
"handle-contract-errors": "Handle Contract Errors",
"affiliate-ggr": "Get bets made on specific Front(Affiliate)",
"azuro-score": "Azuro Score leaderboard"
}
4 changes: 2 additions & 2 deletions pages/guides/freebets/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Let's consider the life cycle of a free bet, omitting technical details:
_How-to in [Distribution guide](/guides/freebets/distribute-freebets) section._
2. The user accesses your application's UI, sees a notification that a freebet is available to them until a certain date.
_How-to in [Use freebets](/guides/freebets/use-freebets) section._
3. The user places a bet using the provided freebet*. _(How-to in [Place a bet](/guides/place-a-bet#place-a-freebet) section)_
3. The user places a bet using the provided freebet*. _(How-to in [Place a bet](/guides/prematch/place-a-bet#place-a-freebet) section)_
4. After the event is resolved:
* If the bet wins, when the user claims their winnings (_how-to in [Redeem bets](/guides/redeem-bets#freebet-redeem) section_), they receive a profit from the win (payout - freebet amount),
* If the bet wins, when the user claims their winnings (_how-to in [Redeem bets](/guides/prematch/redeem-bets#freebet-redeem) section_), they receive a profit from the win (payout - freebet amount),
and the amount of the issued freebet is returned to the freebet contract balance.
* If the bet loses, the freebet amount contributes to the revenue of the LP with your affiliate address.

Expand Down
5 changes: 2 additions & 3 deletions pages/guides/freebets/use-freebets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Api returns all available to claim freebets for specified bettor (status: `New`

### Use freebet to place a bet

If you're not familiar with generic logic around placing a bet, please read [Guides section](/guides/place-a-bet) first.
If you're not familiar with generic logic around placing a bet, please read [Guides section](/guides/prematch/place-a-bet) first.

<Callout type="warning">
To apply freebet, `outcome.rawMinOdds` should be greater than `freebet.minOdds`. The bet should be single - freebets aren't applicable to combo bets.
Expand Down Expand Up @@ -174,5 +174,4 @@ const tx = await freebetContract.connect(signer).withdrawPayout(bet.freebet.free
```

All details about bet history and base logic of redeem, please read in Guides section:
[Bet history](/guides/get-bets-history) & [Redeem Bets](/guides/redeem-bets)

[Bet history](/guides/prematch/get-bets-history) & [Redeem Bets](/guides/prematch/redeem-bets)
6 changes: 3 additions & 3 deletions pages/guides/live/data-retrieval.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Supposed that you already have a frontend with setup prematch 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/get-games) section), but you need to filter them by `Created` status:
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, {
Expand All @@ -61,7 +61,7 @@ useQuery(QUERY, {

### 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/markets-and-outcomes) section).
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.
Expand All @@ -78,7 +78,7 @@ As for prematch games, live game's markets are constantly updated:

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/real-time-odds-updates) section for prematch, just use the `HostCore` contract).
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

Expand Down
9 changes: 9 additions & 0 deletions pages/guides/prematch/_meta.json
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.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ sendTransaction(txDto)
To send a batch of single bets you should use [ProxyFront](/contracts/proxy-front) contract.

<Callout type="info">
Note that data structure differs from the structure of [placing single bet on LP contract](/guides/place-a-bet#place-a-single-bet).
Note that data structure differs from the structure of [placing single bet on LP contract](/guides/prematch/place-a-bet#place-a-single-bet).
</Callout>

<Tabs items={[ 'Ethers', 'Wagmi' ]}>
Expand Down Expand Up @@ -420,7 +420,7 @@ It's important to ensure that the user has sufficient funds in their account bef
gracefully if the bet cannot be placed due to insufficient funds or other reasons.

Keeping the odds updated is essential for providing the best user experience to your customers. By
[subscribing to odds updates](/guides/real-time-odds-updates), you can keep the odds values up-to-date in real-time,
[subscribing to odds updates](/guides/prematch/real-time-odds-updates), you can keep the odds values up-to-date in real-time,
which can help reduce the risk of user frustration or missed betting opportunities. Alternatively, you can
[fetch the odds values](/guides/get-odds-values) before a user submits a bet to ensure that the odds values are current
[fetch the odds values](/guides/prematch/get-odds-values) before a user submits a bet to ensure that the odds values are current
at the time of the bet placement.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ eventEmitter.subscribe('ConditionStopped', (event) => {
You don't need to subscribe to express core contract. It calls `OddsChanged` event on core contract with every combo bet.
</Callout>

The information on how to fetch odds values can be found in ["Get Odds Values"](/apis/subgraph/guides/get-odds-values)
The information on how to fetch odds values can be found in ["Get Odds Values"](/guides/prematch/get-odds-values)
section.


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Card } from 'components'
<Card
title="Integrate with Azuro"
text="Learn how to integrate with Azuro by building a dApp through guided examples"
to="/guides/get-games"
to="/guides/prematch/get-games"
/>
<Card
title="The Azuro smart contracts"
Expand Down
Binary file added public/images/live/place-a-bet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6e1a5fb

Please sign in to comment.