Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add-vertex-spot-markets #86

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions models/evm/gold/protocols/vertex/vertex__ez_spot_trades.sql
Original file line number Diff line number Diff line change
@@ -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') }}
72 changes: 72 additions & 0 deletions models/evm/gold/protocols/vertex/vertex__ez_spot_trades.yml
Original file line number Diff line number Diff line change
@@ -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") }}'
3 changes: 1 addition & 2 deletions models/evm/silver/protocols/vertex/silver__vertex_spot.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down