From 5aedad7691e3a2ac5c2b77ef33a1debd422b6c2d Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Mon, 22 Jul 2024 16:27:00 +0300 Subject: [PATCH 01/14] Add tests --- .../raw/arbitrum/mainnet/core/schema.yml | 300 +++++++++++++++++- .../models/raw/arbitrum/mainnet/schema.yml | 8 +- .../models/raw/arbitrum/sepolia/schema.yml | 6 +- .../models/raw/base/mainnet/schema.yml | 6 +- .../models/raw/base/sepolia/schema.yml | 6 +- 5 files changed, 318 insertions(+), 8 deletions(-) diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml index 55b8d46f..6b05eb3b 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml @@ -4,218 +4,510 @@ models: description: AccountCreated events from the CoreProxy contract columns: - name: owner + description: "Address of the account owner" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null + - dbt_utils.recency: + date_part: day + field: ts + interval: 1 + config: + severity: warn - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_value: + values: ["AccountCreated"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: core_delegation_updated_arbitrum_mainnet description: DelegationUpdated events from the CoreProxy contract columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: leverage + description: "Leverage" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 1000000000000000000 + max_value: 1000000000000000000 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: amount + description: "Amount delegated" data_type: numeric + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_value: + values: ["DelegationUpdated"] - name: core_deposited_arbitrum_mainnet description: Deposited events from the CoreProxy contract columns: - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_value: + values: ["Deposited"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null - name: sender + description: "Address of the depositor" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: token_amount + description: "Token amount deposited" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_withdrawn_arbitrum_mainnet description: Withdrawn events from the CoreProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: token_amount + description: "Token amount withdrawn" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: sender + description: "Address of the withdrawer" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_value: + values: ["Withdrawn"] - name: core_liquidation_arbitrum_mainnet description: Liquidation events from the CoreProxy contract columns: - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_value: + values: ["Liquidation"] - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: sender + description: "Address of the liquidator" data_type: text + tests: + - not_null - name: liquidation_data data_type: jsonb - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: liquidate_as_account_id data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_market_updated_arbitrum_mainnet - description: Combination of MarketCollateralDeposited, - MarketCollateralWithdrawn, MarketUsdDeposited, MarketUsdWithdrawn events - from the CoreProxy contract + description: > + Combination of MarketCollateralDeposited, MarketCollateralWithdrawn, + MarketUsdDeposited, MarketUsdWithdrawn events from the CoreProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_value: + values: ["Liquidation"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: net_issuance + description: "Net issuance" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: deposited_collateral_value + description: "Deposited collateral value" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: credit_capacity + description: "Credit capacity" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: token_amount + description: "Token amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_market_registered_arbitrum_mainnet description: MarketRegistered events from the CoreProxy contract columns: - name: market + description: "Market name" data_type: text + tests: + - not_null - name: market_id + description: "Market ID" data_type: numeric + tests: + - not_null + - unique - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_value: + values: ["MarketRegistered"] - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: core_pool_created_arbitrum_mainnet - description: PoolCreated events from the CoreProxy contract + description: "PoolCreated events from the CoreProxy contract" columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_value: + values: ["MarketRegistered"] - name: owner + description: "Address of the pool owner" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_rewards_claimed_arbitrum_mainnet description: RewardsClaimed events from the CoreProxy contract columns: diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml index 088a8162..cccb27ce 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml @@ -7,8 +7,14 @@ models: description: UTC timestamp data_type: timestamp with time zone - name: block_number - data_type: integer description: Block height + data_type: integer tests: - not_null - unique + - dbt_utils.recency: + date_part: hour + field: ts + interval: 1 + - dbt_utils.sequential_values: + interval: 1 diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml b/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml index 6df24d1d..8b9382a1 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml @@ -7,8 +7,12 @@ models: description: UTC timestamp data_type: timestamp with time zone - name: block_number - data_type: integer description: Block height + data_type: integer tests: - not_null - unique + - dbt_utils.recency: + date_part: hour + field: ts + interval: 1 diff --git a/transformers/synthetix/models/raw/base/mainnet/schema.yml b/transformers/synthetix/models/raw/base/mainnet/schema.yml index f4d24a44..4c5a6dea 100644 --- a/transformers/synthetix/models/raw/base/mainnet/schema.yml +++ b/transformers/synthetix/models/raw/base/mainnet/schema.yml @@ -7,8 +7,12 @@ models: description: UTC timestamp data_type: timestamp with time zone - name: block_number - data_type: integer description: Block height + data_type: integer tests: - not_null - unique + - dbt_utils.recency: + date_part: hour + field: ts + interval: 1 diff --git a/transformers/synthetix/models/raw/base/sepolia/schema.yml b/transformers/synthetix/models/raw/base/sepolia/schema.yml index 9582d4fe..ddfefc4a 100644 --- a/transformers/synthetix/models/raw/base/sepolia/schema.yml +++ b/transformers/synthetix/models/raw/base/sepolia/schema.yml @@ -7,8 +7,12 @@ models: description: UTC timestamp data_type: timestamp with time zone - name: block_number - data_type: integer description: Block height + data_type: integer tests: - not_null - unique + - dbt_utils.recency: + date_part: hour + field: ts + interval: 1 From da929e11ad4ff755e92454a784f11de5cdf24089 Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Mon, 22 Jul 2024 16:40:37 +0300 Subject: [PATCH 02/14] Fix some tests --- .../raw/arbitrum/mainnet/core/schema.yml | 35 +++++++++++++++---- .../models/raw/arbitrum/mainnet/schema.yml | 9 ++--- .../models/raw/arbitrum/sepolia/schema.yml | 11 +++--- .../models/raw/base/mainnet/schema.yml | 11 +++--- .../models/raw/base/sepolia/schema.yml | 11 +++--- 5 files changed, 55 insertions(+), 22 deletions(-) diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml index 6b05eb3b..8c55ba95 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml @@ -2,6 +2,11 @@ version: 2 models: - name: core_account_created_arbitrum_mainnet description: AccountCreated events from the CoreProxy contract + tests: + - dbt_utils.recency: + datepart: hour + field: block_timestamp + interval: 1 columns: - name: owner description: "Address of the account owner" @@ -37,12 +42,6 @@ models: data_type: timestamp with time zone tests: - not_null - - dbt_utils.recency: - date_part: day - field: ts - interval: 1 - config: - severity: warn - name: event_name description: "Event name" data_type: text @@ -74,6 +73,9 @@ models: data_type: numeric tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type description: "Type of delegated collateral" data_type: text @@ -164,6 +166,9 @@ models: data_type: numeric tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender description: "Address of the depositor" data_type: text @@ -228,6 +233,9 @@ models: data_type: numeric tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id description: "ID of the event record" data_type: character varying @@ -302,6 +310,9 @@ models: data_type: numeric tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash description: "Transaction hash" data_type: text @@ -512,11 +523,23 @@ models: description: RewardsClaimed events from the CoreProxy contract columns: - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: event_name data_type: text - name: contract diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml index cccb27ce..1db0697b 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml @@ -2,6 +2,11 @@ version: 2 models: - name: blocks_arbitrum_mainnet description: Block numbers and timestamps + tests: + - dbt_utils.recency: + datepart: hour + field: ts + interval: 1 columns: - name: ts description: UTC timestamp @@ -12,9 +17,5 @@ models: tests: - not_null - unique - - dbt_utils.recency: - date_part: hour - field: ts - interval: 1 - dbt_utils.sequential_values: interval: 1 diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml b/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml index 8b9382a1..9cd29888 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml @@ -2,6 +2,11 @@ version: 2 models: - name: blocks_arbitrum_sepolia description: Block numbers and timestamps + tests: + - dbt_utils.recency: + datepart: hour + field: ts + interval: 1 columns: - name: ts description: UTC timestamp @@ -12,7 +17,5 @@ models: tests: - not_null - unique - - dbt_utils.recency: - date_part: hour - field: ts - interval: 1 + - dbt_utils.sequential_values: + interval: 1 diff --git a/transformers/synthetix/models/raw/base/mainnet/schema.yml b/transformers/synthetix/models/raw/base/mainnet/schema.yml index 4c5a6dea..ba7cb6d0 100644 --- a/transformers/synthetix/models/raw/base/mainnet/schema.yml +++ b/transformers/synthetix/models/raw/base/mainnet/schema.yml @@ -2,6 +2,11 @@ version: 2 models: - name: blocks_base_mainnet description: Block numbers and timestamps + tests: + - dbt_utils.recency: + datepart: hour + field: ts + interval: 1 columns: - name: ts description: UTC timestamp @@ -12,7 +17,5 @@ models: tests: - not_null - unique - - dbt_utils.recency: - date_part: hour - field: ts - interval: 1 + - dbt_utils.sequential_values: + interval: 1 diff --git a/transformers/synthetix/models/raw/base/sepolia/schema.yml b/transformers/synthetix/models/raw/base/sepolia/schema.yml index ddfefc4a..f03eba49 100644 --- a/transformers/synthetix/models/raw/base/sepolia/schema.yml +++ b/transformers/synthetix/models/raw/base/sepolia/schema.yml @@ -2,6 +2,11 @@ version: 2 models: - name: blocks_base_sepolia description: Block numbers and timestamps + tests: + - dbt_utils.recency: + datepart: hour + field: ts + interval: 1 columns: - name: ts description: UTC timestamp @@ -12,7 +17,5 @@ models: tests: - not_null - unique - - dbt_utils.recency: - date_part: hour - field: ts - interval: 1 + - dbt_utils.sequential_values: + interval: 1 From f71e6bcfd361112891617a1b588f2c60c5fa1119 Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Mon, 22 Jul 2024 16:44:40 +0300 Subject: [PATCH 03/14] Fix typo --- .../models/raw/arbitrum/mainnet/core/schema.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml index 8c55ba95..4d1143b8 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml @@ -47,7 +47,7 @@ models: data_type: text tests: - not_null - - accepted_value: + - accepted_values: values: ["AccountCreated"] - name: contract description: "Address of the contract" @@ -128,7 +128,7 @@ models: data_type: text tests: - not_null - - accepted_value: + - accepted_values: values: ["DelegationUpdated"] - name: core_deposited_arbitrum_mainnet description: Deposited events from the CoreProxy contract @@ -154,7 +154,7 @@ models: data_type: text tests: - not_null - - accepted_value: + - accepted_values: values: ["Deposited"] - name: transaction_hash description: "Transaction hash" @@ -252,7 +252,7 @@ models: data_type: text tests: - not_null - - accepted_value: + - accepted_values: values: ["Withdrawn"] - name: core_liquidation_arbitrum_mainnet description: Liquidation events from the CoreProxy contract @@ -291,7 +291,7 @@ models: data_type: text tests: - not_null - - accepted_value: + - accepted_values: values: ["Liquidation"] - name: collateral_type description: "Type of delegated collateral" @@ -361,7 +361,7 @@ models: data_type: text tests: - not_null - - accepted_value: + - accepted_values: values: ["Liquidation"] - name: market_id description: "ID of the market" @@ -458,7 +458,7 @@ models: data_type: text tests: - not_null - - accepted_value: + - accepted_values: values: ["MarketRegistered"] - name: sender description: "Address of the event initiator" @@ -504,7 +504,7 @@ models: data_type: text tests: - not_null - - accepted_value: + - accepted_values: values: ["MarketRegistered"] - name: owner description: "Address of the pool owner" From 35d1a0cbc393561c77ca0cb66b2e730c01b23796 Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Mon, 22 Jul 2024 17:58:55 +0300 Subject: [PATCH 04/14] Fix tests --- .../raw/arbitrum/mainnet/core/schema.yml | 253 +++++++++++++++++- 1 file changed, 247 insertions(+), 6 deletions(-) diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml index 4d1143b8..bd1c7ae2 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml @@ -123,6 +123,9 @@ models: data_type: numeric tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name description: "Event name" data_type: text @@ -362,7 +365,7 @@ models: tests: - not_null - accepted_values: - values: ["Liquidation"] + values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] - name: market_id description: "ID of the market" data_type: numeric @@ -505,7 +508,7 @@ models: tests: - not_null - accepted_values: - values: ["MarketRegistered"] + values: ["PoolCreated"] - name: owner description: "Address of the pool owner" data_type: text @@ -541,165 +544,403 @@ models: tests: - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["RewardsClaimed"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: amount + description: "Amount delegated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: core_rewards_distributed_arbitrum_mainnet description: RewardsDistributed events from the CoreProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["RewardsDistributed"] - name: amount + description: "Amount claimed" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: start + description: "UNIX timestamp" data_type: numeric - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: duration + description: "Duration in seconds" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_usd_burned_arbitrum_mainnet description: UsdBurned events from the CoreProxy contract columns: - name: amount + description: "Amount burned" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["UsdBurned"] - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: core_usd_minted_arbitrum_mainnet description: UsdMinted events from the CoreProxy contract columns: - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: amount + description: "Amount minted" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["UsdMinted"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: core_vault_liquidation_arbitrum_mainnet description: VaultLiquidation events from the CoreProxy contract columns: - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["VaultLiquidation"] - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: liquidate_as_account_id data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: liquidation_data data_type: jsonb + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: core_vault_collateral_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: bigint - - name: contract_address - data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying + tests: + - not_null - name: amount + description: "Collateral amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_value + description: "Vault collateral value" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_vault_debt_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: bigint - - name: contract_address - data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying + tests: + - not_null - name: debt + description: "Vault debt" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true From b68db451c9cbdeed72cedd20a5ad21ce687b57ff Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Mon, 22 Jul 2024 18:20:46 +0300 Subject: [PATCH 05/14] Improve test coverage for raw core --- .../raw/arbitrum/mainnet/core/schema.yml | 19 +- .../raw/arbitrum/sepolia/core/schema.yml | 573 +++++++++++++++++- .../models/raw/base/mainnet/core/schema.yml | 573 +++++++++++++++++- .../models/raw/base/sepolia/core/schema.yml | 573 +++++++++++++++++- 4 files changed, 1705 insertions(+), 33 deletions(-) diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml index bd1c7ae2..8ec3c7cc 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml @@ -379,9 +379,6 @@ models: data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - name: deposited_collateral_value description: "Deposited collateral value" data_type: numeric @@ -405,9 +402,6 @@ models: data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - name: token_amount description: "Token amount" data_type: numeric @@ -911,6 +905,11 @@ models: - dbt_utils.accepted_range: min_value: 0 inclusive: true + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null - name: core_vault_debt_arbitrum_mainnet columns: - name: ts @@ -941,6 +940,8 @@ models: data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/core/schema.yml b/transformers/synthetix/models/raw/arbitrum/sepolia/core/schema.yml index 14b9b786..ab1cedac 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/core/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/core/schema.yml @@ -2,389 +2,946 @@ version: 2 models: - name: core_account_created_arbitrum_sepolia description: AccountCreated events from the CoreProxy contract + tests: + - dbt_utils.recency: + datepart: hour + field: block_timestamp + interval: 1 columns: - name: owner + description: "Address of the account owner" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["AccountCreated"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: core_delegation_updated_arbitrum_sepolia description: DelegationUpdated events from the CoreProxy contract columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: leverage + description: "Leverage" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 1000000000000000000 + max_value: 1000000000000000000 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: amount + description: "Amount delegated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["DelegationUpdated"] - name: core_deposited_arbitrum_sepolia description: Deposited events from the CoreProxy contract columns: - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["Deposited"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the depositor" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: token_amount + description: "Token amount deposited" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_withdrawn_arbitrum_sepolia description: Withdrawn events from the CoreProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: token_amount + description: "Token amount withdrawn" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: sender + description: "Address of the withdrawer" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["Withdrawn"] - name: core_liquidation_arbitrum_sepolia description: Liquidation events from the CoreProxy contract columns: - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["Liquidation"] - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: sender + description: "Address of the liquidator" data_type: text + tests: + - not_null - name: liquidation_data data_type: jsonb - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: liquidate_as_account_id data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_market_updated_arbitrum_sepolia - description: Combination of MarketCollateralDeposited, - MarketCollateralWithdrawn, MarketUsdDeposited, MarketUsdWithdrawn events - from the CoreProxy contract + description: > + Combination of MarketCollateralDeposited, MarketCollateralWithdrawn, + MarketUsdDeposited, MarketUsdWithdrawn events from the CoreProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: net_issuance + description: "Net issuance" data_type: numeric + tests: + - not_null - name: deposited_collateral_value + description: "Deposited collateral value" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: credit_capacity + description: "Credit capacity" data_type: numeric + tests: + - not_null - name: token_amount + description: "Token amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_market_registered_arbitrum_sepolia description: MarketRegistered events from the CoreProxy contract columns: - name: market + description: "Market name" data_type: text + tests: + - not_null - name: market_id + description: "Market ID" data_type: numeric + tests: + - not_null + - unique - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketRegistered"] - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: core_pool_created_arbitrum_sepolia - description: PoolCreated events from the CoreProxy contract + description: "PoolCreated events from the CoreProxy contract" columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["PoolCreated"] - name: owner + description: "Address of the pool owner" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_rewards_claimed_arbitrum_sepolia description: RewardsClaimed events from the CoreProxy contract columns: - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["RewardsClaimed"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: amount + description: "Amount delegated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: core_rewards_distributed_arbitrum_sepolia description: RewardsDistributed events from the CoreProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["RewardsDistributed"] - name: amount + description: "Amount claimed" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: start + description: "UNIX timestamp" data_type: numeric - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: duration + description: "Duration in seconds" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_usd_burned_arbitrum_sepolia description: UsdBurned events from the CoreProxy contract columns: - name: amount + description: "Amount burned" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["UsdBurned"] - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: core_usd_minted_arbitrum_sepolia description: UsdMinted events from the CoreProxy contract columns: - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: amount + description: "Amount minted" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["UsdMinted"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: core_vault_liquidation_arbitrum_sepolia description: VaultLiquidation events from the CoreProxy contract columns: - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["VaultLiquidation"] - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: liquidate_as_account_id data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: liquidation_data data_type: jsonb + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: core_vault_collateral_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: bigint - - name: contract_address - data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying + tests: + - not_null - name: amount + description: "Collateral amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_value + description: "Vault collateral value" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null - name: core_vault_debt_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: bigint - - name: contract_address - data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying + tests: + - not_null - name: debt + description: "Vault debt" data_type: numeric + tests: + - not_null + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null diff --git a/transformers/synthetix/models/raw/base/mainnet/core/schema.yml b/transformers/synthetix/models/raw/base/mainnet/core/schema.yml index 0e44e972..ff6f954e 100644 --- a/transformers/synthetix/models/raw/base/mainnet/core/schema.yml +++ b/transformers/synthetix/models/raw/base/mainnet/core/schema.yml @@ -2,389 +2,946 @@ version: 2 models: - name: core_account_created_base_mainnet description: AccountCreated events from the CoreProxy contract + tests: + - dbt_utils.recency: + datepart: hour + field: block_timestamp + interval: 1 columns: - name: owner + description: "Address of the account owner" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["AccountCreated"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: core_delegation_updated_base_mainnet description: DelegationUpdated events from the CoreProxy contract columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: leverage + description: "Leverage" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 1000000000000000000 + max_value: 1000000000000000000 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: amount + description: "Amount delegated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["DelegationUpdated"] - name: core_deposited_base_mainnet description: Deposited events from the CoreProxy contract columns: - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["Deposited"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the depositor" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: token_amount + description: "Token amount deposited" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_withdrawn_base_mainnet description: Withdrawn events from the CoreProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: token_amount + description: "Token amount withdrawn" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: sender + description: "Address of the withdrawer" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["Withdrawn"] - name: core_liquidation_base_mainnet description: Liquidation events from the CoreProxy contract columns: - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["Liquidation"] - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: sender + description: "Address of the liquidator" data_type: text + tests: + - not_null - name: liquidation_data data_type: jsonb - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: liquidate_as_account_id data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_market_updated_base_mainnet - description: Combination of MarketCollateralDeposited, - MarketCollateralWithdrawn, MarketUsdDeposited, MarketUsdWithdrawn events - from the CoreProxy contract + description: > + Combination of MarketCollateralDeposited, MarketCollateralWithdrawn, + MarketUsdDeposited, MarketUsdWithdrawn events from the CoreProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: net_issuance + description: "Net issuance" data_type: numeric + tests: + - not_null - name: deposited_collateral_value + description: "Deposited collateral value" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: credit_capacity + description: "Credit capacity" data_type: numeric + tests: + - not_null - name: token_amount + description: "Token amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_market_registered_base_mainnet description: MarketRegistered events from the CoreProxy contract columns: - name: market + description: "Market name" data_type: text + tests: + - not_null - name: market_id + description: "Market ID" data_type: numeric + tests: + - not_null + - unique - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketRegistered"] - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: core_pool_created_base_mainnet - description: PoolCreated events from the CoreProxy contract + description: "PoolCreated events from the CoreProxy contract" columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["PoolCreated"] - name: owner + description: "Address of the pool owner" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_rewards_claimed_base_mainnet description: RewardsClaimed events from the CoreProxy contract columns: - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["RewardsClaimed"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: amount + description: "Amount delegated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: core_rewards_distributed_base_mainnet description: RewardsDistributed events from the CoreProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["RewardsDistributed"] - name: amount + description: "Amount claimed" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: start + description: "UNIX timestamp" data_type: numeric - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: duration + description: "Duration in seconds" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_usd_burned_base_mainnet description: UsdBurned events from the CoreProxy contract columns: - name: amount + description: "Amount burned" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["UsdBurned"] - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: core_usd_minted_base_mainnet description: UsdMinted events from the CoreProxy contract columns: - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: amount + description: "Amount minted" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["UsdMinted"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: core_vault_liquidation_base_mainnet description: VaultLiquidation events from the CoreProxy contract columns: - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["VaultLiquidation"] - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: liquidate_as_account_id data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: liquidation_data data_type: jsonb + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: core_vault_collateral_base_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: bigint - - name: contract_address - data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying + tests: + - not_null - name: amount + description: "Collateral amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_value + description: "Vault collateral value" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null - name: core_vault_debt_base_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: bigint - - name: contract_address - data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying + tests: + - not_null - name: debt + description: "Vault debt" data_type: numeric + tests: + - not_null + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null diff --git a/transformers/synthetix/models/raw/base/sepolia/core/schema.yml b/transformers/synthetix/models/raw/base/sepolia/core/schema.yml index 9c7e24d3..c3c65bfc 100644 --- a/transformers/synthetix/models/raw/base/sepolia/core/schema.yml +++ b/transformers/synthetix/models/raw/base/sepolia/core/schema.yml @@ -2,389 +2,946 @@ version: 2 models: - name: core_account_created_base_sepolia description: AccountCreated events from the CoreProxy contract + tests: + - dbt_utils.recency: + datepart: hour + field: block_timestamp + interval: 1 columns: - name: owner + description: "Address of the account owner" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["AccountCreated"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: core_delegation_updated_base_sepolia description: DelegationUpdated events from the CoreProxy contract columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: leverage + description: "Leverage" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 1000000000000000000 + max_value: 1000000000000000000 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: amount + description: "Amount delegated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["DelegationUpdated"] - name: core_deposited_base_sepolia description: Deposited events from the CoreProxy contract columns: - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["Deposited"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the depositor" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: token_amount + description: "Token amount deposited" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_withdrawn_base_sepolia description: Withdrawn events from the CoreProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: token_amount + description: "Token amount withdrawn" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: sender + description: "Address of the withdrawer" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["Withdrawn"] - name: core_liquidation_base_sepolia description: Liquidation events from the CoreProxy contract columns: - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["Liquidation"] - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: sender + description: "Address of the liquidator" data_type: text + tests: + - not_null - name: liquidation_data data_type: jsonb - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: liquidate_as_account_id data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_market_updated_base_sepolia - description: Combination of MarketCollateralDeposited, - MarketCollateralWithdrawn, MarketUsdDeposited, MarketUsdWithdrawn events - from the CoreProxy contract + description: > + Combination of MarketCollateralDeposited, MarketCollateralWithdrawn, + MarketUsdDeposited, MarketUsdWithdrawn events from the CoreProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: net_issuance + description: "Net issuance" data_type: numeric + tests: + - not_null - name: deposited_collateral_value + description: "Deposited collateral value" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: credit_capacity + description: "Credit capacity" data_type: numeric + tests: + - not_null - name: token_amount + description: "Token amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_market_registered_base_sepolia description: MarketRegistered events from the CoreProxy contract columns: - name: market + description: "Market name" data_type: text + tests: + - not_null - name: market_id + description: "Market ID" data_type: numeric + tests: + - not_null + - unique - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketRegistered"] - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: core_pool_created_base_sepolia - description: PoolCreated events from the CoreProxy contract + description: "PoolCreated events from the CoreProxy contract" columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["PoolCreated"] - name: owner + description: "Address of the pool owner" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_rewards_claimed_base_sepolia description: RewardsClaimed events from the CoreProxy contract columns: - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["RewardsClaimed"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: amount + description: "Amount delegated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: core_rewards_distributed_base_sepolia description: RewardsDistributed events from the CoreProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["RewardsDistributed"] - name: amount + description: "Amount claimed" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: start + description: "UNIX timestamp" data_type: numeric - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: duration + description: "Duration in seconds" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: core_usd_burned_base_sepolia description: UsdBurned events from the CoreProxy contract columns: - name: amount + description: "Amount burned" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["UsdBurned"] - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: core_usd_minted_base_sepolia description: UsdMinted events from the CoreProxy contract columns: - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: amount + description: "Amount minted" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["UsdMinted"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: core_vault_liquidation_base_sepolia description: VaultLiquidation events from the CoreProxy contract columns: - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["VaultLiquidation"] - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: liquidate_as_account_id data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: liquidation_data data_type: jsonb + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: sender + description: "Address of the event initiator" data_type: text + tests: + - not_null - name: core_vault_collateral_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: bigint - - name: contract_address - data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying + tests: + - not_null - name: amount + description: "Collateral amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_value + description: "Vault collateral value" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null - name: core_vault_debt_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: bigint - - name: contract_address - data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying + tests: + - not_null - name: debt + description: "Vault debt" data_type: numeric + tests: + - not_null + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null From a8e39837eb5e3b22a33b4f092490dfe14822838a Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Tue, 23 Jul 2024 13:51:49 +0300 Subject: [PATCH 06/14] Improve test coverage raw spot --- .../raw/arbitrum/mainnet/spot/schema.yml | 299 ++++++++++++++++++ .../raw/arbitrum/sepolia/spot/schema.yml | 299 ++++++++++++++++++ .../models/raw/base/mainnet/spot/schema.yml | 299 ++++++++++++++++++ .../models/raw/base/sepolia/spot/schema.yml | 299 ++++++++++++++++++ 4 files changed, 1196 insertions(+) diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/spot/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/spot/schema.yml index e2c62702..dc3b65eb 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/spot/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/spot/schema.yml @@ -4,223 +4,522 @@ models: description: OrderCommitted events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCommitted"] - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: amount_provided + description: "Amount provided" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: async_order_id + description: "Async order ID" data_type: numeric - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: order_type + description: "Type of order" data_type: integer + tests: + - not_null - name: spot_order_settled_arbitrum_mainnet description: OrderSettled events from the SpotMarketProxy contract columns: - name: final_order_amount + description: "Final order amount" data_type: numeric + tests: + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: settler + description: "Address of the settler" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: async_order_id + description: "Async order ID" data_type: numeric - name: order_type + description: "Type of order" data_type: integer + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fees + description: "Fees data" data_type: jsonb - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderSettled"] - name: spot_order_cancelled_arbitrum_mainnet description: OrderCancelled events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: async_order_claim + description: "Async order clain" data_type: jsonb - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCancelled"] - name: async_order_id + description: "Async order ID" data_type: numeric - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: spot_synth_registered_arbitrum_mainnet description: SynthRegistered events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: synth_token_address + description: "Address of the synth token" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthRegistered"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: spot_synth_bought_arbitrum_mainnet description: SynthBought events from the SpotMarketProxy contract columns: - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fees + description: "Fees data" data_type: jsonb - name: synth_returned data_type: numeric - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthBought"] - name: spot_synth_sold_arbitrum_mainnet description: SynthSold events from the SpotMarketProxy contract columns: - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthSold"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fees + description: "Fees data" data_type: jsonb - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_returned + description: "Amount returned" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: spot_synth_wrapped_arbitrum_mainnet description: SynthWrapped events from the SpotMarketProxy contract columns: - name: fees + description: "Fees data" data_type: jsonb - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthWrapped"] - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: amount_wrapped data_type: numeric - name: fees_collected + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: spot_synth_unwrapped_arbitrum_mainnet description: SynthUnwrapped events from the SpotMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: amount_unwrapped + description: "Amount of synth unwrapped" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fees_collected + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthUnwrapped"] - name: fees + description: "Fees data" data_type: jsonb - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/spot/schema.yml b/transformers/synthetix/models/raw/arbitrum/sepolia/spot/schema.yml index 8d838d59..70121a81 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/spot/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/spot/schema.yml @@ -4,223 +4,522 @@ models: description: OrderCommitted events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCommitted"] - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: amount_provided + description: "Amount provided" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: async_order_id + description: "Async order ID" data_type: numeric - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: order_type + description: "Type of order" data_type: integer + tests: + - not_null - name: spot_order_settled_arbitrum_sepolia description: OrderSettled events from the SpotMarketProxy contract columns: - name: final_order_amount + description: "Final order amount" data_type: numeric + tests: + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: settler + description: "Address of the settler" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: async_order_id + description: "Async order ID" data_type: numeric - name: order_type + description: "Type of order" data_type: integer + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fees + description: "Fees data" data_type: jsonb - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderSettled"] - name: spot_order_cancelled_arbitrum_sepolia description: OrderCancelled events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: async_order_claim + description: "Async order clain" data_type: jsonb - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCancelled"] - name: async_order_id + description: "Async order ID" data_type: numeric - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: spot_synth_registered_arbitrum_sepolia description: SynthRegistered events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: synth_token_address + description: "Address of the synth token" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthRegistered"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: spot_synth_bought_arbitrum_sepolia description: SynthBought events from the SpotMarketProxy contract columns: - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fees + description: "Fees data" data_type: jsonb - name: synth_returned data_type: numeric - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthBought"] - name: spot_synth_sold_arbitrum_sepolia description: SynthSold events from the SpotMarketProxy contract columns: - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthSold"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fees + description: "Fees data" data_type: jsonb - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_returned + description: "Amount returned" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: spot_synth_wrapped_arbitrum_sepolia description: SynthWrapped events from the SpotMarketProxy contract columns: - name: fees + description: "Fees data" data_type: jsonb - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthWrapped"] - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: amount_wrapped data_type: numeric - name: fees_collected + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: spot_synth_unwrapped_arbitrum_sepolia description: SynthUnwrapped events from the SpotMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: amount_unwrapped + description: "Amount of synth unwrapped" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fees_collected + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthUnwrapped"] - name: fees + description: "Fees data" data_type: jsonb - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/raw/base/mainnet/spot/schema.yml b/transformers/synthetix/models/raw/base/mainnet/spot/schema.yml index 56c428aa..ea2fe5f6 100644 --- a/transformers/synthetix/models/raw/base/mainnet/spot/schema.yml +++ b/transformers/synthetix/models/raw/base/mainnet/spot/schema.yml @@ -4,223 +4,522 @@ models: description: OrderCommitted events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCommitted"] - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: amount_provided + description: "Amount provided" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: async_order_id + description: "Async order ID" data_type: numeric - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: order_type + description: "Type of order" data_type: integer + tests: + - not_null - name: spot_order_settled_base_mainnet description: OrderSettled events from the SpotMarketProxy contract columns: - name: final_order_amount + description: "Final order amount" data_type: numeric + tests: + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: settler + description: "Address of the settler" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: async_order_id + description: "Async order ID" data_type: numeric - name: order_type + description: "Type of order" data_type: integer + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fees + description: "Fees data" data_type: jsonb - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderSettled"] - name: spot_order_cancelled_base_mainnet description: OrderCancelled events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: async_order_claim + description: "Async order clain" data_type: jsonb - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCancelled"] - name: async_order_id + description: "Async order ID" data_type: numeric - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: spot_synth_registered_base_mainnet description: SynthRegistered events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: synth_token_address + description: "Address of the synth token" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthRegistered"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: spot_synth_bought_base_mainnet description: SynthBought events from the SpotMarketProxy contract columns: - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fees + description: "Fees data" data_type: jsonb - name: synth_returned data_type: numeric - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthBought"] - name: spot_synth_sold_base_mainnet description: SynthSold events from the SpotMarketProxy contract columns: - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthSold"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fees + description: "Fees data" data_type: jsonb - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_returned + description: "Amount returned" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: spot_synth_wrapped_base_mainnet description: SynthWrapped events from the SpotMarketProxy contract columns: - name: fees + description: "Fees data" data_type: jsonb - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthWrapped"] - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: amount_wrapped data_type: numeric - name: fees_collected + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: spot_synth_unwrapped_base_mainnet description: SynthUnwrapped events from the SpotMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: amount_unwrapped + description: "Amount of synth unwrapped" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fees_collected + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthUnwrapped"] - name: fees + description: "Fees data" data_type: jsonb - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/raw/base/sepolia/spot/schema.yml b/transformers/synthetix/models/raw/base/sepolia/spot/schema.yml index 2b37bc70..1f5d9113 100644 --- a/transformers/synthetix/models/raw/base/sepolia/spot/schema.yml +++ b/transformers/synthetix/models/raw/base/sepolia/spot/schema.yml @@ -4,223 +4,522 @@ models: description: OrderCommitted events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCommitted"] - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: amount_provided + description: "Amount provided" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: async_order_id + description: "Async order ID" data_type: numeric - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: order_type + description: "Type of order" data_type: integer + tests: + - not_null - name: spot_order_settled_base_sepolia description: OrderSettled events from the SpotMarketProxy contract columns: - name: final_order_amount + description: "Final order amount" data_type: numeric + tests: + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: settler + description: "Address of the settler" data_type: text + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: async_order_id + description: "Async order ID" data_type: numeric - name: order_type + description: "Type of order" data_type: integer + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fees + description: "Fees data" data_type: jsonb - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderSettled"] - name: spot_order_cancelled_base_sepolia description: OrderCancelled events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: async_order_claim + description: "Async order clain" data_type: jsonb - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: sender + description: "Address of the delegator" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCancelled"] - name: async_order_id + description: "Async order ID" data_type: numeric - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: spot_synth_registered_base_sepolia description: SynthRegistered events from the SpotMarketProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: synth_token_address + description: "Address of the synth token" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthRegistered"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: spot_synth_bought_base_sepolia description: SynthBought events from the SpotMarketProxy contract columns: - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fees + description: "Fees data" data_type: jsonb - name: synth_returned data_type: numeric - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthBought"] - name: spot_synth_sold_base_sepolia description: SynthSold events from the SpotMarketProxy contract columns: - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthSold"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fees + description: "Fees data" data_type: jsonb - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: price + description: "Synth price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_returned + description: "Amount returned" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: spot_synth_wrapped_base_sepolia description: SynthWrapped events from the SpotMarketProxy contract columns: - name: fees + description: "Fees data" data_type: jsonb - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthWrapped"] - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: amount_wrapped data_type: numeric - name: fees_collected + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: spot_synth_unwrapped_base_sepolia description: SynthUnwrapped events from the SpotMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: amount_unwrapped + description: "Amount of synth unwrapped" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fees_collected + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["SynthUnwrapped"] - name: fees + description: "Fees data" data_type: jsonb - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: id + description: "ID of the event record" data_type: character varying tests: - not_null - unique - name: synth_market_id + description: "ID of the synth market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true From ae30d8570e167e6cf4f026cd6923de3968729b7d Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Tue, 23 Jul 2024 14:01:54 +0300 Subject: [PATCH 07/14] Improve test coverage base raw buyback --- .../raw/base/mainnet/buyback/schema.yml | 36 ++++++++++++++++++ .../raw/base/sepolia/buyback/schema.yml | 38 ++++++++++++++++++- 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/transformers/synthetix/models/raw/base/mainnet/buyback/schema.yml b/transformers/synthetix/models/raw/base/mainnet/buyback/schema.yml index a687ac11..df2905fa 100644 --- a/transformers/synthetix/models/raw/base/mainnet/buyback/schema.yml +++ b/transformers/synthetix/models/raw/base/mainnet/buyback/schema.yml @@ -2,20 +2,56 @@ models: - name: buyback_processed_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["BuybackProcessed"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: buyer + description: "Address of the buyer" data_type: text + tests: + - not_null - name: snx + description: "Amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: usd + description: "Value in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/raw/base/sepolia/buyback/schema.yml b/transformers/synthetix/models/raw/base/sepolia/buyback/schema.yml index e86cec9b..df2905fa 100644 --- a/transformers/synthetix/models/raw/base/sepolia/buyback/schema.yml +++ b/transformers/synthetix/models/raw/base/sepolia/buyback/schema.yml @@ -1,21 +1,57 @@ models: - - name: buyback_processed_base_sepolia + - name: buyback_processed_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["BuybackProcessed"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: buyer + description: "Address of the buyer" data_type: text + tests: + - not_null - name: snx + description: "Amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: usd + description: "Value in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true From 2787f9f211c937f47c878a5086c316e89c567c88 Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Tue, 23 Jul 2024 14:05:00 +0300 Subject: [PATCH 08/14] Fix chain name --- .../synthetix/models/raw/base/sepolia/buyback/schema.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transformers/synthetix/models/raw/base/sepolia/buyback/schema.yml b/transformers/synthetix/models/raw/base/sepolia/buyback/schema.yml index df2905fa..f35fb22d 100644 --- a/transformers/synthetix/models/raw/base/sepolia/buyback/schema.yml +++ b/transformers/synthetix/models/raw/base/sepolia/buyback/schema.yml @@ -1,5 +1,5 @@ models: - - name: buyback_processed_base_mainnet + - name: buyback_processed_base_sepolia columns: - name: id description: "ID of the event record" From 8aebde16c160e80780de3219f560a9cff39c1d93 Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Tue, 23 Jul 2024 14:37:40 +0300 Subject: [PATCH 09/14] Improve test coverage base raw perps --- .../models/raw/base/mainnet/perp/schema.yml | 404 +++++++++++++++++- .../models/raw/base/sepolia/perp/schema.yml | 404 +++++++++++++++++- 2 files changed, 772 insertions(+), 36 deletions(-) diff --git a/transformers/synthetix/models/raw/base/mainnet/perp/schema.yml b/transformers/synthetix/models/raw/base/mainnet/perp/schema.yml index 2079515d..9855abd6 100644 --- a/transformers/synthetix/models/raw/base/mainnet/perp/schema.yml +++ b/transformers/synthetix/models/raw/base/mainnet/perp/schema.yml @@ -4,31 +4,101 @@ models: description: AccountCreated events from the PerpsMarketProxy contract columns: - name: id + description: "ID of the event record" tests: - unique - not_null + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["AccountCreated"] + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: owner + description: "Address of the pool owner" + data_type: text + tests: + - not_null + - name: account_id + description: "ID of the account" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null - name: perp_order_committed_base_mainnet description: OrderCommitted events from the PerpsMarketProxy contract columns: - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCommitted"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: commitment_time data_type: numeric - name: expiration_time @@ -51,11 +121,19 @@ models: description: OrderSettled events from the PerpsMarketProxy contract columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: fill_price data_type: numeric - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderSettled"] - name: settlement_reward data_type: numeric - name: settler @@ -67,19 +145,46 @@ models: - name: pnl data_type: numeric - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: size_delta data_type: numeric - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: accrued_funding data_type: numeric - name: referral_fees @@ -87,32 +192,61 @@ models: - name: new_size data_type: numeric - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: perp_market_updated_base_mainnet description: MarketUpdated events from the PerpsMarketProxy contract columns: - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketUpdated"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: skew data_type: numeric - name: size @@ -124,166 +258,400 @@ models: - name: current_funding_velocity data_type: numeric - name: interest_rate + description: "Interest rate" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: perp_position_liquidated_base_mainnet description: PositionLiquidated events from the PerpsMarketProxy contract columns: - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_id + description: "ID of the market" data_type: numeric - - name: id - data_type: character varying tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: id + description: "ID of the event record" + tests: - unique + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: current_position_size + description: "Current position size" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["PositionLiquidated"] - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: amount_liquidated + description: "Amount liquidated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: perp_account_liquidation_attempt_base_mainnet - description: AccountLiquidationAttemp events from the PerpsMarketProxy contract + description: AccountLiquidationAttempt events from the PerpsMarketProxy contract columns: - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: reward + description: "Reward" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["AccountLiquidationAttempt"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: full_liquidation + description: "Whether it is a full or partial liquidation" data_type: boolean + tests: + - not_null - name: perp_collateral_modified_base_mainnet description: CollateralModified events from the PerpsMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["CollateralModified"] - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: amount_delta data_type: numeric - name: synth_market_id + description: "ID of the synth market" data_type: numeric - - name: id - data_type: character varying tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: id + description: "ID of the event record" + tests: - unique + - not_null - name: sender + description: "Sender address" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: perp_previous_order_expired_base_mainnet description: PreviousOrderExpired events from the PerpsMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: tracking_code + description: "Tracking code" data_type: text - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: size_delta data_type: numeric - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["PreviousOrderExpired"] - name: commitment_time data_type: numeric - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: acceptable_price data_type: numeric - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: perp_market_created_base_mainnet + description: MarketCreated events from the PerpsMarketProxy contract columns: - name: market_name + description: "Market name" data_type: text + tests: + - not_null - name: id - data_type: character varying + description: "ID of the event record" + tests: + - unique + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketCreated"] - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: perps_market_id + description: "ID of the perps market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: perp_interest_charged_base_mainnet + description: InterestCharged events from the PerpsMarketProxy contract columns: - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["InterestCharged"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id - data_type: character varying + description: "ID of the event record" + tests: + - unique + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: interest data_type: numeric - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: perp_interest_rate_updated_base_mainnet + description: InterestRateUpdated events from the PerpsMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["InterestRateUpdated"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: interest_rate + description: "Interest rate" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id - data_type: character varying + description: "ID of the event record" + tests: + - unique + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: super_market_id + description: "ID of the super market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/raw/base/sepolia/perp/schema.yml b/transformers/synthetix/models/raw/base/sepolia/perp/schema.yml index 19974871..09df7ff6 100644 --- a/transformers/synthetix/models/raw/base/sepolia/perp/schema.yml +++ b/transformers/synthetix/models/raw/base/sepolia/perp/schema.yml @@ -4,31 +4,101 @@ models: description: AccountCreated events from the PerpsMarketProxy contract columns: - name: id + description: "ID of the event record" tests: - unique - not_null + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["AccountCreated"] + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: owner + description: "Address of the pool owner" + data_type: text + tests: + - not_null + - name: account_id + description: "ID of the account" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null - name: perp_order_committed_base_sepolia description: OrderCommitted events from the PerpsMarketProxy contract columns: - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderCommitted"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: commitment_time data_type: numeric - name: expiration_time @@ -51,11 +121,19 @@ models: description: OrderSettled events from the PerpsMarketProxy contract columns: - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: fill_price data_type: numeric - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["OrderSettled"] - name: settlement_reward data_type: numeric - name: settler @@ -67,19 +145,46 @@ models: - name: pnl data_type: numeric - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collected_fees + description: "Amount of fees collected" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: size_delta data_type: numeric - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: accrued_funding data_type: numeric - name: referral_fees @@ -87,32 +192,61 @@ models: - name: new_size data_type: numeric - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: perp_market_updated_base_sepolia description: MarketUpdated events from the PerpsMarketProxy contract columns: - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketUpdated"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: skew data_type: numeric - name: size @@ -124,166 +258,400 @@ models: - name: current_funding_velocity data_type: numeric - name: interest_rate + description: "Interest rate" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: perp_position_liquidated_base_sepolia description: PositionLiquidated events from the PerpsMarketProxy contract columns: - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_id + description: "ID of the market" data_type: numeric - - name: id - data_type: character varying tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: id + description: "ID of the event record" + tests: - unique + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: current_position_size + description: "Current position size" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["PositionLiquidated"] - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: amount_liquidated + description: "Amount liquidated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: perp_account_liquidation_attempt_base_sepolia - description: AccountLiquidationAttemp events from the PerpsMarketProxy contract + description: AccountLiquidationAttempt events from the PerpsMarketProxy contract columns: - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: reward + description: "Reward" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["AccountLiquidationAttempt"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: full_liquidation + description: "Whether it is a full or partial liquidation" data_type: boolean + tests: + - not_null - name: perp_collateral_modified_base_sepolia description: CollateralModified events from the PerpsMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["CollateralModified"] - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: amount_delta data_type: numeric - name: synth_market_id + description: "ID of the synth market" data_type: numeric - - name: id - data_type: character varying tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: id + description: "ID of the event record" + tests: - unique + - not_null - name: sender + description: "Sender address" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: perp_previous_order_expired_base_sepolia description: PreviousOrderExpired events from the PerpsMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: tracking_code + description: "Tracking code" data_type: text - name: id - data_type: character varying + description: "ID of the event record" tests: - - not_null - unique + - not_null - name: size_delta data_type: numeric - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["PreviousOrderExpired"] - name: commitment_time data_type: numeric - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: acceptable_price data_type: numeric - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: perp_market_created_base_sepolia + description: MarketCreated events from the PerpsMarketProxy contract columns: - name: market_name + description: "Market name" data_type: text + tests: + - not_null - name: id - data_type: character varying + description: "ID of the event record" + tests: + - unique + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketCreated"] - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: perps_market_id + description: "ID of the perps market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: perp_interest_charged_base_sepolia + description: InterestCharged events from the PerpsMarketProxy contract columns: - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["InterestCharged"] - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: id - data_type: character varying + description: "ID of the event record" + tests: + - unique + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: interest data_type: numeric - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: perp_interest_rate_updated_base_sepolia + description: InterestRateUpdated events from the PerpsMarketProxy contract columns: - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["InterestRateUpdated"] - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: interest_rate + description: "Interest rate" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: id - data_type: character varying + description: "ID of the event record" + tests: + - unique + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: super_market_id + description: "ID of the super market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true From 669a7bfbb7007c8649b62b2314548f20c9a3117c Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Tue, 23 Jul 2024 16:43:42 +0300 Subject: [PATCH 10/14] Improve test coverage base marts --- .../marts/arbitrum/mainnet/core/schema.yml | 386 +++++++++++++++++- .../marts/arbitrum/mainnet/prices/schema.yml | 27 ++ .../marts/arbitrum/mainnet/spot/schema.yml | 79 ++++ .../marts/arbitrum/sepolia/core/schema.yml | 386 +++++++++++++++++- .../marts/arbitrum/sepolia/prices/schema.yml | 27 ++ .../marts/arbitrum/sepolia/spot/schema.yml | 79 ++++ 6 files changed, 950 insertions(+), 34 deletions(-) diff --git a/transformers/synthetix/models/marts/arbitrum/mainnet/core/schema.yml b/transformers/synthetix/models/marts/arbitrum/mainnet/core/schema.yml index 3d8b7b2b..7aea07f1 100644 --- a/transformers/synthetix/models/marts/arbitrum/mainnet/core/schema.yml +++ b/transformers/synthetix/models/marts/arbitrum/mainnet/core/schema.yml @@ -3,17 +3,41 @@ models: - name: fct_pool_rewards_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: token_symbol + description: "Token symbol" data_type: text + tests: + - not_null - name: amount + description: "Reward amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: ts_start data_type: timestamp with time zone - name: duration @@ -21,53 +45,145 @@ models: - name: fct_core_account_delegation_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: account_id - data_type: text + description: "ID of the account" + data_type: numeric + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: amount_delegated + description: "Amount of delegated collateral" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_core_apr_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: collateral_value + description: "Collateral value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: debt + description: "Debt value (USD)" data_type: numeric + tests: + - not_null - name: hourly_issuance + description: "Hourly issuance" data_type: numeric + tests: + - not_null - name: hourly_pnl + description: "Hourly PnL" data_type: numeric + tests: + - not_null - name: cumulative_pnl + description: "Cumulative PnL" data_type: numeric + tests: + - not_null - name: cumulative_issuance + description: "Cumulative Issuance" data_type: numeric + tests: + - not_null - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: hourly_pnl_pct - data_type: numeric + description: "Hourly PnL (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: -1 + max_value: 1 + inclusive: true - name: hourly_rewards_pct - data_type: numeric + description: "Hourly Rewards (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + max_value: 1 + inclusive: true - name: apr_24h + description: "APR (24h)" data_type: numeric + tests: + - not_null - name: apy_24h + description: "APY (24h)" data_type: numeric + tests: + - not_null - name: apr_7d + description: "APR (7d)" data_type: numeric + tests: + - not_null - name: apy_7d + description: "APY (7d)" data_type: numeric + tests: + - not_null - name: apr_28d + description: "APR (28d)" data_type: numeric + tests: + - not_null - name: apy_28d + description: "APY (28d)" data_type: numeric + tests: + - not_null - name: apr_24h_pnl data_type: numeric - name: apy_24h_pnl @@ -95,140 +211,376 @@ models: - name: fct_core_market_updated_arbitrum_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: credit_capacity + description: "Credit capacity" data_type: numeric + tests: + - not_null - name: net_issuance + description: "Net issuance" data_type: numeric + tests: + - not_null - name: token_amount + description: "Token amount" data_type: numeric + tests: + - not_null - name: fct_core_pool_collateral_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: amount_deposited + description: "Amount deposited" data_type: numeric + tests: + - not_null - name: fct_core_pool_delegation_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: amount_delegated data_type: numeric - name: fct_core_pools_arbitrum_mainnet columns: - name: id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: created_ts + description: "Pool creation timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: owner + description: "Address of the pool owner" data_type: text + tests: + - not_null - name: fct_pool_debt_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number - data_type: bigint - - name: pool_id + description: "Block number" data_type: integer + tests: + - not_null + - name: pool_id + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: debt + description: "Debt value (USD)" data_type: numeric + tests: + - not_null - name: fct_pool_issuance_hourly_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: hourly_issuance + description: "Hourly issuance" data_type: numeric + tests: + - not_null - name: fct_pool_issuance_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null - name: amount + description: "Amount issued" data_type: numeric + tests: + - not_null - name: fct_pool_pnl_hourly_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: collateral_value + description: "Collateral value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: debt + description: "Debt value (USD)" data_type: numeric + tests: + - not_null - name: hourly_issuance + description: "Hourly issuance" data_type: numeric + tests: + - not_null - name: hourly_pnl + description: "Hourly PnL" data_type: numeric + tests: + - not_null - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: hourly_pnl_pct - data_type: numeric + description: "Hourly PnL (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: -1 + max_value: 1 + inclusive: true - name: hourly_rewards_pct - data_type: numeric + description: "Hourly Rewards (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + max_value: 1 + inclusive: true - name: hourly_total_pct + description: "Hourly Total (%)" data_type: numeric + tests: + - not_null - name: fct_pool_rewards_hourly_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_pool_rewards_token_hourly_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: token_symbol + description: "Token symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: hourly_amount + description: "Hourly rewards amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_distributed + description: "Distributed rewards amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/marts/arbitrum/mainnet/prices/schema.yml b/transformers/synthetix/models/marts/arbitrum/mainnet/prices/schema.yml index 0f1fff2b..89a22dbc 100644 --- a/transformers/synthetix/models/marts/arbitrum/mainnet/prices/schema.yml +++ b/transformers/synthetix/models/marts/arbitrum/mainnet/prices/schema.yml @@ -2,18 +2,45 @@ models: - name: fct_prices_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_address + description: "Market address" data_type: text + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_prices_hourly_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/marts/arbitrum/mainnet/spot/schema.yml b/transformers/synthetix/models/marts/arbitrum/mainnet/spot/schema.yml index 43ad9731..5d5e6d8c 100644 --- a/transformers/synthetix/models/marts/arbitrum/mainnet/spot/schema.yml +++ b/transformers/synthetix/models/marts/arbitrum/mainnet/spot/schema.yml @@ -2,52 +2,131 @@ models: - name: fct_synth_supply_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: supply + description: "Supply" data_type: numeric + tests: + - not_null - name: fct_spot_atomics_arbitrum_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: tx_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: price + description: "Price" data_type: numeric + tests: + - not_null - name: amount + description: "Amount" data_type: numeric + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fct_spot_markets_arbitrum_mainnet columns: - name: id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: created_ts data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: token_address + description: "Token address" data_type: text + tests: + - not_null - name: fct_spot_wrapper_arbitrum_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: tx_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_wrapped + description: "Amount wrapped" data_type: numeric + tests: + - not_null diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/core/schema.yml b/transformers/synthetix/models/marts/arbitrum/sepolia/core/schema.yml index 6f6c73e2..65c1a2fd 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/core/schema.yml +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/core/schema.yml @@ -3,17 +3,41 @@ models: - name: fct_pool_rewards_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: token_symbol + description: "Token symbol" data_type: text + tests: + - not_null - name: amount + description: "Reward amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: ts_start data_type: timestamp with time zone - name: duration @@ -21,53 +45,145 @@ models: - name: fct_core_account_delegation_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: account_id - data_type: text + description: "ID of the account" + data_type: numeric + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: amount_delegated + description: "Amount of delegated collateral" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_core_apr_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: collateral_value + description: "Collateral value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: debt + description: "Debt value (USD)" data_type: numeric + tests: + - not_null - name: hourly_issuance + description: "Hourly issuance" data_type: numeric + tests: + - not_null - name: hourly_pnl + description: "Hourly PnL" data_type: numeric + tests: + - not_null - name: cumulative_pnl + description: "Cumulative PnL" data_type: numeric + tests: + - not_null - name: cumulative_issuance + description: "Cumulative Issuance" data_type: numeric + tests: + - not_null - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: hourly_pnl_pct - data_type: numeric + description: "Hourly PnL (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: -1 + max_value: 1 + inclusive: true - name: hourly_rewards_pct - data_type: numeric + description: "Hourly Rewards (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + max_value: 1 + inclusive: true - name: apr_24h + description: "APR (24h)" data_type: numeric + tests: + - not_null - name: apy_24h + description: "APY (24h)" data_type: numeric + tests: + - not_null - name: apr_7d + description: "APR (7d)" data_type: numeric + tests: + - not_null - name: apy_7d + description: "APY (7d)" data_type: numeric + tests: + - not_null - name: apr_28d + description: "APR (28d)" data_type: numeric + tests: + - not_null - name: apy_28d + description: "APY (28d)" data_type: numeric + tests: + - not_null - name: apr_24h_pnl data_type: numeric - name: apy_24h_pnl @@ -95,140 +211,376 @@ models: - name: fct_core_market_updated_arbitrum_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: credit_capacity + description: "Credit capacity" data_type: numeric + tests: + - not_null - name: net_issuance + description: "Net issuance" data_type: numeric + tests: + - not_null - name: token_amount + description: "Token amount" data_type: numeric + tests: + - not_null - name: fct_core_pool_collateral_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: amount_deposited + description: "Amount deposited" data_type: numeric + tests: + - not_null - name: fct_core_pool_delegation_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: amount_delegated data_type: numeric - name: fct_core_pools_arbitrum_sepolia columns: - name: id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: created_ts + description: "Pool creation timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: owner + description: "Address of the pool owner" data_type: text + tests: + - not_null - name: fct_pool_debt_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number - data_type: bigint - - name: pool_id + description: "Block number" data_type: integer + tests: + - not_null + - name: pool_id + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: debt + description: "Debt value (USD)" data_type: numeric + tests: + - not_null - name: fct_pool_issuance_hourly_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: hourly_issuance + description: "Hourly issuance" data_type: numeric + tests: + - not_null - name: fct_pool_issuance_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null - name: amount + description: "Amount issued" data_type: numeric + tests: + - not_null - name: fct_pool_pnl_hourly_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: collateral_value + description: "Collateral value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: debt + description: "Debt value (USD)" data_type: numeric + tests: + - not_null - name: hourly_issuance + description: "Hourly issuance" data_type: numeric + tests: + - not_null - name: hourly_pnl + description: "Hourly PnL" data_type: numeric + tests: + - not_null - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: hourly_pnl_pct - data_type: numeric + description: "Hourly PnL (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: -1 + max_value: 1 + inclusive: true - name: hourly_rewards_pct - data_type: numeric + description: "Hourly Rewards (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + max_value: 1 + inclusive: true - name: hourly_total_pct + description: "Hourly Total (%)" data_type: numeric + tests: + - not_null - name: fct_pool_rewards_hourly_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_pool_rewards_token_hourly_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: token_symbol + description: "Token symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: hourly_amount + description: "Hourly rewards amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_distributed + description: "Distributed rewards amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/prices/schema.yml b/transformers/synthetix/models/marts/arbitrum/sepolia/prices/schema.yml index 881afc59..623ee1b3 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/prices/schema.yml +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/prices/schema.yml @@ -2,18 +2,45 @@ models: - name: fct_prices_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_address + description: "Market address" data_type: text + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_prices_hourly_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/marts/arbitrum/sepolia/spot/schema.yml b/transformers/synthetix/models/marts/arbitrum/sepolia/spot/schema.yml index 87d1d821..73fe1c98 100644 --- a/transformers/synthetix/models/marts/arbitrum/sepolia/spot/schema.yml +++ b/transformers/synthetix/models/marts/arbitrum/sepolia/spot/schema.yml @@ -2,52 +2,131 @@ models: - name: fct_synth_supply_arbitrum_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: supply + description: "Supply" data_type: numeric + tests: + - not_null - name: fct_spot_atomics_arbitrum_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: tx_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: price + description: "Price" data_type: numeric + tests: + - not_null - name: amount + description: "Amount" data_type: numeric + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fct_spot_markets_arbitrum_sepolia columns: - name: id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: created_ts data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: token_address + description: "Token address" data_type: text + tests: + - not_null - name: fct_spot_wrapper_arbitrum_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: tx_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_wrapped + description: "Amount wrapped" data_type: numeric + tests: + - not_null From 7abd92a02b20b9f2179668c4cb00238e0b9d88da Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Tue, 23 Jul 2024 16:53:55 +0300 Subject: [PATCH 11/14] Improve test coverage base marts --- .../models/marts/base/mainnet/core/schema.yml | 450 +++++++- .../marts/base/mainnet/prices/schema.yml | 27 + .../models/marts/base/mainnet/spot/schema.yml | 79 ++ .../models/marts/base/sepolia/core/schema.yml | 1001 ++++++++++++++--- .../marts/base/sepolia/prices/schema.yml | 27 + .../models/marts/base/sepolia/spot/schema.yml | 79 ++ 6 files changed, 1485 insertions(+), 178 deletions(-) diff --git a/transformers/synthetix/models/marts/base/mainnet/core/schema.yml b/transformers/synthetix/models/marts/base/mainnet/core/schema.yml index 79e52021..a1e823af 100644 --- a/transformers/synthetix/models/marts/base/mainnet/core/schema.yml +++ b/transformers/synthetix/models/marts/base/mainnet/core/schema.yml @@ -3,87 +3,233 @@ models: - name: fct_core_vault_collateral_base_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number - data_type: bigint + description: "Block number" + data_type: integer + tests: + - not_null - name: contract_address + description: "Address of the contract" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying + tests: + - not_null - name: amount + description: "Collateral amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_value - data_type: numeric - - name: fct_pool_rewards_base_mainnet + description: "Vault collateral value" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: fct_pool_rewards_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: token_symbol + description: "Token symbol" data_type: text + tests: + - not_null - name: amount + description: "Reward amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: ts_start data_type: timestamp with time zone - name: duration data_type: numeric - - name: fct_core_account_delegation_base_mainnet + - name: fct_core_account_delegation_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: account_id - data_type: text + description: "ID of the account" + data_type: numeric + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: amount_delegated - data_type: numeric - - name: fct_core_apr_base_mainnet + description: "Amount of delegated collateral" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: fct_core_apr_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: collateral_value + description: "Collateral value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: debt + description: "Debt value (USD)" data_type: numeric + tests: + - not_null - name: hourly_issuance + description: "Hourly issuance" data_type: numeric + tests: + - not_null - name: hourly_pnl + description: "Hourly PnL" data_type: numeric + tests: + - not_null - name: cumulative_pnl + description: "Cumulative PnL" data_type: numeric + tests: + - not_null - name: cumulative_issuance + description: "Cumulative Issuance" data_type: numeric + tests: + - not_null - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: hourly_pnl_pct - data_type: numeric + description: "Hourly PnL (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: -1 + max_value: 1 + inclusive: true - name: hourly_rewards_pct - data_type: numeric + description: "Hourly Rewards (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + max_value: 1 + inclusive: true - name: apr_24h + description: "APR (24h)" data_type: numeric + tests: + - not_null - name: apy_24h + description: "APY (24h)" data_type: numeric + tests: + - not_null - name: apr_7d + description: "APR (7d)" data_type: numeric + tests: + - not_null - name: apy_7d + description: "APY (7d)" data_type: numeric + tests: + - not_null - name: apr_28d + description: "APR (28d)" data_type: numeric + tests: + - not_null - name: apy_28d + description: "APY (28d)" data_type: numeric + tests: + - not_null - name: apr_24h_pnl data_type: numeric - name: apy_24h_pnl @@ -108,143 +254,379 @@ models: data_type: numeric - name: apy_28d_rewards data_type: numeric - - name: fct_core_market_updated_base_mainnet + - name: fct_core_market_updated_arbitrum_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: credit_capacity + description: "Credit capacity" data_type: numeric + tests: + - not_null - name: net_issuance + description: "Net issuance" data_type: numeric + tests: + - not_null - name: token_amount + description: "Token amount" data_type: numeric - - name: fct_core_pool_collateral_base_mainnet + tests: + - not_null + - name: fct_core_pool_collateral_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: amount_deposited + description: "Amount deposited" data_type: numeric - - name: fct_core_pool_delegation_base_mainnet + tests: + - not_null + - name: fct_core_pool_delegation_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: amount_delegated data_type: numeric - - name: fct_core_pools_base_mainnet + - name: fct_core_pools_arbitrum_mainnet columns: - name: id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: created_ts + description: "Pool creation timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: owner + description: "Address of the pool owner" data_type: text - - name: fct_pool_debt_base_mainnet + tests: + - not_null + - name: fct_pool_debt_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number - data_type: bigint - - name: pool_id + description: "Block number" data_type: integer + tests: + - not_null + - name: pool_id + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: debt + description: "Debt value (USD)" data_type: numeric - - name: fct_pool_issuance_hourly_base_mainnet + tests: + - not_null + - name: fct_pool_issuance_hourly_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: hourly_issuance + description: "Hourly issuance" data_type: numeric - - name: fct_pool_issuance_base_mainnet + tests: + - not_null + - name: fct_pool_issuance_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null - name: amount + description: "Amount issued" data_type: numeric - - name: fct_pool_pnl_hourly_base_mainnet + tests: + - not_null + - name: fct_pool_pnl_hourly_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: collateral_value + description: "Collateral value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: debt + description: "Debt value (USD)" data_type: numeric + tests: + - not_null - name: hourly_issuance + description: "Hourly issuance" data_type: numeric + tests: + - not_null - name: hourly_pnl + description: "Hourly PnL" data_type: numeric + tests: + - not_null - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: hourly_pnl_pct - data_type: numeric + description: "Hourly PnL (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: -1 + max_value: 1 + inclusive: true - name: hourly_rewards_pct - data_type: numeric + description: "Hourly Rewards (%)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + max_value: 1 + inclusive: true - name: hourly_total_pct + description: "Hourly Total (%)" data_type: numeric - - name: fct_pool_rewards_hourly_base_mainnet + tests: + - not_null + - name: fct_pool_rewards_hourly_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: rewards_usd - data_type: numeric - - name: fct_pool_rewards_token_hourly_base_mainnet + description: "Rewards value (USD)" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: fct_pool_rewards_token_hourly_arbitrum_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: pool_id - data_type: integer + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type - data_type: character varying + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: distributor + description: "Address of the distributor" data_type: text + tests: + - not_null - name: token_symbol + description: "Token symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: hourly_amount + description: "Hourly rewards amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_distributed + description: "Distributed rewards amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/marts/base/mainnet/prices/schema.yml b/transformers/synthetix/models/marts/base/mainnet/prices/schema.yml index be52b88b..47140acf 100644 --- a/transformers/synthetix/models/marts/base/mainnet/prices/schema.yml +++ b/transformers/synthetix/models/marts/base/mainnet/prices/schema.yml @@ -2,18 +2,45 @@ models: - name: fct_prices_base_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_address + description: "Market address" data_type: text + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_prices_hourly_base_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/marts/base/mainnet/spot/schema.yml b/transformers/synthetix/models/marts/base/mainnet/spot/schema.yml index f6d3d78f..240644b5 100644 --- a/transformers/synthetix/models/marts/base/mainnet/spot/schema.yml +++ b/transformers/synthetix/models/marts/base/mainnet/spot/schema.yml @@ -2,52 +2,131 @@ models: - name: fct_synth_supply_base_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: supply + description: "Supply" data_type: numeric + tests: + - not_null - name: fct_spot_atomics_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: tx_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: price + description: "Price" data_type: numeric + tests: + - not_null - name: amount + description: "Amount" data_type: numeric + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fct_spot_markets_base_mainnet columns: - name: id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: created_ts data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: token_address + description: "Token address" data_type: text + tests: + - not_null - name: fct_spot_wrapper_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: tx_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_wrapped + description: "Amount wrapped" data_type: numeric + tests: + - not_null diff --git a/transformers/synthetix/models/marts/base/sepolia/core/schema.yml b/transformers/synthetix/models/marts/base/sepolia/core/schema.yml index 8b5b7ca0..c3c65bfc 100644 --- a/transformers/synthetix/models/marts/base/sepolia/core/schema.yml +++ b/transformers/synthetix/models/marts/base/sepolia/core/schema.yml @@ -1,234 +1,947 @@ version: 2 models: - - name: fct_pool_rewards_base_sepolia + - name: core_account_created_base_sepolia + description: AccountCreated events from the CoreProxy contract + tests: + - dbt_utils.recency: + datepart: hour + field: block_timestamp + interval: 1 columns: - - name: ts - data_type: timestamp with time zone - - name: pool_id + - name: owner + description: "Address of the account owner" + data_type: text + tests: + - not_null + - name: account_id + description: "ID of the account" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: block_number + description: "Block number" data_type: integer + tests: + - not_null + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["AccountCreated"] + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: core_delegation_updated_base_sepolia + description: DelegationUpdated events from the CoreProxy contract + columns: + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: account_id + description: "ID of the account" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text - - name: distributor + tests: + - not_null + - name: pool_id + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: sender + description: "Address of the delegator" data_type: text - - name: token_symbol + tests: + - not_null + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: leverage + description: "Leverage" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 1000000000000000000 + max_value: 1000000000000000000 + inclusive: true + - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: amount + description: "Amount delegated" data_type: numeric - - name: ts_start + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["DelegationUpdated"] + - name: core_deposited_base_sepolia + description: Deposited events from the CoreProxy contract + columns: + - name: collateral_type + description: "Type of delegated collateral" + data_type: text + tests: + - not_null + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["Deposited"] + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: account_id + description: "ID of the account" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: sender + description: "Address of the depositor" + data_type: text + tests: + - not_null + - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone - - name: duration - data_type: numeric - - name: fct_core_account_delegation_base_sepolia + tests: + - not_null + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: token_amount + description: "Token amount deposited" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: core_withdrawn_base_sepolia + description: Withdrawn events from the CoreProxy contract columns: - - name: ts + - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone - - name: account_id + tests: + - not_null + - name: contract + description: "Address of the contract" data_type: text - - name: pool_id + tests: + - not_null + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: token_amount + description: "Token amount withdrawn" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: text - - name: amount_delegated + tests: + - not_null + - name: account_id + description: "ID of the account" data_type: numeric - - name: fct_core_apr_base_sepolia + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: sender + description: "Address of the withdrawer" + data_type: text + tests: + - not_null + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["Withdrawn"] + - name: core_liquidation_base_sepolia + description: Liquidation events from the CoreProxy contract columns: - - name: ts - data_type: timestamp with time zone - name: pool_id + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: block_number + description: "Block number" data_type: integer - - name: collateral_type + tests: + - not_null + - name: id + description: "ID of the event record" data_type: character varying - - name: collateral_value - data_type: numeric - - name: debt - data_type: numeric - - name: hourly_issuance - data_type: numeric - - name: hourly_pnl - data_type: numeric - - name: cumulative_pnl - data_type: numeric - - name: cumulative_issuance - data_type: numeric - - name: rewards_usd - data_type: numeric - - name: hourly_pnl_pct - data_type: numeric - - name: hourly_rewards_pct - data_type: numeric - - name: apr_24h - data_type: numeric - - name: apy_24h - data_type: numeric - - name: apr_7d - data_type: numeric - - name: apy_7d - data_type: numeric - - name: apr_28d - data_type: numeric - - name: apy_28d - data_type: numeric - - name: apr_24h_pnl - data_type: numeric - - name: apy_24h_pnl - data_type: numeric - - name: apr_7d_pnl - data_type: numeric - - name: apy_7d_pnl - data_type: numeric - - name: apr_28d_pnl - data_type: numeric - - name: apy_28d_pnl - data_type: numeric - - name: apr_24h_rewards - data_type: numeric - - name: apy_24h_rewards - data_type: numeric - - name: apr_7d_rewards - data_type: numeric - - name: apy_7d_rewards - data_type: numeric - - name: apr_28d_rewards - data_type: numeric - - name: apy_28d_rewards + tests: + - not_null + - unique + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["Liquidation"] + - name: collateral_type + description: "Type of delegated collateral" + data_type: text + tests: + - not_null + - name: sender + description: "Address of the liquidator" + data_type: text + tests: + - not_null + - name: liquidation_data + data_type: jsonb + - name: account_id + description: "ID of the account" data_type: numeric - - name: fct_core_market_updated_base_sepolia + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: liquidate_as_account_id + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: core_market_updated_base_sepolia + description: > + Combination of MarketCollateralDeposited, MarketCollateralWithdrawn, + MarketUsdDeposited, MarketUsdWithdrawn events from the CoreProxy contract columns: - name: id + description: "ID of the event record" data_type: character varying - - name: ts + tests: + - not_null + - unique + - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: net_issuance + description: "Net issuance" + data_type: numeric + tests: + - not_null + - name: deposited_collateral_value + description: "Deposited collateral value" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: sender + description: "Address of the event initiator" + data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null - name: credit_capacity + description: "Credit capacity" data_type: numeric - - name: net_issuance - data_type: numeric + tests: + - not_null - name: token_amount - data_type: numeric - - name: fct_core_pool_collateral_base_sepolia + description: "Token amount" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: core_market_registered_base_sepolia + description: MarketRegistered events from the CoreProxy contract columns: - - name: ts - data_type: timestamp with time zone - - name: collateral_type + - name: market + description: "Market name" data_type: text - - name: amount_deposited + tests: + - not_null + - name: market_id + description: "Market ID" data_type: numeric - - name: fct_core_pool_delegation_base_sepolia + tests: + - not_null + - unique + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["MarketRegistered"] + - name: sender + description: "Address of the event initiator" + data_type: text + tests: + - not_null + - name: core_pool_created_base_sepolia + description: "PoolCreated events from the CoreProxy contract" columns: - - name: ts + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: sender + description: "Address of the event initiator" + data_type: text + tests: + - not_null + - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["PoolCreated"] + - name: owner + description: "Address of the pool owner" + data_type: text + tests: + - not_null - name: pool_id + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: core_rewards_claimed_base_sepolia + description: RewardsClaimed events from the CoreProxy contract + columns: + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" + data_type: text + tests: + - not_null + - name: event_name + description: "Event name" data_type: text - - name: amount_delegated + tests: + - not_null + - accepted_values: + values: ["RewardsClaimed"] + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: amount + description: "Amount delegated" data_type: numeric - - name: fct_core_pools_base_sepolia - columns: + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: distributor + description: "Address of the distributor" + data_type: text + tests: + - not_null + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: pool_id + description: "ID of the pool" data_type: numeric - - name: created_ts - data_type: timestamp with time zone + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: block_number + description: "Block number" data_type: integer - - name: owner - data_type: text - - name: fct_pool_debt_base_sepolia + tests: + - not_null + - name: core_rewards_distributed_base_sepolia + description: RewardsDistributed events from the CoreProxy contract columns: - - name: ts + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["RewardsDistributed"] + - name: amount + description: "Amount claimed" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: start + description: "UNIX timestamp" + data_type: numeric + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: collateral_type + description: "Type of delegated collateral" + data_type: text + tests: + - not_null - name: block_number - data_type: bigint - - name: pool_id + description: "Block number" data_type: integer - - name: collateral_type - data_type: character varying - - name: debt + tests: + - not_null + - name: duration + description: "Duration in seconds" data_type: numeric - - name: fct_pool_issuance_hourly_base_sepolia + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: distributor + description: "Address of the distributor" + data_type: text + tests: + - not_null + - name: pool_id + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: core_usd_burned_base_sepolia + description: UsdBurned events from the CoreProxy contract columns: - - name: ts - data_type: timestamp with time zone + - name: amount + description: "Amount burned" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: pool_id + description: "ID of the pool" data_type: numeric - - name: collateral_type + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: event_name + description: "Event name" data_type: text - - name: hourly_issuance - data_type: numeric - - name: fct_pool_issuance_base_sepolia - columns: - - name: ts - data_type: timestamp with time zone + tests: + - not_null + - accepted_values: + values: ["UsdBurned"] + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique - name: block_number + description: "Block number" data_type: integer + tests: + - not_null + - name: account_id + description: "ID of the account" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: sender + description: "Address of the event initiator" + data_type: text + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text - - name: pool_id - data_type: numeric + tests: + - not_null + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null - name: collateral_type + description: "Type of delegated collateral" data_type: text + tests: + - not_null + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: core_usd_minted_base_sepolia + description: UsdMinted events from the CoreProxy contract + columns: + - name: pool_id + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: collateral_type + description: "Type of delegated collateral" + data_type: text + tests: + - not_null + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: sender + description: "Address of the event initiator" + data_type: text + tests: + - not_null - name: amount + description: "Amount minted" data_type: numeric - - name: fct_pool_pnl_hourly_base_sepolia + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["UsdMinted"] + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: core_vault_liquidation_base_sepolia + description: VaultLiquidation events from the CoreProxy contract columns: - - name: ts - data_type: timestamp with time zone - - name: pool_id - data_type: integer + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null - name: collateral_type - data_type: character varying - - name: collateral_value - data_type: numeric - - name: debt - data_type: numeric - - name: hourly_issuance - data_type: numeric - - name: hourly_pnl - data_type: numeric - - name: rewards_usd - data_type: numeric - - name: hourly_pnl_pct - data_type: numeric - - name: hourly_rewards_pct - data_type: numeric - - name: hourly_total_pct + description: "Type of delegated collateral" + data_type: text + tests: + - not_null + - name: pool_id + description: "ID of the pool" data_type: numeric - - name: fct_pool_rewards_hourly_base_sepolia + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: event_name + description: "Event name" + data_type: text + tests: + - not_null + - accepted_values: + values: ["VaultLiquidation"] + - name: id + description: "ID of the event record" + data_type: character varying + tests: + - not_null + - unique + - name: block_timestamp + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: liquidate_as_account_id + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: liquidation_data + data_type: jsonb + tests: + - not_null + - name: contract + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: sender + description: "Address of the event initiator" + data_type: text + tests: + - not_null + - name: core_vault_collateral_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null + - name: block_number + description: "Block number" + data_type: bigint + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying - - name: rewards_usd + tests: + - not_null + - name: amount + description: "Collateral amount" data_type: numeric - - name: fct_pool_rewards_token_hourly_base_sepolia + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: collateral_value + description: "Vault collateral value" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null + - name: core_vault_debt_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null + - name: block_number + description: "Block number" + data_type: bigint + tests: + - not_null - name: pool_id + description: "ID of the pool" data_type: integer + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type + description: "Type of delegated collateral" data_type: character varying - - name: distributor - data_type: text - - name: token_symbol - data_type: text - - name: price - data_type: numeric - - name: hourly_amount - data_type: numeric - - name: amount_distributed - data_type: numeric - - name: rewards_usd + tests: + - not_null + - name: debt + description: "Vault debt" data_type: numeric + tests: + - not_null + - name: contract_address + description: "Address of the contract" + data_type: text + tests: + - not_null diff --git a/transformers/synthetix/models/marts/base/sepolia/prices/schema.yml b/transformers/synthetix/models/marts/base/sepolia/prices/schema.yml index 11cb83cb..b4efc786 100644 --- a/transformers/synthetix/models/marts/base/sepolia/prices/schema.yml +++ b/transformers/synthetix/models/marts/base/sepolia/prices/schema.yml @@ -2,18 +2,45 @@ models: - name: fct_prices_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_address + description: "Market address" data_type: text + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_prices_hourly_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/marts/base/sepolia/spot/schema.yml b/transformers/synthetix/models/marts/base/sepolia/spot/schema.yml index 26ad5883..b6c561f8 100644 --- a/transformers/synthetix/models/marts/base/sepolia/spot/schema.yml +++ b/transformers/synthetix/models/marts/base/sepolia/spot/schema.yml @@ -2,52 +2,131 @@ models: - name: fct_synth_supply_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: supply + description: "Supply" data_type: numeric + tests: + - not_null - name: fct_spot_atomics_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: tx_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: price + description: "Price" data_type: numeric + tests: + - not_null - name: amount + description: "Amount" data_type: numeric + tests: + - not_null - name: referrer + description: "Address of the referrer" data_type: text + tests: + - not_null - name: fct_spot_markets_base_sepolia columns: - name: id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: created_ts data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: token_address + description: "Token address" data_type: text + tests: + - not_null - name: fct_spot_wrapper_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: tx_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: synth_market_id + description: "Synth market ID" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: amount_wrapped + description: "Amount wrapped" data_type: numeric + tests: + - not_null From f5e663209e79ca120ef02d9d62971238a32c53c0 Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Tue, 23 Jul 2024 17:04:02 +0300 Subject: [PATCH 12/14] Fix tests --- .../models/marts/base/mainnet/core/schema.yml | 34 +- .../models/marts/base/sepolia/core/schema.yml | 889 +++++------------- 2 files changed, 273 insertions(+), 650 deletions(-) diff --git a/transformers/synthetix/models/marts/base/mainnet/core/schema.yml b/transformers/synthetix/models/marts/base/mainnet/core/schema.yml index a1e823af..4903ad49 100644 --- a/transformers/synthetix/models/marts/base/mainnet/core/schema.yml +++ b/transformers/synthetix/models/marts/base/mainnet/core/schema.yml @@ -46,7 +46,7 @@ models: - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: fct_pool_rewards_arbitrum_mainnet + - name: fct_pool_rewards_base_mainnet columns: - name: ts description: "Block timestamp" @@ -88,7 +88,7 @@ models: data_type: timestamp with time zone - name: duration data_type: numeric - - name: fct_core_account_delegation_arbitrum_mainnet + - name: fct_core_account_delegation_base_mainnet columns: - name: ts description: "Block timestamp" @@ -121,7 +121,7 @@ models: - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: fct_core_apr_arbitrum_mainnet + - name: fct_core_apr_base_mainnet columns: - name: ts description: "Block timestamp" @@ -187,10 +187,6 @@ models: data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: -1 - max_value: 1 - inclusive: true - name: hourly_rewards_pct description: "Hourly Rewards (%)" data_type: numeric @@ -254,7 +250,7 @@ models: data_type: numeric - name: apy_28d_rewards data_type: numeric - - name: fct_core_market_updated_arbitrum_mainnet + - name: fct_core_market_updated_base_mainnet columns: - name: id description: "ID of the event record" @@ -307,7 +303,7 @@ models: data_type: numeric tests: - not_null - - name: fct_core_pool_collateral_arbitrum_mainnet + - name: fct_core_pool_collateral_base_mainnet columns: - name: ts description: "Block timestamp" @@ -324,7 +320,7 @@ models: data_type: numeric tests: - not_null - - name: fct_core_pool_delegation_arbitrum_mainnet + - name: fct_core_pool_delegation_base_mainnet columns: - name: ts description: "Block timestamp" @@ -346,7 +342,7 @@ models: - not_null - name: amount_delegated data_type: numeric - - name: fct_core_pools_arbitrum_mainnet + - name: fct_core_pools_base_mainnet columns: - name: id description: "ID of the pool" @@ -371,7 +367,7 @@ models: data_type: text tests: - not_null - - name: fct_pool_debt_arbitrum_mainnet + - name: fct_pool_debt_base_mainnet columns: - name: ts description: "Block timestamp" @@ -401,7 +397,7 @@ models: data_type: numeric tests: - not_null - - name: fct_pool_issuance_hourly_arbitrum_mainnet + - name: fct_pool_issuance_hourly_base_mainnet columns: - name: ts description: "Block timestamp" @@ -426,7 +422,7 @@ models: data_type: numeric tests: - not_null - - name: fct_pool_issuance_arbitrum_mainnet + - name: fct_pool_issuance_base_mainnet columns: - name: ts description: "Block timestamp" @@ -466,7 +462,7 @@ models: data_type: numeric tests: - not_null - - name: fct_pool_pnl_hourly_arbitrum_mainnet + - name: fct_pool_pnl_hourly_base_mainnet columns: - name: ts description: "Block timestamp" @@ -522,10 +518,6 @@ models: data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: -1 - max_value: 1 - inclusive: true - name: hourly_rewards_pct description: "Hourly Rewards (%)" data_type: numeric @@ -540,7 +532,7 @@ models: data_type: numeric tests: - not_null - - name: fct_pool_rewards_hourly_arbitrum_mainnet + - name: fct_pool_rewards_hourly_base_mainnet columns: - name: ts description: "Block timestamp" @@ -568,7 +560,7 @@ models: - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: fct_pool_rewards_token_hourly_arbitrum_mainnet + - name: fct_pool_rewards_token_hourly_base_mainnet columns: - name: ts description: "Block timestamp" diff --git a/transformers/synthetix/models/marts/base/sepolia/core/schema.yml b/transformers/synthetix/models/marts/base/sepolia/core/schema.yml index c3c65bfc..96448a3a 100644 --- a/transformers/synthetix/models/marts/base/sepolia/core/schema.yml +++ b/transformers/synthetix/models/marts/base/sepolia/core/schema.yml @@ -1,86 +1,12 @@ version: 2 models: - - name: core_account_created_base_sepolia - description: AccountCreated events from the CoreProxy contract - tests: - - dbt_utils.recency: - datepart: hour - field: block_timestamp - interval: 1 + - name: fct_pool_rewards_base_sepolia columns: - - name: owner - description: "Address of the account owner" - data_type: text - tests: - - not_null - - name: account_id - description: "ID of the account" - data_type: numeric - tests: - - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: id - description: "ID of the event record" - data_type: character varying - tests: - - not_null - - unique - - name: transaction_hash - description: "Transaction hash" - data_type: text - tests: - - not_null - - name: block_number - description: "Block number" - data_type: integer - tests: - - not_null - - name: block_timestamp + - name: ts description: "Block timestamp" data_type: timestamp with time zone tests: - not_null - - name: event_name - description: "Event name" - data_type: text - tests: - - not_null - - accepted_values: - values: ["AccountCreated"] - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - - name: core_delegation_updated_base_sepolia - description: DelegationUpdated events from the CoreProxy contract - columns: - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - - name: id - description: "ID of the event record" - data_type: character varying - tests: - - not_null - - unique - - name: account_id - description: "ID of the account" - data_type: numeric - tests: - - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: collateral_type - description: "Type of delegated collateral" - data_type: text - tests: - - not_null - name: pool_id description: "ID of the pool" data_type: numeric @@ -89,177 +15,45 @@ models: - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: sender - description: "Address of the delegator" - data_type: text - tests: - - not_null - - name: block_timestamp - description: "Block timestamp" - data_type: timestamp with time zone - tests: - - not_null - - name: block_number - description: "Block number" - data_type: integer - tests: - - not_null - - name: leverage - description: "Leverage" - data_type: numeric - tests: - - not_null - - dbt_utils.accepted_range: - min_value: 1000000000000000000 - max_value: 1000000000000000000 - inclusive: true - - name: transaction_hash - description: "Transaction hash" - data_type: text - tests: - - not_null - - name: amount - description: "Amount delegated" - data_type: numeric - tests: - - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: event_name - description: "Event name" - data_type: text - tests: - - not_null - - accepted_values: - values: ["DelegationUpdated"] - - name: core_deposited_base_sepolia - description: Deposited events from the CoreProxy contract - columns: - name: collateral_type description: "Type of delegated collateral" data_type: text tests: - not_null - - name: id - description: "ID of the event record" - data_type: character varying - tests: - - not_null - - unique - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - - name: event_name - description: "Event name" + - name: distributor + description: "Address of the distributor" data_type: text tests: - not_null - - accepted_values: - values: ["Deposited"] - - name: transaction_hash - description: "Transaction hash" + - name: token_symbol + description: "Token symbol" data_type: text tests: - not_null - - name: account_id - description: "ID of the account" + - name: amount + description: "Reward amount" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: sender - description: "Address of the depositor" - data_type: text - tests: - - not_null - - name: block_timestamp - description: "Block timestamp" + - name: ts_start data_type: timestamp with time zone - tests: - - not_null - - name: block_number - description: "Block number" - data_type: integer - tests: - - not_null - - name: token_amount - description: "Token amount deposited" + - name: duration data_type: numeric - tests: - - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: core_withdrawn_base_sepolia - description: Withdrawn events from the CoreProxy contract + - name: fct_core_account_delegation_base_sepolia columns: - - name: block_timestamp + - name: ts description: "Block timestamp" data_type: timestamp with time zone tests: - not_null - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - - name: block_number - description: "Block number" - data_type: integer - tests: - - not_null - - name: transaction_hash - description: "Transaction hash" - data_type: text - tests: - - not_null - - name: token_amount - description: "Token amount withdrawn" - data_type: numeric - tests: - - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: collateral_type - description: "Type of delegated collateral" - data_type: text - tests: - - not_null - name: account_id description: "ID of the account" data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: id - description: "ID of the event record" - data_type: character varying - tests: - - not_null - - unique - - name: sender - description: "Address of the withdrawer" - data_type: text - tests: - - not_null - - name: event_name - description: "Event name" - data_type: text - tests: - - not_null - - accepted_values: - values: ["Withdrawn"] - - name: core_liquidation_base_sepolia - description: Liquidation events from the CoreProxy contract - columns: - name: pool_id description: "ID of the pool" data_type: numeric @@ -268,326 +62,149 @@ models: - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: block_timestamp - description: "Block timestamp" - data_type: timestamp with time zone - tests: - - not_null - - name: block_number - description: "Block number" - data_type: integer - tests: - - not_null - - name: id - description: "ID of the event record" - data_type: character varying - tests: - - not_null - - unique - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - - name: event_name - description: "Event name" - data_type: text - tests: - - not_null - - accepted_values: - values: ["Liquidation"] - name: collateral_type description: "Type of delegated collateral" data_type: text tests: - not_null - - name: sender - description: "Address of the liquidator" - data_type: text - tests: - - not_null - - name: liquidation_data - data_type: jsonb - - name: account_id - description: "ID of the account" + - name: amount_delegated + description: "Amount of delegated collateral" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: transaction_hash - description: "Transaction hash" - data_type: text - tests: - - not_null - - name: liquidate_as_account_id - data_type: numeric - tests: - - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: core_market_updated_base_sepolia - description: > - Combination of MarketCollateralDeposited, MarketCollateralWithdrawn, - MarketUsdDeposited, MarketUsdWithdrawn events from the CoreProxy contract + - name: fct_core_apr_base_sepolia columns: - - name: id - description: "ID of the event record" - data_type: character varying - tests: - - not_null - - unique - - name: block_timestamp + - name: ts description: "Block timestamp" data_type: timestamp with time zone tests: - not_null - - name: block_number - description: "Block number" - data_type: integer - tests: - - not_null - - name: transaction_hash - description: "Transaction hash" - data_type: text - tests: - - not_null - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - - name: event_name - description: "Event name" - data_type: text - tests: - - not_null - - accepted_values: - values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] - - name: market_id - description: "ID of the market" - data_type: numeric - tests: - - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: net_issuance - description: "Net issuance" - data_type: numeric - tests: - - not_null - - name: deposited_collateral_value - description: "Deposited collateral value" + - name: pool_id + description: "ID of the pool" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: sender - description: "Address of the event initiator" - data_type: text - tests: - - not_null - name: collateral_type description: "Type of delegated collateral" data_type: text tests: - not_null - - name: credit_capacity - description: "Credit capacity" - data_type: numeric - tests: - - not_null - - name: token_amount - description: "Token amount" + - name: collateral_value + description: "Collateral value (USD)" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: core_market_registered_base_sepolia - description: MarketRegistered events from the CoreProxy contract - columns: - - name: market - description: "Market name" - data_type: text - tests: - - not_null - - name: market_id - description: "Market ID" + - name: debt + description: "Debt value (USD)" data_type: numeric tests: - not_null - - unique - - name: id - description: "ID of the event record" - data_type: character varying - tests: - - not_null - - unique - - name: block_timestamp - description: "Block timestamp" - data_type: timestamp with time zone - tests: - - not_null - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - - name: transaction_hash - description: "Transaction hash" - data_type: text - tests: - - not_null - - name: block_number - description: "Block number" - data_type: integer - tests: - - not_null - - name: event_name - description: "Event name" - data_type: text - tests: - - not_null - - accepted_values: - values: ["MarketRegistered"] - - name: sender - description: "Address of the event initiator" - data_type: text - tests: - - not_null - - name: core_pool_created_base_sepolia - description: "PoolCreated events from the CoreProxy contract" - columns: - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - - name: sender - description: "Address of the event initiator" - data_type: text - tests: - - not_null - - name: block_timestamp - description: "Block timestamp" - data_type: timestamp with time zone - tests: - - not_null - - name: id - description: "ID of the event record" - data_type: character varying - tests: - - not_null - - unique - - name: block_number - description: "Block number" - data_type: integer + - name: hourly_issuance + description: "Hourly issuance" + data_type: numeric tests: - not_null - - name: transaction_hash - description: "Transaction hash" - data_type: text + - name: hourly_pnl + description: "Hourly PnL" + data_type: numeric tests: - not_null - - name: event_name - description: "Event name" - data_type: text + - name: cumulative_pnl + description: "Cumulative PnL" + data_type: numeric tests: - not_null - - accepted_values: - values: ["PoolCreated"] - - name: owner - description: "Address of the pool owner" - data_type: text + - name: cumulative_issuance + description: "Cumulative Issuance" + data_type: numeric tests: - not_null - - name: pool_id - description: "ID of the pool" + - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: core_rewards_claimed_base_sepolia - description: RewardsClaimed events from the CoreProxy contract - columns: - - name: transaction_hash - description: "Transaction hash" - data_type: text + - name: hourly_pnl_pct + description: "Hourly PnL (%)" + data_type: numeric tests: - not_null - - name: account_id - description: "ID of the account" + - name: hourly_rewards_pct + description: "Hourly Rewards (%)" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 + max_value: 1 inclusive: true - - name: collateral_type - description: "Type of delegated collateral" - data_type: text - tests: - - not_null - - name: event_name - description: "Event name" - data_type: text - tests: - - not_null - - accepted_values: - values: ["RewardsClaimed"] - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - - name: amount - description: "Amount delegated" + - name: apr_24h + description: "APR (24h)" data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: distributor - description: "Address of the distributor" - data_type: text + - name: apy_24h + description: "APY (24h)" + data_type: numeric tests: - not_null - - name: block_timestamp - description: "Block timestamp" - data_type: timestamp with time zone + - name: apr_7d + description: "APR (7d)" + data_type: numeric tests: - not_null - - name: id - description: "ID of the event record" - data_type: character varying + - name: apy_7d + description: "APY (7d)" + data_type: numeric tests: - not_null - - unique - - name: pool_id - description: "ID of the pool" + - name: apr_28d + description: "APR (28d)" data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: block_number - description: "Block number" - data_type: integer + - name: apy_28d + description: "APY (28d)" + data_type: numeric tests: - not_null - - name: core_rewards_distributed_base_sepolia - description: RewardsDistributed events from the CoreProxy contract + - name: apr_24h_pnl + data_type: numeric + - name: apy_24h_pnl + data_type: numeric + - name: apr_7d_pnl + data_type: numeric + - name: apy_7d_pnl + data_type: numeric + - name: apr_28d_pnl + data_type: numeric + - name: apy_28d_pnl + data_type: numeric + - name: apr_24h_rewards + data_type: numeric + - name: apy_24h_rewards + data_type: numeric + - name: apr_7d_rewards + data_type: numeric + - name: apy_7d_rewards + data_type: numeric + - name: apr_28d_rewards + data_type: numeric + - name: apy_28d_rewards + data_type: numeric + - name: fct_core_market_updated_base_sepolia columns: - name: id description: "ID of the event record" @@ -595,37 +212,56 @@ models: tests: - not_null - unique + - name: ts + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: transaction_hash + description: "Transaction hash" + data_type: text + tests: + - not_null - name: event_name description: "Event name" data_type: text tests: - not_null - accepted_values: - values: ["RewardsDistributed"] - - name: amount - description: "Amount claimed" + values: ["MarketCollateralWithdrawn", "MarketCollateralDeposited", "MarketUsdWithdrawn", "MarketUsdDeposited"] + - name: market_id + description: "ID of the market" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: start - description: "UNIX timestamp" - data_type: numeric - - name: contract - description: "Address of the contract" + - name: collateral_type + description: "Type of delegated collateral" data_type: text tests: - not_null - - name: block_timestamp - description: "Block timestamp" - data_type: timestamp with time zone + - name: credit_capacity + description: "Credit capacity" + data_type: numeric tests: - not_null - - name: transaction_hash - description: "Transaction hash" - data_type: text + - name: net_issuance + description: "Net issuance" + data_type: numeric + tests: + - not_null + - name: token_amount + description: "Token amount" + data_type: numeric + tests: + - not_null + - name: fct_core_pool_collateral_base_sepolia + columns: + - name: ts + description: "Block timestamp" + data_type: timestamp with time zone tests: - not_null - name: collateral_type @@ -633,22 +269,16 @@ models: data_type: text tests: - not_null - - name: block_number - description: "Block number" - data_type: integer - tests: - - not_null - - name: duration - description: "Duration in seconds" + - name: amount_deposited + description: "Amount deposited" data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: distributor - description: "Address of the distributor" - data_type: text + - name: fct_core_pool_delegation_base_sepolia + columns: + - name: ts + description: "Block timestamp" + data_type: timestamp with time zone tests: - not_null - name: pool_id @@ -659,18 +289,16 @@ models: - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: core_usd_burned_base_sepolia - description: UsdBurned events from the CoreProxy contract - columns: - - name: amount - description: "Amount burned" - data_type: numeric + - name: collateral_type + description: "Type of delegated collateral" + data_type: text tests: - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: pool_id + - name: amount_delegated + data_type: numeric + - name: fct_core_pools_base_sepolia + columns: + - name: id description: "ID of the pool" data_type: numeric tests: @@ -678,60 +306,58 @@ models: - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: event_name - description: "Event name" + - name: created_ts + description: "Pool creation timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: block_number + description: "Block number" + data_type: integer + tests: + - not_null + - name: owner + description: "Address of the pool owner" data_type: text tests: - not_null - - accepted_values: - values: ["UsdBurned"] - - name: id - description: "ID of the event record" - data_type: character varying + - name: fct_pool_debt_base_sepolia + columns: + - name: ts + description: "Block timestamp" + data_type: timestamp with time zone tests: - not_null - - unique - name: block_number description: "Block number" data_type: integer tests: - not_null - - name: account_id - description: "ID of the account" + - name: pool_id + description: "ID of the pool" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: sender - description: "Address of the event initiator" - data_type: text - tests: - - not_null - - name: transaction_hash - description: "Transaction hash" - data_type: text - tests: - - not_null - - name: contract - description: "Address of the contract" - data_type: text - tests: - - not_null - name: collateral_type description: "Type of delegated collateral" data_type: text tests: - not_null - - name: block_timestamp + - name: debt + description: "Debt value (USD)" + data_type: numeric + tests: + - not_null + - name: fct_pool_issuance_hourly_base_sepolia + columns: + - name: ts description: "Block timestamp" data_type: timestamp with time zone tests: - not_null - - name: core_usd_minted_base_sepolia - description: UsdMinted events from the CoreProxy contract - columns: - name: pool_id description: "ID of the pool" data_type: numeric @@ -740,22 +366,21 @@ models: - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: block_timestamp - description: "Block timestamp" - data_type: timestamp with time zone + - name: collateral_type + description: "Type of delegated collateral" + data_type: text tests: - not_null - - name: account_id - description: "ID of the account" + - name: hourly_issuance + description: "Hourly issuance" data_type: numeric tests: - not_null - - dbt_utils.accepted_range: - min_value: 0 - inclusive: true - - name: collateral_type - description: "Type of delegated collateral" - data_type: text + - name: fct_pool_issuance_base_sepolia + columns: + - name: ts + description: "Block timestamp" + data_type: timestamp with time zone tests: - not_null - name: block_number @@ -763,122 +388,114 @@ models: data_type: integer tests: - not_null - - name: id - description: "ID of the event record" - data_type: character varying - tests: - - not_null - - unique - - name: sender - description: "Address of the event initiator" + - name: transaction_hash + description: "Transaction hash" data_type: text tests: - not_null - - name: amount - description: "Amount minted" + - name: pool_id + description: "ID of the pool" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: event_name - description: "Event name" + - name: collateral_type + description: "Type of delegated collateral" data_type: text tests: - not_null - - accepted_values: - values: ["UsdMinted"] - - name: transaction_hash - description: "Transaction hash" - data_type: text + - name: account_id + description: "ID of the account" + data_type: numeric tests: - not_null - - name: contract - description: "Address of the contract" - data_type: text + - name: amount + description: "Amount issued" + data_type: numeric tests: - not_null - - name: core_vault_liquidation_base_sepolia - description: VaultLiquidation events from the CoreProxy contract + - name: fct_pool_pnl_hourly_base_sepolia columns: - - name: transaction_hash - description: "Transaction hash" - data_type: text + - name: ts + description: "Block timestamp" + data_type: timestamp with time zone tests: - not_null + - name: pool_id + description: "ID of the pool" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collateral_type description: "Type of delegated collateral" data_type: text tests: - not_null - - name: pool_id - description: "ID of the pool" + - name: collateral_value + description: "Collateral value (USD)" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: event_name - description: "Event name" - data_type: text + - name: debt + description: "Debt value (USD)" + data_type: numeric tests: - not_null - - accepted_values: - values: ["VaultLiquidation"] - - name: id - description: "ID of the event record" - data_type: character varying + - name: hourly_issuance + description: "Hourly issuance" + data_type: numeric tests: - not_null - - unique - - name: block_timestamp - description: "Block timestamp" - data_type: timestamp with time zone + - name: hourly_pnl + description: "Hourly PnL" + data_type: numeric tests: - not_null - - name: liquidate_as_account_id + - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: liquidation_data - data_type: jsonb - tests: - - not_null - - name: contract - description: "Address of the contract" - data_type: text + - name: hourly_pnl_pct + description: "Hourly PnL (%)" + data_type: numeric tests: - not_null - - name: block_number - description: "Block number" - data_type: integer + - name: hourly_rewards_pct + description: "Hourly Rewards (%)" + data_type: numeric tests: - not_null - - name: sender - description: "Address of the event initiator" - data_type: text + - dbt_utils.accepted_range: + min_value: 0 + max_value: 1 + inclusive: true + - name: hourly_total_pct + description: "Hourly Total (%)" + data_type: numeric tests: - not_null - - name: core_vault_collateral_base_sepolia + - name: fct_pool_rewards_hourly_base_sepolia columns: - name: ts description: "Block timestamp" data_type: timestamp with time zone tests: - not_null - - name: block_number - description: "Block number" - data_type: bigint - tests: - - not_null - name: pool_id description: "ID of the pool" - data_type: integer + data_type: numeric tests: - not_null - dbt_utils.accepted_range: @@ -886,62 +503,76 @@ models: inclusive: true - name: collateral_type description: "Type of delegated collateral" - data_type: character varying + data_type: text tests: - not_null - - name: amount - description: "Collateral amount" + - name: rewards_usd + description: "Rewards value (USD)" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: collateral_value - description: "Vault collateral value" + - name: fct_pool_rewards_token_hourly_base_sepolia + columns: + - name: ts + description: "Block timestamp" + data_type: timestamp with time zone + tests: + - not_null + - name: pool_id + description: "ID of the pool" data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: contract_address - description: "Address of the contract" + - name: collateral_type + description: "Type of delegated collateral" data_type: text tests: - not_null - - name: core_vault_debt_base_sepolia - columns: - - name: ts - description: "Block timestamp" - data_type: timestamp with time zone + - name: distributor + description: "Address of the distributor" + data_type: text tests: - not_null - - name: block_number - description: "Block number" - data_type: bigint + - name: token_symbol + description: "Token symbol" + data_type: text tests: - not_null - - name: pool_id - description: "ID of the pool" - data_type: integer + - name: price + description: "Price" + data_type: numeric tests: - not_null - dbt_utils.accepted_range: min_value: 0 inclusive: true - - name: collateral_type - description: "Type of delegated collateral" - data_type: character varying + - name: hourly_amount + description: "Hourly rewards amount" + data_type: numeric tests: - not_null - - name: debt - description: "Vault debt" + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: amount_distributed + description: "Distributed rewards amount" data_type: numeric tests: - not_null - - name: contract_address - description: "Address of the contract" - data_type: text + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: rewards_usd + description: "Rewards value (USD)" + data_type: numeric tests: - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true From 6188b1e6fe536d887253680a1e2937880d169102 Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Tue, 23 Jul 2024 18:50:49 +0300 Subject: [PATCH 13/14] Improve test coverage base marts --- .../marts/base/mainnet/buyback/schema.yml | 82 ++++ .../models/marts/base/mainnet/perp/schema.yml | 368 +++++++++++++++++- .../marts/base/sepolia/buyback/schema.yml | 82 ++++ .../models/marts/base/sepolia/perp/schema.yml | 368 +++++++++++++++++- 4 files changed, 894 insertions(+), 6 deletions(-) diff --git a/transformers/synthetix/models/marts/base/mainnet/buyback/schema.yml b/transformers/synthetix/models/marts/base/mainnet/buyback/schema.yml index c9cf9584..d92a4482 100644 --- a/transformers/synthetix/models/marts/base/mainnet/buyback/schema.yml +++ b/transformers/synthetix/models/marts/base/mainnet/buyback/schema.yml @@ -2,38 +2,120 @@ models: - name: fct_buyback_daily_base_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: snx_amount + description: "Amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: usd_amount + description: "Amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: cumulative_snx_amount + description: "Cumulative amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: cumulative_usd_amount + description: "Cumulative amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_buyback_hourly_base_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: snx_amount + description: "Amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: usd_amount + description: "Amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: cumulative_snx_amount + description: "Cumulative amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: cumulative_usd_amount + description: "Cumulative amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_buyback_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: buyer + description: "Address of buyer" data_type: text + tests: + - not_null - name: snx + description: "Amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: usd + description: "Amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: snx_price + description: "SNX Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/marts/base/mainnet/perp/schema.yml b/transformers/synthetix/models/marts/base/mainnet/perp/schema.yml index 575a20b6..e4863cd3 100644 --- a/transformers/synthetix/models/marts/base/mainnet/perp/schema.yml +++ b/transformers/synthetix/models/marts/base/mainnet/perp/schema.yml @@ -2,59 +2,154 @@ models: - name: fct_perp_interest_charged_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["InterestCharged"] - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: interest + description: "Interest amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_perp_collateral_modified_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["CollateralModified"] - name: synth_market_id + description: "Synth market ID" data_type: numeric - - name: sender + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: sender data_type: text + tests: + - not_null - name: amount_delta data_type: numeric - name: fct_perp_previous_order_expired_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["PreviousOrderExpired"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: commitment_time data_type: numeric - name: tracking_code @@ -66,77 +161,208 @@ models: - name: fct_perp_trades_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: text + tests: + - not_null - name: fill_price + description: "Fill price (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: pnl + description: "PnL (ETH)" data_type: numeric + tests: + - not_null - name: accrued_funding + description: "Accrued funding (ETH)" data_type: numeric + tests: + - not_null - name: trade_size + description: "Trade size (ETH)" data_type: numeric + tests: + - not_null - name: position_size + description: "Position size" data_type: numeric + tests: + - not_null - name: total_fees + description: "Total fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: referral_fees + description: "Referral fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collected_fees + description: "Collected fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: settlement_reward + description: "Settlement reward (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: tracking_code + description: "Account tracking code" data_type: text + tests: + - not_null - name: settler + description: "Address of the settler" data_type: text + tests: + - not_null - name: notional_trade_size + description: "Notional trade size (ETH)" data_type: numeric + tests: + - not_null - name: notional_position_size + description: "Notional position size (ETH)" data_type: numeric + tests: + - not_null - name: lp_fees + description: "LP fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: exchange_fees + description: "Exchange fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_perp_pnl_base_mainnet columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_id - data_type: integer + description: "ID of the market" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_pnl data_type: numeric - name: fct_perp_orders_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: text + tests: + - not_null - name: order_type data_type: integer - name: size @@ -154,92 +380,228 @@ models: - name: fct_perp_markets_base_mainnet columns: - name: id - data_type: numeric + description: "Market ID" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: created_ts + description: "Market creation timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: market_name + description: "Market name" data_type: text + tests: + - not_null - name: fct_perp_market_history_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price (ETH)" data_type: numeric + tests: + - not_null - name: skew + description: "Skew (ETH)" data_type: numeric + tests: + - not_null - name: size + description: "Size (ETH)" data_type: numeric + tests: + - not_null - name: size_delta + description: "Size delta (ETH)" data_type: numeric + tests: + - not_null - name: funding_rate + description: "Funding rate (ETH)" data_type: numeric + tests: + - not_null - name: funding_velocity + description: "Funding velocity (ETH)" data_type: numeric + tests: + - not_null - name: interest_rate + description: "Interest rate (ETH)" data_type: numeric + tests: + - not_null - name: funding_rate_apr + description: "Funding rate APR (ETH)" data_type: numeric + tests: + - not_null - name: long_rate_apr + description: "Long rate APR (ETH)" data_type: numeric + tests: + - not_null - name: short_rate_apr + description: "Short rate APR (ETH)" data_type: numeric + tests: + - not_null - name: size_usd + description: "Size (USD)" data_type: numeric + tests: + - not_null - name: long_oi + description: "Long open interest (ETH)" data_type: numeric - name: short_oi + description: "Short open interest (ETH)" data_type: numeric - name: long_oi_pct + description: "Long open interest (%)" data_type: numeric - name: short_oi_pct + description: "Short open interest (%)" data_type: numeric - name: fct_perp_liq_position_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: amount_liquidated + description: "Amount liquidated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: position_size + description: "Liquidated position size" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_perp_liq_account_base_mainnet columns: - name: account_id + description: "ID of the account" data_type: text + tests: + - not_null - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: total_reward + description: "Total reward" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_perp_accounts_base_mainnet columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: created_ts + description: "Account creation timestamp" data_type: timestamp with time zone + tests: + - not_null - name: owner + description: "Address of the account owner" data_type: text + tests: + - not_null diff --git a/transformers/synthetix/models/marts/base/sepolia/buyback/schema.yml b/transformers/synthetix/models/marts/base/sepolia/buyback/schema.yml index cfcff8d7..08f547ff 100644 --- a/transformers/synthetix/models/marts/base/sepolia/buyback/schema.yml +++ b/transformers/synthetix/models/marts/base/sepolia/buyback/schema.yml @@ -2,38 +2,120 @@ models: - name: fct_buyback_daily_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: snx_amount + description: "Amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: usd_amount + description: "Amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: cumulative_snx_amount + description: "Cumulative amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: cumulative_usd_amount + description: "Cumulative amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_buyback_hourly_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: snx_amount + description: "Amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: usd_amount + description: "Amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: cumulative_snx_amount + description: "Cumulative amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: cumulative_usd_amount + description: "Cumulative amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_buyback_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: buyer + description: "Address of buyer" data_type: text + tests: + - not_null - name: snx + description: "Amount in SNX" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: usd + description: "Amount in USD" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: snx_price + description: "SNX Price" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true diff --git a/transformers/synthetix/models/marts/base/sepolia/perp/schema.yml b/transformers/synthetix/models/marts/base/sepolia/perp/schema.yml index 9f70f4c5..56a262d8 100644 --- a/transformers/synthetix/models/marts/base/sepolia/perp/schema.yml +++ b/transformers/synthetix/models/marts/base/sepolia/perp/schema.yml @@ -2,59 +2,154 @@ models: - name: fct_perp_interest_charged_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["InterestCharged"] - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: interest + description: "Interest amount" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_perp_collateral_modified_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["CollateralModified"] - name: synth_market_id + description: "Synth market ID" data_type: numeric - - name: sender + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true + - name: sender data_type: text + tests: + - not_null - name: amount_delta data_type: numeric - name: fct_perp_previous_order_expired_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: block_timestamp + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: event_name + description: "Event name" data_type: text + tests: + - not_null + - accepted_values: + values: ["PreviousOrderExpired"] - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: account_id + description: "ID of the account" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: commitment_time data_type: numeric - name: tracking_code @@ -66,77 +161,208 @@ models: - name: fct_perp_trades_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: text + tests: + - not_null - name: fill_price + description: "Fill price (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: pnl + description: "PnL (ETH)" data_type: numeric + tests: + - not_null - name: accrued_funding + description: "Accrued funding (ETH)" data_type: numeric + tests: + - not_null - name: trade_size + description: "Trade size (ETH)" data_type: numeric + tests: + - not_null - name: position_size + description: "Position size" data_type: numeric + tests: + - not_null - name: total_fees + description: "Total fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: referral_fees + description: "Referral fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: collected_fees + description: "Collected fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: settlement_reward + description: "Settlement reward (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: tracking_code + description: "Account tracking code" data_type: text + tests: + - not_null - name: settler + description: "Address of the settler" data_type: text + tests: + - not_null - name: notional_trade_size + description: "Notional trade size (ETH)" data_type: numeric + tests: + - not_null - name: notional_position_size + description: "Notional position size (ETH)" data_type: numeric + tests: + - not_null - name: lp_fees + description: "LP fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: exchange_fees + description: "Exchange fees (ETH)" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_perp_pnl_base_sepolia columns: - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: market_id - data_type: integer + description: "ID of the market" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_pnl data_type: numeric - name: fct_perp_orders_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: contract + description: "Address of the contract" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: text + tests: + - not_null - name: order_type data_type: integer - name: size @@ -154,92 +380,228 @@ models: - name: fct_perp_markets_base_sepolia columns: - name: id - data_type: numeric + description: "Market ID" + data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: created_ts + description: "Market creation timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: market_name + description: "Market name" data_type: text + tests: + - not_null - name: fct_perp_market_history_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: price + description: "Price (ETH)" data_type: numeric + tests: + - not_null - name: skew + description: "Skew (ETH)" data_type: numeric + tests: + - not_null - name: size + description: "Size (ETH)" data_type: numeric + tests: + - not_null - name: size_delta + description: "Size delta (ETH)" data_type: numeric + tests: + - not_null - name: funding_rate + description: "Funding rate (ETH)" data_type: numeric + tests: + - not_null - name: funding_velocity + description: "Funding velocity (ETH)" data_type: numeric + tests: + - not_null - name: interest_rate + description: "Interest rate (ETH)" data_type: numeric + tests: + - not_null - name: funding_rate_apr + description: "Funding rate APR (ETH)" data_type: numeric + tests: + - not_null - name: long_rate_apr + description: "Long rate APR (ETH)" data_type: numeric + tests: + - not_null - name: short_rate_apr + description: "Short rate APR (ETH)" data_type: numeric + tests: + - not_null - name: size_usd + description: "Size (USD)" data_type: numeric + tests: + - not_null - name: long_oi + description: "Long open interest (ETH)" data_type: numeric - name: short_oi + description: "Short open interest (ETH)" data_type: numeric - name: long_oi_pct + description: "Long open interest (%)" data_type: numeric - name: short_oi_pct + description: "Short open interest (%)" data_type: numeric - name: fct_perp_liq_position_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: block_number + description: "Block number" data_type: integer + tests: + - not_null - name: transaction_hash + description: "Transaction hash" data_type: text + tests: + - not_null - name: account_id + description: "ID of the account" data_type: text + tests: + - not_null - name: market_id + description: "ID of the market" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: market_symbol + description: "Market symbol" data_type: text + tests: + - not_null - name: amount_liquidated + description: "Amount liquidated" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: position_size + description: "Liquidated position size" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_perp_liq_account_base_sepolia columns: - name: account_id + description: "ID of the account" data_type: text + tests: + - not_null - name: ts + description: "Block timestamp" data_type: timestamp with time zone + tests: + - not_null - name: total_reward + description: "Total reward" data_type: numeric + tests: + - not_null + - dbt_utils.accepted_range: + min_value: 0 + inclusive: true - name: fct_perp_accounts_base_sepolia columns: - name: id + description: "ID of the event record" data_type: character varying + tests: + - not_null + - unique - name: created_ts + description: "Account creation timestamp" data_type: timestamp with time zone + tests: + - not_null - name: owner + description: "Address of the account owner" data_type: text + tests: + - not_null From 2d643f2a8f4bcac42113dd2322311da0ae0695c3 Mon Sep 17 00:00:00 2001 From: marcus-snx Date: Mon, 29 Jul 2024 13:36:40 +0300 Subject: [PATCH 14/14] Remove wrong tests --- .../synthetix/models/raw/arbitrum/mainnet/core/schema.yml | 5 ----- .../synthetix/models/raw/arbitrum/mainnet/schema.yml | 2 -- .../synthetix/models/raw/arbitrum/sepolia/core/schema.yml | 5 ----- .../synthetix/models/raw/arbitrum/sepolia/schema.yml | 2 -- .../synthetix/models/raw/base/mainnet/core/schema.yml | 5 ----- transformers/synthetix/models/raw/base/mainnet/schema.yml | 2 -- .../synthetix/models/raw/base/sepolia/core/schema.yml | 5 ----- transformers/synthetix/models/raw/base/sepolia/schema.yml | 2 -- 8 files changed, 28 deletions(-) diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml index 8ec3c7cc..145e7a9d 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/core/schema.yml @@ -2,11 +2,6 @@ version: 2 models: - name: core_account_created_arbitrum_mainnet description: AccountCreated events from the CoreProxy contract - tests: - - dbt_utils.recency: - datepart: hour - field: block_timestamp - interval: 1 columns: - name: owner description: "Address of the account owner" diff --git a/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml b/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml index 1db0697b..1c1a0295 100644 --- a/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/mainnet/schema.yml @@ -17,5 +17,3 @@ models: tests: - not_null - unique - - dbt_utils.sequential_values: - interval: 1 diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/core/schema.yml b/transformers/synthetix/models/raw/arbitrum/sepolia/core/schema.yml index ab1cedac..60f7801c 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/core/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/core/schema.yml @@ -2,11 +2,6 @@ version: 2 models: - name: core_account_created_arbitrum_sepolia description: AccountCreated events from the CoreProxy contract - tests: - - dbt_utils.recency: - datepart: hour - field: block_timestamp - interval: 1 columns: - name: owner description: "Address of the account owner" diff --git a/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml b/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml index 9cd29888..5f45e213 100644 --- a/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml +++ b/transformers/synthetix/models/raw/arbitrum/sepolia/schema.yml @@ -17,5 +17,3 @@ models: tests: - not_null - unique - - dbt_utils.sequential_values: - interval: 1 diff --git a/transformers/synthetix/models/raw/base/mainnet/core/schema.yml b/transformers/synthetix/models/raw/base/mainnet/core/schema.yml index ff6f954e..cffe9f83 100644 --- a/transformers/synthetix/models/raw/base/mainnet/core/schema.yml +++ b/transformers/synthetix/models/raw/base/mainnet/core/schema.yml @@ -2,11 +2,6 @@ version: 2 models: - name: core_account_created_base_mainnet description: AccountCreated events from the CoreProxy contract - tests: - - dbt_utils.recency: - datepart: hour - field: block_timestamp - interval: 1 columns: - name: owner description: "Address of the account owner" diff --git a/transformers/synthetix/models/raw/base/mainnet/schema.yml b/transformers/synthetix/models/raw/base/mainnet/schema.yml index ba7cb6d0..a56c30ab 100644 --- a/transformers/synthetix/models/raw/base/mainnet/schema.yml +++ b/transformers/synthetix/models/raw/base/mainnet/schema.yml @@ -17,5 +17,3 @@ models: tests: - not_null - unique - - dbt_utils.sequential_values: - interval: 1 diff --git a/transformers/synthetix/models/raw/base/sepolia/core/schema.yml b/transformers/synthetix/models/raw/base/sepolia/core/schema.yml index c3c65bfc..ae561d14 100644 --- a/transformers/synthetix/models/raw/base/sepolia/core/schema.yml +++ b/transformers/synthetix/models/raw/base/sepolia/core/schema.yml @@ -2,11 +2,6 @@ version: 2 models: - name: core_account_created_base_sepolia description: AccountCreated events from the CoreProxy contract - tests: - - dbt_utils.recency: - datepart: hour - field: block_timestamp - interval: 1 columns: - name: owner description: "Address of the account owner" diff --git a/transformers/synthetix/models/raw/base/sepolia/schema.yml b/transformers/synthetix/models/raw/base/sepolia/schema.yml index f03eba49..3e032ac7 100644 --- a/transformers/synthetix/models/raw/base/sepolia/schema.yml +++ b/transformers/synthetix/models/raw/base/sepolia/schema.yml @@ -17,5 +17,3 @@ models: tests: - not_null - unique - - dbt_utils.sequential_values: - interval: 1