arrow-left

All pages
gitbookPowered by GitBook
1 of 3

Loading...

Loading...

Loading...

Subgraph

In this section you will find Subgraph Entities and Sample Queries.

Welcome to the "Subgraph" section of Snowcone DAO. This is where you'll find detailed information about our subgraph, a crucial tool for querying and indexing blockchain data. Whether you're a developer looking to extract data from our protocol or someone interested in analyzing our blockchain data, this section provides the resources you need. Here's what you can find in each subsection:

hashtag
Subgraph Entities

This subsection provides a comprehensive overview of the entities in our subgraph. Entities represent the various objects in our protocol, and understanding them is key to querying our subgraph effectively. You'll find definitions, properties, and usage examples for each entity.

hashtag

If you're new to querying subgraphs or just looking for some examples, this subsection is for you. It provides a collection of sample queries that you can use as a starting point for your own data extraction and analysis. Each sample query comes with a detailed explanation and usage instructions.

Sample Queries

Sample Queries

Below are some sample queries you can use to gather information from the Snowcone contracts.

You can build your own queries using a GraphQL Explorerarrow-up-right—enter your endpoint to limit your queries to the exact data desired.

hashtag
Get Project Metrics By Owner

Get Project ID.

query ProjectByOwner(
  $Owner: String! = "0xaf28bcb48c40dbc86f52d459a6562f658fc94b1e"
) {
  projects(where: { owner: $Owner }, first: 10) {
    createdAt
    id
    owner
    projectId
    totalPaid
    totalRedeemed
    metadataUri
    handle
    terminal
    currentBalance
    cv
  }
}

hashtag
Project Metrics

Get the latest metrics for your project.

hashtag
Project Payments

Get the 20 latest payments into your project.

query ProjectMetrics($Project: String! = "1-1") {
  projects(where: { id: $Project }) {
    createdAt
    id
    owner
    projectId
    totalPaid
    totalRedeemed
    metadataUri
    handle
    terminal
    currentBalance
    cv
  }
}
query ProjectPayments($ProjectId: String! = "2-1") {
  projects(where: { id: $ProjectId }, first: 10) {
    handle
    payEvents(first: 20, orderBy: timestamp, orderDirection: desc) {
      amount
      caller
      note
      timestamp
      txHash
    }
  }
}

Subgraph Entities

See The Graph Docsarrow-up-right for more on defining entities.

hashtag
Entities​

  • ProtocolLog

Notes:

  • project.id is string concatenated from multiple properties. projectId represents an integer id of the project.

  • Familiarize yourself with sample records of the various entities on GraphLooker.

hashtag
ProtocolLog

Description: High level view of the Snowcone Protocol Applicable Versions: v1

Field
Type
Description

hashtag
ProjectCreateEvent

Description: Entity detailing info about the creation of a project Applicable Versions: v1.0, v1.1, v2

Field
Type
Description

hashtag
Project

Description: Applicable Versions: v1.0, v1.1, v2

Field
Type
Description

hashtag
ENSNode

Description: Applicable Versions: v2

Field
Type
Description

hashtag
Participant

Description: A users participation with a project. This is the M:M link between users:projects Applicable Versions: v1.0, v1.1, v2

Field
Type
Description

hashtag
ProjectEvent

Description: Applicable Versions: v1.0, v1.1, v2

Field
Type
Description

hashtag
PayEvent

Description: Applicable Versions: v1.0, v1.1, v2

Field
Type
Description

hashtag
MintTokensEvent

Description: Applicable Versions: v1.0, v1.1, v2

Field
Type
Description

hashtag
RedeemEvent

Description: Applicable Versions: v1.0, v1.1, v2

Field
Type
Description

hashtag
DeployedERC20Event

Description: Applicable Versions: v1.0, v1.1, v2

Field
Type
Description

hashtag
ProtocolV1Log

Description: Applicable Versions: v1.0, v1.1

Field
Type
Description

hashtag
PrintReservesEvent

Description: Applicable Versions: v1.0, v1.1

Field
Type
Description

hashtag
DistributeToPayoutModEvent

Description: Applicable Versions: v1.0, v1.1

Field
Type
Description

hashtag
TapEvent

Description: Applicable Versions: v1.0, v1.1

Field
Type
Description

hashtag
DistributeToTicketModEvent

Description: Applicable Versions: v1.0, v1.1

Field
Type
Description

hashtag
ProtocolV2Log

Description: Applicable Versions: v2

Field
Type
Description

hashtag
DistributePayoutsEvent

Description: Applicable Versions: v2

Field
Type
Description

hashtag
DistributeToPayoutSplitEvent

Description: Applicable Versions: v2

Field
Type
Description

hashtag
DistributeReservedTokensEvent

Description: Applicable Versions: v2

Field
Type
Description

hashtag
DistributeToReservedTokenSplitEvent

Description: Applicable Versions: v2

Field
Type
Description

hashtag
UseAllowanceEvent

Description: Applicable Versions: v2

Field
Type
Description

hashtag
DeployETHERC20ProjectPayerEvent

Description: Applicable Versions: v2

Field
Type
Description

hashtag
ETHERC20ProjectPayer

Description: Applicable Versions: v2

Field
Type
Description

hashtag
VeNftToken

Description: Applicable Versions: v2

Field
Type
Description

BigInt!

Total Project Count for Snowcone

volumeRedeemed

BigInt!

Total Volume Redeemed across all projects

paymentsCount

Int!

Total Payment Count across all projects

redeemCount

Int!

Total Redeem Count across all projects

erc20Count

Int!

Total ERC20's deployed from SNOW projects

oldestTrendingPayEvent

PayEvent

String!

Contract Version of the project

timestamp

Int!

Unix timestamp for when the project was created

txHash

Bytes!

Transaction hash for when the project was created

caller

Bytes!

The wallet address that created the project

String

Project Name

metadataUri

String

URI for Project Metadata

metadataDomain

BigInt

terminal

Bytes

owner

Bytes!

Address that owns the project

createdAt

Int!

Timestamp for when the

totalPaid

BigInt!

Total amount paid to the project

totalRedeemed

BigInt!

Total amount redeemed by the project

currentBalance

BigInt!

Current total balance for the project

participants

[Participant!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

payEvents

[PayEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

mintTokensEvents

[MintTokensEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

tapEvents

[TapEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

redeemEvents

[RedeemEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

printReservesEvents

[PrintReservesEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

distributeToPayoutModEvents

[DistributeToPayoutModEvent!]!@derivedFrom(field: "project")

Derived field to lead to sub-entity

distributeToTicketModEvents

[DistributeToTicketModEvent!]!@derivedFrom(field: "project")

Derived field to lead to sub-entity

deployedERC20s

[DeployedERC20Event!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

distributePayoutsEvents

[DistributePayoutsEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

distributeToPayoutSplitEvents

[DistributeToPayoutSplitEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

distributeReservedTokensEvents

[DistributeReservedTokensEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

distributeToReservedTokenSplitEvents

[DistributeToReservedTokenSplitEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

deployedERC20Events

[DeployedERC20Event!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

useAllowanceEvents

[UseAllowanceEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

projectEvents

[ProjectEvent!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

ethErc20ProjectPayers

[ETHERC20ProjectPayer!]! @derivedFrom(field: "project")

Derived field to lead to sub-entity

String!

Contract Version of the project

wallet

Bytes!

Wallet address

totalPaid

BigInt!

Total paid to the project

lastPaidTimestamp

Int!

Time stamp for the most recent payment to the project

balance

BigInt!

Balance of the ERC20 in the users wallet (staked and unstaked)

stakedBalance

BigInt!

Balance of the ERC20 staked in snowcone

unstakedBalance

BigInt!

Balance of the ERC20 that is not staked in Snowcone

String!

Contract Version of the project

timestamp

Int!

timestamp of the event

payEvent

PayEvent

Sub-entity to query "project events"

mintTokensEvent

MintTokensEvent

Sub-entity to query "mint tokens events"

tapEvent

TapEvent

Sub-entity to query "tap events"

redeemEvent

RedeemEvent

Sub-entity to query "redeem events"

printReservesEvent

PrintReservesEvent

Sub-entity to query "print reserves events"

distributeToPayoutModEvent

DistributeToPayoutModEvent

Sub-entity to query "distribute to payout mod events"

distributeToTicketModEvent

DistributeToTicketModEvent

Sub-entity to query "distribute to ticket mod events"

deployedERC20Event

DeployedERC20Event

Sub-entity to query "deployed ERC20 events"

projectCreateEvent

ProjectCreateEvent

Sub-entity to query "project creation events"

distributePayoutsEvent

DistributePayoutsEvent

Sub-entity to query "distribute payout events"

distributeReservedTokensEvent

DistributeReservedTokensEvent

Sub-entity to query "distribute reserved tokens events"

distributeToReservedTokenSplitEvent

DistributeToReservedTokenSplitEvent

Sub-entity to query "distribute to reserved token split events"

distributeToPayoutSplitEvent

DistributeToPayoutSplitEvent

Sub-entity to query "distribute to payout split events"

useAllowanceEvent

UseAllowanceEvent

Sub-entity to query "allowance use events"

deployETHERC20ProjectPayerEvent

DeployETHERC20ProjectPayerEvent

Sub-entity to query "deploy ETH ERC20 project payer events"

String!

Contract Version of the project

timestamp

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

caller

Bytes!

The wallet address that paid the project

beneficiary

Bytes!

Recipient of the funds from the pay event

amount

BigInt!

Amount of the pay event

note

String!

Note for the pay event

feeFromV2Project

Int

Indicates payment is a fee from project with this ID

String!

Contract Version of the project

timestamp

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

beneficiary

Bytes!

Recipient of the funds from the mint event

amount

BigInt!

Amount of the mint event

memo

String!

Note for the mint event

caller

Bytes!

The wallet address that minted tokens

String!

Contract Version of the project

timestamp

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

holder

Bytes!

beneficiary

Bytes!

Recipient of the funds from the redeem event

amount

BigInt!

Amount of the redeem event

returnAmount

BigInt!

Note for the redeem event

caller

Bytes!

The wallet address that initiated the redemption

String!

Contract Version of the project

timestamp

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

symbol

String!

symbol of the ERC20

address

Bytes

will be empty for v1.x events

BigInt!

Total volume paid to V1.X projects

volumeRedeemed

BigInt!

Total volume redeemed to V1.X projects

paymentsCount

Int!

Total number of payments to V1.X projects

redeemCount

Int!

Total number of redemptions to V1.X projects

erc20Count

Int!

Total ERC20 deployed by V1.X projects

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

fundingCycleId

BigInt!

beneficiary

Bytes!

count

BigInt!

beneficiaryTicketAmount

BigInt!

caller

Bytes!

The wallet address that initiated the event

distributions

[DistributeToTicketModEvent!]!@derivedFrom(field: "printReservesEvent")

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

fundingCycleId

BigInt!

modProjectId

Int!

modAllocator

Bytes!

modBeneficiary

Bytes!

modPreferUnstaked

Boolean!

modCut

BigInt!

caller

Bytes!

The wallet address that initiated the distribution

tapEvent

TapEvent!

Sub-entity leading to tap events

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

fundingCycleId

BigInt!

beneficiary

Bytes!

Recipient of the tap event

amount

BigInt!

Amount of the tap event

currency

BigInt!

Currency address of the token in the tap event

netTransferAmount

BigInt!

Net amount transfered in all tap events

beneficiaryTransferAmount

BigInt!

Amount sent to the beneficiary

govFeeAmount

BigInt!

Tax amount on the tap event

caller

Bytes!

The wallet address that initiated the tap

distributions

[DistributeToPayoutModEvent!]! @derivedFrom(field: "tapEvent")

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

fundingCycleId

BigInt!

modBeneficiary

Bytes!

modPreferUnstaked

Boolean!

modCut

BigInt!

caller

Bytes!

The wallet address that initiated the distribution

printReservesEvent

PrintReservesEvent!

Sub-entity leading to the print reserve events

BigInt!

Total volume paid to V2 projects

volumeRedeemed

BigInt!

Total volume redeemed to V2 projects

paymentsCount

Int!

Total number of payments to V2 projects

redeemCount

Int!

Total number of redemptions to V2 projects

erc20Count

Int!

Total ERC20's deployed by V2 projects

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

fundingCycleConfiguration

BigInt!

fundingCycleNumber

Int!

beneficiary

Bytes!

Beneficiary of the distribution

amount

BigInt!

Amount of the distribution event

distributedAmount

BigInt!

Total amount distributed as of this event

fee

BigInt!

Fee on this distribution

beneficiaryDistributionAmount

BigInt!

Net amount sent to the beneficiary

memo

String!

Note on the disribution

caller

Bytes!

The wallet address that initiated the distribution

splitDistributions

[DistributeToPayoutSplitEvent!]!@derivedFrom(field: "distributePayoutsEvent")

Sub-entity leading to split distributions

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

domain

BigInt!

group

BigInt!

amount

BigInt!

caller

Bytes!

The wallet address that initiated the distribution split

distributePayoutsEvent

DistributePayoutsEvent!

preferClaimed

Boolean!

preferAddToBalance

Boolean!

percent

Int!

splitProjectId

Int!

beneficiary

Bytes!

lockedUntil

Int!

allocator

Bytes!

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

fundingCycleNumber

Int!

beneficiary

Bytes!

tokenCount

BigInt!

beneficiaryTokenCount

BigInt!

memo

String!

caller

Bytes!

The wallet address that initiated the reserve distribution

splitDistributions

[DistributeToReservedTokenSplitEvent!]!@derivedFrom(field"distributeReservedTokensEvent")

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

tokenCount

BigInt!

caller

Bytes!

distributeReservedTokensEvent

DistributeReservedTokensEvent!

preferClaimed:

Boolean!

Split struct properties

percent

Int!

Split struct properties

splitProjectId

Int!

Split struct properties

beneficiary

Bytes!

Split struct properties

lockedUntil

Int!

Split struct properties

allocator

Bytes!

Split struct properties

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

fundingCycleConfiguration

BigInt!

fundingCycleNumber

Int!

beneficiary

Bytes!

Beneficiary of the allowance

amount

BigInt!

Amountof the allowance

distributedAmount

BigInt!

netDistributedamount

BigInt!

Total amount distributed by the project

memo

String!

Note for the distribution

caller

Bytes!

The wallet address that initiated the allowance

Int!

Timestamp of the transaction

txHash

Bytes!

Transaction hash

address

Bytes!

beneficiary

Bytes!

preferClaimedTokens

Boolean!

preferAddToBalance

Boolean!

directory

Bytes!

owner

Bytes!

memo

String

metadata

Bytes

caller

Bytes!

The wallet address that deployed the ERC20

Bytes!

beneficiary

Bytes!

preferClaimedTokens

Boolean!

preferAddToBalance

Boolean!

directory

Bytes!

owner

Bytes!

memo

String

metadata

Bytes

Int!

timestamp for when the token was created

redeemedAt

Int

timestamp for when the token was redeemed

owner

Bytes!

owner of the NFT

participant

Participant!

lockAmount

BigInt!

lockEnd

Int!

lockDuration

Int!

lockUseSNOWToken

Boolean!

lockAllowPublicExtension

Boolean!

unlockedAt

Int!

id

ID!

Entity ID (currently "1")

v1

ProtocolV1Log @derivedFrom(field: "log")

Sub-entity for v1 logs

v2

ProtocolV2Log @derivedFrom(field: "log")

Sub-entity for v2 logs

id

ID!

Contract Version - Project ID - Transaction Hash

project

Project!

Sub-entity linking to a project

projectId

Int!

projectId expressed as integer

id

ID!

Concatenation of CV - projectId

projectId

Int!

Project id as an Integer

cv

String!

Contract Version of the project

id

ID!

projectId

Int

id

ID!

Concatenated string of CV - projectId - walletAddress

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

log

ProtocolLog!

projectsCount

Int!

Total V1.X projects

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

log

ProtocolLog!

projectsCount

Int!

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id:

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id:

ID!

project

Project!

Sub entity leading to the project

projectId

Int!

Project id as an Integer

id

ID!

tokenId

Int!

Token identifier

tokenUri

String!

Token URI

ProjectCreateEvent
Project
ENSNode
Participant
ProjectEvent
PayEvent
MintTokensEvent
RedeemEvent
DeployedERC20Event
ProtocolV1Log
PrintReservesEvent
DistributeToPayoutModEvent
TapEvent
DistributeToTicketModEvent
ProtocolV2Log
DistributePayoutsEvent
DistributeToPayoutSplitEvent
DistributeReservedTokensEvent
DistributeToReservedTokenSplitEvent
UseAllowanceEvent
DeployETHERC20ProjectPayerEvent
ETHERC20ProjectPayer
VeNftToken
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​

projectsCount

cv

handle

cv

cv

cv

cv

cv

cv

volumePaid

timestamp

timestamp

timestamp

timestamp

volumePaid

timestamp

timestamp

timestamp

timestamp

timestamp

timestamp

address

createdAt