add spot (#86)

This commit is contained in:
Matt Romano 2025-05-09 11:06:26 -07:00 committed by GitHub
parent 6ed6bdf91e
commit 2d02b98de4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 123 additions and 2 deletions

View File

@ -0,0 +1,50 @@
{{ config(
materialized = 'view',
persist_docs ={ "relation": true,
"columns": true },
meta={
'database_tags':{
'table': {
'PROTOCOL': 'VERTEX',
'PURPOSE': 'CLOB, DEX, SPOT'
}
}
}
) }}
SELECT
block_number,
block_timestamp,
tx_hash,
contract_address,
event_name,
event_index,
origin_function_signature,
origin_from_address,
origin_to_address,
symbol,
digest,
trader,
subaccount,
trade_type,
order_type,
market_reduce_flag,
expiration,
nonce,
is_taker,
price_amount_unadj,
price_amount,
amount_unadj,
amount,
amount_usd,
fee_amount_unadj,
fee_amount,
base_delta_amount_unadj,
base_delta_amount,
quote_delta_amount_unadj,
quote_delta_amount,
vertex_spot_id AS ez_spot_trades_id,
inserted_timestamp,
modified_timestamp
FROM
{{ ref('silver__vertex_spot') }}

View File

@ -0,0 +1,72 @@
version: 2
models:
- name: vertex__ez_spot_trades
description: '{{ doc("vertex_ez_spot_trades") }}'
columns:
- name: BLOCK_NUMBER
description: '{{ doc("sei_block_number") }}'
- name: BLOCK_TIMESTAMP
description: '{{ doc("sei_block_timestamp") }}'
- name: TX_HASH
description: '{{ doc("sei_logs_tx_hash") }}'
- name: CONTRACT_ADDRESS
description: '{{ doc("sei_logs_contract_address") }}'
- name: EVENT_NAME
description: '{{ doc("sei_event_name") }}'
- name: EVENT_INDEX
description: '{{ doc("sei_event_index") }}'
- name: ORIGIN_FUNCTION_SIGNATURE
description: '{{ doc("sei_origin_sig") }}'
- name: ORIGIN_FROM_ADDRESS
description: '{{ doc("sei_origin_from") }}'
- name: ORIGIN_TO_ADDRESS
description: '{{ doc("sei_origin_to") }}'
- name: SYMBOL
description: '{{ doc("vertex_symbol") }}'
- name: DIGEST
description: '{{ doc("vertex_digest") }}'
- name: TRADER
description: '{{ doc("vertex_trader") }}'
- name: SUBACCOUNT
description: '{{ doc("vertex_subaccount") }}'
- name: TRADE_TYPE
description: '{{ doc("vertex_trade_type") }}'
- name: ORDER_TYPE
description: '{{ doc("vertex_order_type") }}'
- name: MARKET_REDUCE_FLAG
description: '{{ doc("vertex_market_reduce_flag") }}'
- name: EXPIRATION
description: '{{ doc("vertex_expiration") }}'
- name: NONCE
description: '{{ doc("vertex_nonce") }}'
- name: IS_TAKER
description: '{{ doc("vertex_is_taker") }}'
- name: PRICE_AMOUNT_UNADJ
description: '{{ doc("vertex_price_amount_unadj") }}'
- name: PRICE_AMOUNT
description: '{{ doc("vertex_price_amount") }}'
- name: AMOUNT_UNADJ
description: '{{ doc("vertex_amount_unadj") }}'
- name: AMOUNT
description: '{{ doc("vertex_amount") }}'
- name: AMOUNT_USD
description: '{{ doc("vertex_amount_usd") }}'
- name: FEE_AMOUNT_UNADJ
description: '{{ doc("vertex_fee_amount_unadj") }}'
- name: FEE_AMOUNT
description: '{{ doc("vertex_fee_amount") }}'
- name: BASE_DELTA_AMOUNT_UNADJ
description: '{{ doc("vertex_base_delta_amount_unadj") }}'
- name: BASE_DELTA_AMOUNT
description: '{{ doc("vertex_base_delta_amount") }}'
- name: QUOTE_DELTA_AMOUNT_UNADJ
description: '{{ doc("vertex_quote_delta_amount_unadj") }}'
- name: QUOTE_DELTA_AMOUNT
description: '{{ doc("vertex_quote_delta_amount") }}'
- name: EZ_SPOT_TRADES_ID
description: '{{ doc("pk") }}'
- name: INSERTED_TIMESTAMP
description: '{{ doc("inserted_timestamp") }}'
- name: MODIFIED_TIMESTAMP
description: '{{ doc("modified_timestamp") }}'

View File

@ -3,8 +3,7 @@
incremental_strategy = 'delete+insert',
unique_key = '_log_id',
cluster_by = ['block_timestamp::DATE'],
tags = ['curated','reorg'],
enabled = false
tags = ['curated','reorg']
) }}
WITH vertex_products AS (