Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Event Models for GMX v2 Project #7187

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -909,4 +909,271 @@ models:
- *acceptable_price_raw
- *acceptable_price
- *min_output_amount_raw
- *updated_at_time
- *updated_at_time


- name: gmx_v2_arbitrum_open_interest_in_tokens_updated
meta:
blockchain: arbitrum
sector: dex
project: gmx
contributors: ai_data_master, gmx-io
config:
tags: ['arbitrum', 'gmx', 'event', 'open_interest_in_tokens_updated']
description: |
Combines and processes decoded event data to produce a normalized dataset of updated orders
on the GMX platform for the Arbitrum blockchain.
This model integrates data from the `open_interest_in_tokens_updated` table, enriching it with market-specific details.

columns:
- *blockchain
- *block_time
- *block_date
- *block_number
- *tx_hash
- *index
- *contract_address
- name: event_name
description: The type of event recorded, always 'OpenInterestInTokensUpdated' for this model
data_tests:
- not_null
- *msg_sender
- name: market
description: The market in which the order was updated, decoded from a hexadecimal value.
data_tests:
- not_null
- name: collateral_token
description: The token used as collateral for the order, decoded from a hexadecimal value.
data_tests:
- not_null
- name: is_long
description: A boolean flag indicating whether the order is a long position (true) or short position (false).
- name: next_value
description: |
Represents the updated open interest vlaue after the transaction. It is derived by normalizing
the raw value using index token decimals.
This ensures consistent scaling of the value across tokens with varying decimals.
- name: delta
description: |
Indicates the change in open interest. It is calculated by normalizing the raw delta value
using index token decimals.
This normalization accounts for token decimal differences and provides a standardized measure of change.
- name: tx_from
description: The address that initiated the transaction
- name: tx_to
description: The destination address of the transaction
- name: tx_index
description: Index value related to the transaction


- name: gmx_v2_arbitrum_open_interest_updated
meta:
blockchain: arbitrum
sector: dex
project: gmx
contributors: ai_data_master, gmx-io
config:
tags: ['arbitrum', 'gmx', 'event', 'open_interest_updated']
description: |
Extracts and processes decoded event data for open interest updates on the GMX platform,
specifically on the Arbitrum blockchain. This model normalizes data, including key metrics like
delta and next_value, ensuring consistent scaling based on token decimals.

columns:
- *blockchain
- *block_time
- *block_date
- *block_number
- *tx_hash
- *index
- *contract_address
- name: event_name
description: The type of event recorded, always 'OpenInterestUpdated' for this model
data_tests:
- not_null
- *msg_sender
- name: market
description: The market associated with the open interest update, decoded from a hexadecimal value.
data_tests:
- not_null
- name: collateral_token
description: The token used as collateral for the open interest, decoded from a hexadecimal value.
data_tests:
- not_null
- name: is_long
description: |
A boolean flag indicating whether the open interest update is for a long position (true) or short position (false).
data_type: boolean
- name: delta
description: |
Represents the change in open interest value, normalized by dividing the raw delta by `POWER(10, 30)`.
This ensures consistent scaling for values across tokens with varying decimals.
data_type: float
data_tests:
- not_null
- name: next_value
description: |
Indicates the updated open interest value after the transaction, normalized by dividing
the raw value by `POWER(10, 30)` to ensure consistent scaling across tokens.
data_type: float
data_tests:
- not_null
- name: tx_from
description: The address that initiated the transaction.
- name: tx_to
description: The destination address of the transaction.
- name: tx_index
description: The index value related to the transaction.


- name: gmx_v2_arbitrum_oracle_price_update
meta:
blockchain: arbitrum
sector: dex
project: gmx
contributors: ai_data_master, gmx-io
config:
tags: ['arbitrum', 'gmx', 'event', 'oracle_price_update']
description: |
Processes decoded event data for Oracle Price Updates on the GMX platform in the Arbitrum blockchain.
The model normalizes price data (min_price and max_price) using token-specific decimals and extracts
additional details such as the provider and token involved in the update.

columns:
- *blockchain
- *block_time
- *block_date
- *block_number
- *tx_hash
- *index
- *contract_address
- name: event_name
description: The type of event recorded, always 'OraclePriceUpdate' for this model
data_tests:
- not_null
- *msg_sender
- name: token
description: The token associated with the oracle price update, decoded from a hexadecimal value.
data_tests:
- not_null
- name: provider
description: The address of the price provider, decoded from a hexadecimal value.
- name: min_price
description: The minimum price reported by the oracle.
data_tests:
- not_null
- name: max_price
description: The maximum price reported by the oracle.
data_tests:
- not_null
- name: timestamp
description: The timestamp of the oracle price update.
data_type: timestamp
- name: tx_from
description: The address that initiated the transaction.
- name: tx_to
description: The destination address of the transaction.
- name: tx_index
description: The index value related to the transaction, used for unique identification.


- name: gmx_v2_arbitrum_pool_amount_updated
meta:
blockchain: arbitrum
sector: dex
project: gmx
contributors: ai_data_master, gmx-io
config:
tags: ['arbitrum', 'gmx', 'event', 'pool_amount_updated']
description: |
Processes decoded event data for Pool Amount Updates on the GMX platform in the Arbitrum blockchain.
This model normalizes token values (next_value and delta) based on token-specific decimals and extracts
additional details such as the market and token involved in the pool update.

columns:
- *blockchain
- *block_time
- *block_date
- *block_number
- *tx_hash
- *index
- *contract_address
- name: event_name
description: The type of event recorded, always 'PoolAmountUpdated' for this model
data_tests:
- not_null
- *msg_sender
- name: market
description: The market associated with the pool update, decoded from a hexadecimal value.
data_tests:
- not_null
- name: token
description: The token involved in the pool update, decoded from a hexadecimal value.
data_tests:
- not_null
- name: next_value
description: |
The amount in the pool for the specified token, normalized by dividing the raw value
by `POWER(10, token_decimals)`, where `token_decimals` is derived from ERC-20 token metadata.
data_tests:
- not_null
- name: delta
description: |
The change in the pool amount for the specified token, normalized by dividing the raw value
by `POWER(10, token_decimals)`, where `token_decimals` is derived from ERC-20 token metadata.
data_tests:
- not_null
- name: tx_from
description: The address that initiated the transaction.
- name: tx_to
description: The destination address of the transaction.
- name: tx_index
description: The index value related to the transaction, used for unique identification.


- name: gmx_v2_arbitrum_set_uint
meta:
blockchain: arbitrum
sector: dex
project: gmx
contributors: ai_data_master, gmx-io
config:
tags: ['arbitrum', 'gmx', 'event', 'set_uint']
description: |
Processes decoded event data for `SetUint` events on the GMX platform in the Arbitrum blockchain.
This model normalizes the value field and extracts additional details such as the base key and associated data,
ensuring compatibility with downstream analyses.

columns:
- *blockchain
- *block_time
- *block_date
- *block_number
- *tx_hash
- *index
- *contract_address
- name: event_name
description: The type of event recorded, always 'SetUint' for this model
data_tests:
- not_null
- *msg_sender
- name: base_key
description: The base key associated with the event, decoded from a hexadecimal value.
data_tests:
- not_null
- name: data
description: The associated data field, decoded from a hexadecimal value.
data_tests:
- not_null
- name: value_raw
description: |
The value associated with the event.
data_type: float
data_tests:
- not_null
- name: tx_from
description: The address that initiated the transaction.
- name: tx_to
description: The destination address of the transaction.
- name: tx_index
description: The index value related to the transaction, used for unique identification.
Loading