---
# System prepended metadata

title: BetSwirl Entities

---

# BetSwirl Entities

- [`Store`](#store)
- [`Token`](#token)
- [`TokenBalancesDayData`](#tokenbalancesdaydata)
- [`PvPToken`](#pvptoken)
- [`DiceBet`](#dicebet)
- [`CoinTossBet`](#cointossbet)
- [`RouletteBet`](#roulettebet)
- [`KenoBet`](#kenobet)
- [`RussianRouletteBet`](#russianroulettebet)
- [`GameToken`](#gametoken)
- [`GameTokenDayData`](#gametokendaydata)
- [`PvPGameToken`](#pvpgametoken)
- [`PvPGameTokenDayData`](#pvpgametokendaydata)
- [`User`](#user)
- [`UserToken`](#usertoken)
- [`UserTokenDayData`](#usertokendaydata)
- [`UserOverchargedVRFCost`](#useroverchargedvrfcost)
- [`StakingPool`](#stakingpool)
- [`StakingPoolDayData`](#stakingpooldaydata)

## Store

| Field | Type   | Description                              |
| ----- | ------ | ---------------------------------------- |
| id    | ID!    | Unique identifier for the store          |
| bets  | BigInt | Total amount of bets placed in the store |
| users | BigInt | Total number of users in the store       |

## Token

| Field                 | Type                    | Description                                                                |
| --------------------- | ----------------------- | -------------------------------------------------------------------------- |
| id                    | ID!                     | Unique identifier for the token                                            |
| symbol                | String!                 | Symbol of the token                                                        |
| name                  | String!                 | Name of the token                                                          |
| decimals              | Int!                    | Number of decimal places for the token                                     |
| bets                  | BigInt                  | Total amount of bets placed with the token                                 |
| wonCount              | BigInt                  | Total number of bets won with the token                                    |
| users                 | BigInt                  | Total number of users who have used the token                              |
| amount                | BigInt                  | Total amount of tokens in circulation                                      |
| payout                | BigInt                  | Total amount of tokens paid out in winnings                                |
| dividendAmount        | BigInt                  | Total amount of tokens distributed as dividends                            |
| bankAmount            | BigInt                  | Total amount of tokens held in reserve for payouts                         |
| partnerAmount         | BigInt                  | Total amount of tokens held in reserve for partners                        |
| treasuryAmount        | BigInt                  | Total amount of tokens held in reserve for the treasury                    |
| teamAmount            | BigInt                  | Total amount of tokens held in reserve for the development team            |
| balancesDayDataLength | BigInt                  | Length of the array, which contains historical token balances for each day |
| balancesDayData       | [TokenBalancesDayData!] | Derived from the token balances day data field                             |
| usersTokens           | [UserToken!]            | Derived from UserToken field                                               |

## TokenBalancesDayData

| Field   | Type    | Description       |
| ------- | ------- | ----------------- |
| id      | ID!     | TOKEN-DAYID       |
| token   | Token!  | Token             |
| date    | Int!    | Date as timestamp |
| balance | BigInt! | Balance of token  |

## PvPToken

| Field           | Type    | Description                                           |
| --------------- | ------- | ----------------------------------------------------- |
| id              | ID!     | Address                                               |
| symbol          | String! | Symbol of the token                                   |
| name            | String! | Name of the token                                     |
| decimals        | Int!    | Number of decimal places the token uses               |
| bets            | Int!    | Number of bets made with the token                    |
| uniqueBets      | Int!    | Number of unique bets made with the token             |
| users           | Int!    | Number of unique users who have used the token        |
| amount          | BigInt! | Total amount of the token used in bets                |
| payout          | BigInt! | Total payout of the token for all bets                |
| dividendAmount  | BigInt! | Total amount of the token allocated for dividends     |
| treasuryAmount  | BigInt! | Total amount of the token allocated for the treasury  |
| teamAmount      | BigInt! | Total amount of the token allocated for the team      |
| initiatorAmount | BigInt! | Total amount of the token allocated for the initiator |

## Dicebet

| Field       | Type       | Description                                               |
| ----------- | ---------- | --------------------------------------------------------- |
| id          | ID!        | Unique identifier for the bet                             |
| user        | User!      | The user who placed the bet                               |
| gameToken   | GameToken! | The token used for the bet                                |
| timestamp   | BigInt!    | Timestamp of when the bet was placed                      |
| resolved    | Boolean!   | Whether or not the bet has been resolved                  |
| cap         | Int!       | Maximum bet amount allowed by the game                    |
| betTxnHash  | Bytes      | Transaction hash of the transaction that placed the bet   |
| houseEdge   | Int        | House edge for the game                                   |
| amount      | BigInt!    | Amount of the bet                                         |
| rolled      | Int        | Number that was rolled in the game                        |
| payout      | BigInt!    | Payout amount for the bet                                 |
| rollTxnHash | Bytes      | Transaction hash of the transaction that resolved the bet |

## CoinTossBet

| Field       | Type       | Description                                               |
| ----------- | ---------- | --------------------------------------------------------- |
| id          | ID!        | Unique identifier for the bet                             |
| user        | User!      | The user who placed the bet                               |
| gameToken   | GameToken! | The token used for the bet                                |
| timestamp   | BigInt!    | Timestamp of when the bet was placed                      |
| resolved    | Boolean!   | Whether or not the bet has been resolved                  |
| face        | Boolean!   | Whether the user bet on a face or not                     |
| betTxnHash  | Bytes      | Transaction hash of the transaction that placed the bet   |
| houseEdge   | Int        | House edge for the game                                   |
| amount      | BigInt!    | Amount of the bet                                         |
| rolled      | Boolean!   | Whether or not the bet won                                |
| payout      | BigInt!    | Payout amount for the bet                                 |
| rollTxnHash | Bytes      | Transaction hash of the transaction that resolved the bet |

## RouletteBet

| Field       | Type       | Description                                               |
| ----------- | ---------- | --------------------------------------------------------- |
| id          | ID!        | Unique identifier for the bet                             |
| user        | User!      | The user who placed the bet                               |
| gameToken   | GameToken! | The token used for the bet                                |
| timestamp   | BigInt!    | Timestamp of when the bet was placed                      |
| resolved    | Boolean!   | Whether or not the bet has been resolved                  |
| numbers     | BigInt!    | The numbers the user bet on                               |
| betTxnHash  | Bytes      | Transaction hash of the transaction that placed the bet   |
| houseEdge   | Int        | House edge for the game                                   |
| amount      | BigInt!    | Amount of the bet                                         |
| rolled      | Int        | Number that was rolled in the game                        |
| payout      | BigInt!    | Payout amount for the bet                                 |
| rollTxnHash | Bytes      | Transaction hash of the transaction that resolved the bet |

## KenoBet

| Field       | Type       | Description                                               |
| ----------- | ---------- | --------------------------------------------------------- |
| id          | ID!        | Unique identifier for the bet                             |
| user        | User!      | The user who placed the bet                               |
| gameToken   | GameToken! | The token used for the bet                                |
| timestamp   | BigInt!    | Timestamp of when the bet was placed                      |
| resolved    | Boolean!   | Whether or not the bet has been resolved                  |
| numbers     | BigInt!    | The numbers the user bet on                               |
| betTxnHash  | Bytes      | Transaction hash of the transaction that placed the bet   |
| houseEdge   | Int        | House edge for the game                                   |
| amount      | BigInt!    | Amount of the bet                                         |
| rolled      | BigInt!    | Number that was rolled in the game                        |
| payout      | BigInt!    | Payout amount for the bet                                 |
| rollTxnHash | Bytes      | Transaction hash of the transaction that resolved the bet |

## RussianRouletteBet

| Field              | Type          | Description                                                       |
| ------------------ | ------------- | ----------------------------------------------------------------- |
| id                 | ID!           | Unique identifier for the bet                                     |
| user               | User!         | The user who placed the bet                                       |
| gameToken          | PvPGameToken! | The token used for the bet                                        |
| timestamp          | Int!          | Timestamp of when the bet was placed                              |
| resolved           | Boolean!      | Whether or not the bet has been resolved                          |
| canceled           | Boolean       | Whether or not the bet was canceled                               |
| amount             | BigInt!       | Amount of the bet                                                 |
| deathRatio         | Int           | The ratio of death in the game, if applicable                     |
| startsAt           | Int           | The start time of the game, if applicable                         |
| maxSeats           | Int           | The maximum number of seats in the game, if applicable            |
| opponents          | [Bytes!]!     | List of opponents' addresses, if applicable                       |
| seats              | [Bytes!]!     | List of seat holders' addresses, if applicable                    |
| joinedTxnHash      | [Bytes!]!     | Transaction hash of the transactions that joined the game, if any |
| pot                | BigInt!       | Current pot size, if applicable                                   |
| gameStartedTxnHash | Bytes         | Transaction hash of the transaction that started the game, if any |
| houseEdge          | Int!          | House edge for the game                                           |
| payout             | BigInt        | Payout amount for the bet, if applicable                          |
| killedSeatsNumber  | Int           | The number of seats killed in the game, if applicable             |
| winners            | [Bytes!]      | List of winners' addresses, if applicable                         |
| winningSeats       | [Boolean!]    | List of whether each seat is a winner, if applicable              |
| rollTxnHash        | Bytes         | Transaction hash of the transaction that resolved the bet, if any |
| rollTime           | Int           | Timestamp of when the bet was resolved, if any                    |

## GameToken

| Field         | Type                | Description                                                    |
| ------------- | ------------------- | -------------------------------------------------------------- |
| id            | ID!                 | The ID of the game token or game token account                 |
| user          | User                | The user who created the game token or game token account      |
| token         | Token!              | The token used for betting                                     |
| game          | String!             | The name of the game associated with the game token            |
| houseEdge     | Int                 | The house edge for the game                                    |
| bets          | BigInt!             | The total number of bets placed on the game                    |
| wonCount      | BigInt!             | The total number of bets won on the game                       |
| users         | BigInt!             | The total number of users who have placed bets on the game     |
| amount        | BigInt!             | The total amount of tokens that have been bet on the game      |
| payout        | BigInt!             | The total amount of tokens that have been paid out in winnings |
| dayDataLength | BigInt!             | The number of days for which data is available for the game    |
| dayData       | [GameTokenDayData!] | Derived from the game token ID.                                |

## GameTokenDayData

| Field     | Type       | Description                                                |
| --------- | ---------- | ---------------------------------------------------------- |
| Id        | ID!        | GAME-TOKEN-DAYID`or`GAME-TOKEN-ACCOUNT-DAYID               |
| gameToken | GameToken! | Token used in game                                         |
| date      | Int!       | Date as timestamp                                          |
| bets      | BigInt!    | The total number of bets placed                            |
| wonCount  | BigInt!    | Total number of bets won on the game                       |
| users     | BigInt!    | Total number of users who have placed bets on the game     |
| amount    | BigInt!    | Total amount of tokens that have been bet on the game      |
| payout    | BigInt!    | Total amount of tokens that have been paid out in winnings |

## PvPGameToken

| Field         | Type                   | Description                                                |
| ------------- | ---------------------- | ---------------------------------------------------------- |
| Id            | ID!                    | The ID of the game token or game token account             |
| user          | User!                  | The user who created the Game token                        |
| token         | PVPToken!              | Token used in game                                         |
| game          | String!                | The name of the game associated with the game token        |
| houseEdge     | Int!                   | House edge for the game                                    |
| bets          | Int!                   | The total number of bets placed on the game                |
| uniqueBets    | Int!                   | Number of unique bets made with the token                  |
| users         | Int!                   | Total number of users who have placed bets on the game     |
| amount        | BigInt!                | Total amount of tokens bet on the game                     |
| payout        | BigInt!                | Total amount of tokens that have been paid out in winnings |
| dayDataLength | Int!                   | Number of days for which data is available for the game    |
| dayData       | [PvPGameTokenDayData!] | Derived from (field: "gameToken")                          |

## PvPGameTokenDayData

| Field     | Type          | Description                                            |
| --------- | ------------- | ------------------------------------------------------ |
| Id        | ID!           | GAME-TOKEN-DAYID or GAME-TOKEN-ACCOUNT-DAYID           |
| gameToken | PvPGameToken! | Token used in game                                     |
| date      | Int!          | Date as timestamp                                      |
| bets      | Int!          | The total number of bets placed on the game            |
| users     | Int!          | Total number of users who have placed bets on the game |
| amount    | BigInt!       | Total amount of tokens bet on the game                 |
| payout    | BigInt!       | Total amount of tokens paid out in winnings            |

## User

| Field               | Type                      | Description                  |
| ------------------- | ------------------------- | ---------------------------- |
| Id                  | ID!                       | Account                      |
| firstBetTimestamp   | BigInt!                   | Timestamp of the first bet   |
| lastBetTimestamp    | BigInt!                   | Timestamp of the last bet    |
| userTokens          | [UserToken!]!             | Derived from (field: "User") |
| gamesTokens         | [GameToken!]!             | Derived from (field: "User") |
| DiceBets            | [DiceBet!]!               | Derived from (field: "User") |
| CoinTossBets        | [CoinTossBet!]!           | Derived from (field: "User") |
| RouletteBets        | [RouletteBet!]!           | Derived from (field: "User") |
| KenoBets            | [KenoBet!]!               | Derived from (field: "User") |
| RussianRouletteBets | [RussianRouletteBet!]     | Derived from (field: "User") |
| overchargedVRFCosts | [UserOverchargedVRFCost!] | Derived from (field: "User") |

## UserToken

| Field    | Type    | Description                                 |
| -------- | ------- | ------------------------------------------- |
| Id       | ID!     | USER-TOKEN                                  |
| user     | User!   | User address                                |
| token    | Token!  | Token used by the user                      |
| bets     | BigInt! | The total number of bets placed by user     |
| wonCount | BigInt! | Total number of bets won                    |
| amount   | BigInt! | Total amount of tokens bet                  |
| payout   | BigInt! | Total amount of tokens paid out in winnings |

## UserTokenDayData

| Field     | Type       | Description                                 |
| --------- | ---------- | ------------------------------------------- |
| Id        | ID!        | USER-TOKEN-DAYID                            |
| userToken | UserToken! | Token used by user                          |
| date      | Int!       | Date as timestamp                           |
| bets      | BigInt!    | The total number of bets placed by user     |
| wonCount  | BigInt!    | Total number of bets won                    |
| amount    | BigInt!    | Total amount of tokens bet                  |
| payout    | BigInt!    | Total amount of tokens paid out in winnings |

## UserOverchargedVRFCost

| Field  | Type    | Description                        |
| ------ | ------- | ---------------------------------- |
| Id     | ID!     | USER-GAME                          |
| user   | User!   | User address                       |
| game   | String! | The name of the game               |
| amount | BigInt! | Total amount of tokens overcharged |

## StakingPool

| Field         | Type                  | Description                                           |
| ------------- | --------------------- | ----------------------------------------------------- |
| Id            | ID!                   | PID                                                   |
| dayDataLength | BigInt!               | Number of days data is available for the staking pool |
| dayData       | [StakingPoolDayData!] | derivedFrom(field: "stakingPool")                     |

## StakingPoolDayData

| Field       | Type         | Description               |
| ----------- | ------------ | ------------------------- |
| Id          | ID!          | PID-DAYID                 |
| date        | Int!         | Date as timestamp         |
| stakingPool | StakingPool! | Staking pool              |
| balance     | BigInt!      | Token balance of the pool |
