Skip to content

Commit

Permalink
Add opx_finance to dex.trades_beta (#5106)
Browse files Browse the repository at this point in the history
* init

* Update _schema.yml

* Add opx_finance_optimism_sources.yml

---------

Co-authored-by: Huang Geyang <Sukebeta@outlook.com>
  • Loading branch information
tomfutago and Hosuke authored Jan 9, 2024
1 parent 5c7107d commit b26d994
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
28 changes: 25 additions & 3 deletions models/_sector/dex/trades/optimism/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ models:
- elastic
- elastic_2


- name: velodrome_optimism_base_trades
meta:
blockchain: optimism
Expand All @@ -267,7 +268,8 @@ models:
version:
- 1
- 2



- name: synthetix_optimism_base_trades
meta:
blockchain: optimism
Expand All @@ -284,7 +286,8 @@ models:
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('synthetix_optimism_base_trades_seed')



- name: openxswap_optimism_base_trades
meta:
blockchain: optimism
Expand All @@ -301,7 +304,8 @@ models:
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('openxswap_optimism_base_trades_seed')



- name: openocean_optimism_base_trades
meta:
blockchain: optimism
Expand All @@ -318,3 +322,21 @@ models:
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('openocean_optimism_base_trades_seed')


- name: opx_finance_optimism_base_trades
meta:
blockchain: optimism
sector: dex
project: opx_finance
contributors: kaiblade, tomfutago
config:
tags: [ 'optimism', 'dex', 'trades', 'opx_finance' ]
description: "OPX Finance optimism base trades"
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('opx_finance_optimism_base_trades_seed')
3 changes: 3 additions & 0 deletions models/_sector/dex/trades/optimism/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ sources:
- name: ClipperPackedExchange_evt_Swapped
- name: ClipperPackedVerifiedExchange_evt_Swapped
- name: ClipperCove_evt_CoveSwapped
- name: opx_finance_optimism
tables:
- name: Router_evt_Swap
- name: velodrome_optimism
tables:
- name: Pair_evt_Swap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
, ref('dodo_optimism_base_trades')
, ref('kyberswap_optimism_base_trades')
, ref('clipper_optimism_base_trades')
, ref('opx_finance_optimism_base_trades')
, ref('velodrome_optimism_base_trades')
, ref('synthetix_optimism_base_trades')
, ref('openxswap_optimism_base_trades')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{
config(
schema = 'opx_finance_optimism',
alias = 'base_trades',
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['tx_hash', 'evt_index'],
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')]
)
}}

{{
generic_spot_compatible_trades(
blockchain = 'optimism',
project = 'opx_finance',
version = '1',
source_evt_swap = source('opx_finance_optimism', 'Router_evt_Swap')
)
}}
3 changes: 0 additions & 3 deletions models/opx_finance/optimism/opx_finance_optimism_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ sources:
description: >
Decoded event table for swaps on opx_finance
tables:
- name: Router_evt_Swap
loaded_at_field: evt_block_time

- name: Vault_evt_CollectMarginFees
loaded_at_field: evt_block_time

Expand Down

0 comments on commit b26d994

Please sign in to comment.