Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schemas/dex/SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ List of LP pools in this protocol (one entry per token in a pool).
| lp_token_symbol | The symbol of the LP token. | string |
| token_address | The token address of the pool token at token_index. | string |
| token_symbol | The symbol of the pool token. | string |
| token_decimals | The decimals of the pool token. | string |
| token_decimals | The decimals of the pool token. | int |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to make this change in the schema.json, then autogen the md file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, this was just from autogenerating, ignore my comment then

| token_index | The index in the pool smart contract that this token appears at, default 0 (ie, one entry per token in a pool). | bigint |
| fee_rate | (Optional, if dynamic fee) The fee rate of the pool, as a percentage (ie, 2.3% as 0.023). | double |
| dex_type | The type of the DEX (ie, CPMM, CLMM, Orderbook). | string |
Expand Down
22 changes: 21 additions & 1 deletion schemas/general/SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Table definitions for the generic schema. These tables can be used for any proto

### Incentive Claim Data

Transactional data on user level incentives claimed data.
Pool level allocations for an incentive program period.

| Property | Description | Type |
|-------------------------|-----------------------------------------------------------|--------|
Expand All @@ -21,6 +21,26 @@ Transactional data on user level incentives claimed data.
| amount_usd | The amount of claimed tokens in USD. | double |
| other_incentive_usd | (Optional) Any incentives outside of the claimed token, in this transaction, summed up in USD terms. | double |

### Pool Level Incentive Allocations

Transactional data on user level incentives claimed data.

| Property | Description | Type |
|-------------------------|-----------------------------------------------------------|--------|
| reward_token | The token address used to provide reward incentives. | string |
| token_symbol | The token symbol used to provide reward incentives. | string |
| amount | The amount of incentives provided over the period. | double |
| start_timestamp | The starting timestamp of the incentive period. | timestamp |
| end_timestamp | The ending timestamp of the incentive period. | timestamp |
| protocol_category | The category of the protocol (DEX, Lending, etc...). | string |
| protocol_name | The name of the protocol receiving incentives. | string |
| pool_address | The address of the pool receiving incentives. | string |
| reward_hash | The transaction hash of the rewards (if applicable). | string |
| log_index | The log index for the event in the rewards transaction (if applicable). | int |
| submission_timestamp | The timestamp of reward submissions. | timestamp |
| chain_id | The standard chain id. | int |
| program_name | The name of the program providing incentives. | string |

### Airdrop

Schema for airdrop data.
Expand Down
67 changes: 65 additions & 2 deletions schemas/general/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"transaction_hash",
"log_index"
],
"description": "Transactional data on user level incentives claimed data.",
"description": "Pool level allocations for an incentive program period.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table looks like transactional data to me, not pool level

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just flipflopped the descriptions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is pool level, this is the schema for our allocations, not really related to DOP, just wanted to make sure this is maintained somewhere

"properties": {
"timestamp": {
"description": "The timestamp of the claim.",
Expand Down Expand Up @@ -65,6 +65,69 @@
}
}
},
{
"label": "Pool Level Incentive Allocations",
"tableName": "pool_level_incentive_allocations",
"aggregation": "general_pools",
"uniqueKey": [
"pool_address"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really use this right now, but to be proper the unique key should be pool_address and a timestamp field. You could add block_date on the end date of the period and use that.

],
"description": "Transactional data on user level incentives claimed data.",
"properties": {
"reward_token": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"reward_token": {
"reward_token_address": {

"description": "The token address used to provide reward incentives.",
"type": "string"
},
"token_symbol": {
"description": "The token symbol used to provide reward incentives.",
"type": "string"
},
"amount": {
"description": "The amount of incentives provided over the period.",
"type": "double"
},
"start_timestamp": {
"description": "The starting timestamp of the incentive period.",
"type": "timestamp"
},
"end_timestamp": {
"description": "The ending timestamp of the incentive period.",
"type": "timestamp"
},
"protocol_category": {
"description": "The category of the protocol (DEX, Lending, etc...).",
"type": "string"
},
"protocol_name": {
"description": "The name of the protocol receiving incentives.",
"type": "string"
},
"pool_address": {
"description": "The address of the pool receiving incentives.",
"type": "string"
},
"reward_hash": {
"description": "The transaction hash of the rewards (if applicable).",
"type": "string"
},
"log_index": {
"description": "The log index for the event in the rewards transaction (if applicable).",
"type": "int"
},
"submission_timestamp": {
"description": "The timestamp of reward submissions.",
"type": "timestamp"
},
"chain_id": {
"description": "The standard chain id.",
"type": "int"
},
"program_name": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually this is something we add in after the fact, in the DOP pipeline

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for non DOP incentives, this is for our allocations at the pool level, so this will come out of a DBT model (or have to be added manually, I am mainly keeping it here for our records)

"description": "The name of the program providing incentives.",
"type": "string"
}
}
},
{
"label": "Airdrop",
"tableName": "general_airdrop",
Expand Down Expand Up @@ -335,4 +398,4 @@
}
}
]
}
}