You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/hub/blockchains/architecture.mdx
+27-6Lines changed: 27 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,20 +22,41 @@ The Factory is the starting point in Azuro's architecture, allowing for the crea
22
22
23
23
The LP contract manages the pools and contains the logic for the betting system, empowering users to engage confidently in the ecosystem.
24
24
25
-
Key functions within this contract handle the creation and cancellation of games, the addition of liquidity, the placing of bets, and the payout processes.
25
+
Key functions within this contract handle the addition of liquidity, the placing of bets, the payout processes and fee accumulating.
26
26
27
-
This contract is an integration point for various other contracts in the Azuro architecture, including the Factory, Access, and Betting Engines, indicating its critical position in the overall system. It showcases the ability to interact with other components like data providers and affiliates, demonstrating the modular and interconnected nature of Azuro's smart contract ecosystem.
27
+
This contract is an integration point for various other contracts in the Azuro architecture, including the Factory, Access, and Betting Core Engine, Vault, indicating its critical position in the overall system. It showcases the ability to interact with other components like data providers and affiliates, demonstrating the modular and interconnected nature of Azuro's smart contract ecosystem.
28
+
29
+
#### Vault Contract
30
+
The Vault contract is a liquidity store that manages the addition/removal of deposits and distributes protocol's profits/losses fairly.
31
+
32
+
Vault based on [LiquidityTree](https://gem.azuro.org/knowledge-hub/how-azuro-works/liquidity-tree).
28
33
29
34
#### Access Contract
30
35
31
36
The Access contract in Azuro's architecture is a critical component designed to manage access control to various functionalities within the ecosystem.
32
37
33
38
The contract uses a token-based system where each token represents a role with associated permissions. The binding of roles to contract functions and the assignment of roles to user accounts are central features that enforce the access control logic.
34
39
35
-
#### Prediction Engines
40
+
[Access](https://github.com/Azuro-protocol/Access) contract is standalone open source project created and backed by Azuro team.
41
+
42
+
#### LiveCore contract
43
+
44
+
The LiveCore contract is a contracts that encompass the logic of creating [Conditions](https://gem.azuro.org/knowledge-hub/how-azuro-works/components/conditions), accepting bets, computing payouts for bets, and calculating [App rewards](https://gem.azuro.org/knowledge-hub/how-azuro-works/reward-distribution).
45
+
46
+
These contracts are plugged into the [Pool](https://gem.azuro.org/knowledge-hub/how-azuro-works/components/pools) by its owner via the [Factory](/hub/blockchains/architecture#factory-contract), and access to place bets and withdraw payouts is only granted through the [LP](/hub/blockchains/architecture#lp-contract) contract for which it was deployed or through PayMaster for freebets case.
47
+
48
+
The LiveCore contract supports pre-match and live betting condition types and ordinary/combo bets kinds.
49
+
50
+
#### Relayer contract
51
+
52
+
The Relayer contract is entry point for executing all types protocol bets.
53
+
54
+
The Relayer contract gets (if needed) sponsored transaction fee and sponsored amounts for the bet from the PayMaster contract.
55
+
56
+
Bettor not executes bet transaction by itself, he fills up bet parameters and sign it, next prepared bet order executes on the Relayer contract by special relayer-executor - this approach allow make bets totally free.
36
57
37
-
A Prediction Engine (aka Betting Engine) is a collective term for contracts that encompass the logic of creating [Conditions](https://gem.azuro.org/knowledge-hub/how-azuro-works/components/conditions), accepting bets, computing payouts for bets, and calculating [App rewards](https://gem.azuro.org/knowledge-hub/how-azuro-works/reward-distribution).
58
+
#### PayMaster contract
38
59
39
-
These contracts are plugged into the [Pool](https://gem.azuro.org/knowledge-hub/how-azuro-works/components/pools) by its owner via the [Factory](/hub/blockchains/architecture#factory-contract), and access to place bets and withdraw payouts is only granted through the [LP](/hub/blockchains/architecture#lp-contract) contract for which it was deployed.
60
+
The PayMaster contract combines sponsored fee vaults and freebet vaults for all affiliates, so every affiliate can manage (deposit/withdraw) its owned vaults in the contract.
40
61
41
-
A Betting Engine can inherit the [CoreBase](https://gem.azuro.org/contracts/core-base) contract that contains the fundamental logic to facilitate the betting process on multi-outcome Conditions.
62
+
Also PayMaster in case of provided freebets completely manage it, because of freebet bets belongs PayMaster, so all freebet payouts must be done in PayMaster.
Copy file name to clipboardExpand all lines: pages/hub/blockchains/bet-functions.mdx
+20-16Lines changed: 20 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,10 @@
1
1
import { Callout } from'components'
2
2
3
-
# Azuro Protocol V3: Changes to smart contracts
4
-
5
-
## Bets improvements
6
-
7
-
In the V2 protocol, bets on pre-match, live and combo events processed in different contracts, with different betting logic, which added complexity to the protocol. In the new version V3, all types of bets (pre-match, live, combo) are processed by a single contract, which allows:
8
-
- pre-match events become live events with the onset of a sporting event
9
-
- combo bets can be made up of pre-match and live events
10
-
- added the ability to accept bets from smart wallets (wallets smart contracts)
11
-
- bets are placed by special bet executors, and the ability to provide gas-free transactions has been added
12
-
13
3
## Placing bet and paying out
14
4
15
5
Placing a bet occurs in several stages:
16
6
- bettor approves token spending (for the bet) for the *Relayer contract* (entry point for bets)
17
-
- bettor forms the bet parameters and signs (using EIP-712 standard) it in the WEB3 wallet. *All betting in V3 is done in the same way as V2 "live betting", using the EIP-712 parameters signing*
7
+
- bettor forms the bet parameters and signs (using EIP-712 standard) it in the WEB3 wallet. *All betting is done, using the EIP-712 parameters signing*
18
8
- bettor transfers the signed data to the oracle via API
19
9
- oracle signs received data, forms and transfers the order to the executor (Relayer Executor)
20
10
- the executor (Relayer Executor) execute transaction call of `function betFor(OrderData[] orders)` method of *Relayer contract*, `orders` contains the user's bet data, placing the bet
@@ -35,7 +25,7 @@ struct ConditionData {
35
25
ConditionKind conditionKind;
36
26
uint64[] odds;
37
27
uint128[] outcomes;
38
-
uint128 payoutLimit;
28
+
uint128 potentialLossLimit;
39
29
uint8 winningOutcomesCount;
40
30
}
41
31
@@ -59,8 +49,8 @@ event NewLiveBet(
59
49
uint256 nonce,
60
50
uint128 amount,
61
51
SubBetData[] betDatas, // one record for ordinary, many records for combo
62
-
uint128 payoutLimit
63
-
)
52
+
uint128 potentialLossLimit
53
+
);
64
54
65
55
struct SubBetData {
66
56
uint256 gameId;
@@ -81,8 +71,11 @@ event ConditionCreated(
81
71
)
82
72
```
83
73
84
-
## Payout on winning bet (same as in V2)
85
-
If the bet wins, the user withdraw payout executing `lp.withdrawPayout(address core, uint256 tokenId)` for single bet or use batch analog `withdrawPayouts(address core, uint256[] calldata tokenIds)`
74
+
## Payout on winning bet placed
75
+
76
+
If the bet wins, the user withdraw payout.
77
+
### without freebets
78
+
User withdraw payout executing `LP.withdrawPayout(address core, uint256 tokenId)` for single bet or use batch analog `withdrawPayouts(address core, uint256[] calldata tokenIds)`
86
79
The winnings are paid to the owner of the bet token and the BettorWin() event is emitted for each token
87
80
```solidity
88
81
event BettorWin(
@@ -92,3 +85,14 @@ event BettorWin(
92
85
uint256 amount
93
86
)
94
87
```
88
+
### using freebet funds
89
+
User withdraw payout executing batch function `PayMaster.withdrawPayouts(uint256[] calldata freeBetIds)` passing freebet ids.
90
+
The winnings are paid to freebet ids owner and the BettorWin() event is emitted for each freebet id
0 commit comments