Skip to content

Commit

Permalink
Add bridge aggregator schema (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
melotik authored Dec 3, 2024
1 parent 107a105 commit 74238ff
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Below you will find links to each of the following verticals.
- [DEX Aggregator](./schemas/dex-aggregator/SCHEMA.md)
- [NFT](./schemas/nft/SCHEMA.md)
- [Prediction Market](./schemas/prediction-market/SCHEMA.md)

- [Bridge Aggregator](./schemas/bridge-aggregator/SCHEM.md)
2 changes: 1 addition & 1 deletion schemas/automated-liquidity-management/SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ TVL, fees, and incentives data at the pool level.
| underlying_token_amount_usd | The amount of underlying tokens supplied in this pool, in USD. | number |
| total_fees_usd | The total amount of revenue and fees paid in this pool in the given snapshot, in USD. | number |

### ERC LP Token Transfer Events
### ERC-20 LP Token Transfer Events

All LP Token transfer events

Expand Down
55 changes: 55 additions & 0 deletions schemas/bridge-aggregator/SCHEMA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Bridge Aggregator

Standard table definitions for bridge aggregator protocols that route users across different bridge protocols.

## Version: 1.0.0-alpha

### Tokens

List of tokens supported by the bridge aggregator.

| Property | Description | Type |
|-------------------------|-----------------------------------------------------------|--------|
| chain_id | The blockchain ID where the token resides. | number |
| token_address | The contract address of the token. | string |
| token_name | The name of the token. | string |
| token_symbol | The symbol of the token. | string |
| decimals | The decimal places of the token. | number |

### Token Snapshot

Snapshot of token-level metrics in the aggregator.

| Property | Description | Type |
|-------------------------|-----------------------------------------------------------|--------|
| timestamp | The timestamp of the snapshot. | number |
| block_date | The timestamp truncated (ie, YYYY-MM-DD format for daily snapshots). | date |
| chain_id | The blockchain ID where the token resides. | number |
| token_address | The contract address of the token. | string |
| volume_amount | The total volume of the token bridged, decimal normalized. | number |
| volume_usd | The total volume in USD. | number |
| fees | The fees collected in token amount, decimal normalized. | number |
| fees_usd | The fees collected in USD. | number |
| incentive_amount | The amount of incentives distributed, decimal normalized. | number |
| incentive_usd | The amount of incentives distributed in USD. | number |

### Bridge Transactions

Transaction-level data for bridge aggregator operations.

| Property | Description | Type |
|-------------------------|-----------------------------------------------------------|--------|
| timestamp | The timestamp of the transaction. | number |
| source_chain_id | The source chain ID. | number |
| destination_chain_id | The destination chain ID. | number |
| source_transaction_hash | The transaction hash on the source chain. | string |
| destination_transaction_hash | The transaction hash on the destination chain. | string |
| source_user_address | The user's address on the source chain. | string |
| destination_user_address | The user's address on the destination chain. | string |
| input_tokens | Array of token addresses used as input. | [string] |
| input_token_amounts | Array of input token amounts, decimal normalized. | [number] |
| input_token_fees | Array of fees paid in input tokens, decimal normalized. | [number] |
| output_tokens | Array of token addresses received as output. | [string] |
| output_token_amounts | Array of output token amounts, decimal normalized. | [number] |

> Note: This markdown file is auto-generated.
143 changes: 143 additions & 0 deletions schemas/bridge-aggregator/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"schema": "Bridge Aggregator",
"description": "Standard table definitions for bridge aggregator protocols that route users across different bridge protocols.",
"protocolCategory": ["Bridge Aggregator"],
"version": "1.0.0-alpha",
"tables": [
{
"label": "Tokens",
"tableName": "bridge_aggregator_tokens",
"aggregation": "none",
"uniqueKey": ["chain_id", "token_address"],
"description": "List of tokens supported by the bridge aggregator.",
"properties": {
"chain_id": {
"description": "The blockchain ID where the token resides.",
"type": "number"
},
"token_address": {
"description": "The contract address of the token.",
"type": "string"
},
"token_name": {
"description": "The name of the token.",
"type": "string"
},
"token_symbol": {
"description": "The symbol of the token.",
"type": "string"
},
"decimals": {
"description": "The decimal places of the token.",
"type": "number"
}
}
},
{
"label": "Token Snapshot",
"tableName": "bridge_aggregator_token_metrics",
"aggregation": "daily",
"uniqueKey": ["chain_id", "token_address", "block_date"],
"description": "Snapshot of token-level metrics in the aggregator.",
"properties": {
"timestamp": {
"description": "The timestamp of the snapshot.",
"type": "number"
},
"block_date": {
"description": "The timestamp truncated (ie, YYYY-MM-DD format for daily snapshots).",
"type": "date"
},
"chain_id": {
"description": "The blockchain ID where the token resides.",
"type": "number"
},
"token_address": {
"description": "The contract address of the token.",
"type": "string"
},
"volume_amount": {
"description": "The total volume of the token bridged, decimal normalized.",
"type": "number"
},
"volume_usd": {
"description": "The total volume in USD.",
"type": "number"
},
"fees": {
"description": "The fees collected in token amount, decimal normalized.",
"type": "number"
},
"fees_usd": {
"description": "The fees collected in USD.",
"type": "number"
},
"incentive_amount": {
"description": "The amount of incentives distributed, decimal normalized.",
"type": "number"
},
"incentive_usd": {
"description": "The amount of incentives distributed in USD.",
"type": "number"
}
}
},
{
"label": "Bridge Transactions",
"tableName": "bridge_aggregator_transactions",
"aggregation": "transaction",
"uniqueKey": ["source_transaction_hash", "destination_transaction_hash"],
"description": "Transaction-level data for bridge aggregator operations.",
"properties": {
"timestamp": {
"description": "The timestamp of the transaction.",
"type": "number"
},
"source_chain_id": {
"description": "The source chain ID.",
"type": "number"
},
"destination_chain_id": {
"description": "The destination chain ID.",
"type": "number"
},
"source_transaction_hash": {
"description": "The transaction hash on the source chain.",
"type": "string"
},
"destination_transaction_hash": {
"description": "The transaction hash on the destination chain.",
"type": "string"
},
"source_user_address": {
"description": "The user's address on the source chain.",
"type": "string"
},
"destination_user_address": {
"description": "The user's address on the destination chain.",
"type": "string"
},
"input_tokens": {
"description": "Array of token addresses used as input.",
"type": "[string]"
},
"input_token_amounts": {
"description": "Array of input token amounts, decimal normalized.",
"type": "[number]"
},
"input_token_fees": {
"description": "Array of fees paid in input tokens, decimal normalized.",
"type": "[number]"
},
"output_tokens": {
"description": "Array of token addresses received as output.",
"type": "[string]"
},
"output_token_amounts": {
"description": "Array of output token amounts, decimal normalized.",
"type": "[number]"
}
}
}
]
}

0 comments on commit 74238ff

Please sign in to comment.