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 Pancakeswap Linea Dex Trades #6102

Merged
merged 9 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
39 changes: 39 additions & 0 deletions models/_sector/dex/trades/linea/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,42 @@ models:
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('secta_linea_base_trades_seed')

- name: pancakeswap_v2_linea_base_trades
meta:
blockchain: linea
sector: dex
project: pancakeswap
contributors: chef_seaweed
config:
tags: [ 'linea', 'dex', 'trades', 'pancakeswap', 'uniswap', 'v2' ]
description: "Pancakeswap linea v2 base trades"
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('pancakeswap_linea_base_trades_seed')
filter:
version: 2


- name: pancakeswap_v3_linea_base_trades
meta:
blockchain: linea
sector: dex
project: pancakeswap
contributors: chef_seaweed
config:
tags: [ 'linea', 'dex', 'trades', 'pancakeswap' ]
description: "Pancakeswap V3 linea base trades"
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('pancakeswap_linea_base_trades_seed')
filter:
version: 3
2 changes: 2 additions & 0 deletions models/_sector/dex/trades/linea/dex_linea_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
, ref('nile_linea_base_trades')
, ref('echodex_linea_base_trades')
, ref('secta_linea_base_trades')
, ref('pancakeswap_v2_linea_base_trades')
, ref('pancakeswap_v3_linea_base_trades')
] %}

WITH base_union AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{
config(
schema = 'pancakeswap_v2_linea',
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')]
)
}}

{{
uniswap_compatible_v2_trades(
blockchain = 'linea',
project = 'pancakeswap',
version = '2',
Pair_evt_Swap = source('pancakeswap_v2_linea', 'PancakePair_evt_Swap'),
Factory_evt_PairCreated = source('pancakeswap_v2_linea', 'PancakeFactory_evt_PairCreated')
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{
config(
schema = 'pancakeswap_v3_linea',
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')]
)
}}

{{
uniswap_compatible_v3_trades(
blockchain = 'linea',
project = 'pancakeswap',
version = '3',
Pair_evt_Swap = source('pancakeswap_v3_linea', 'PancakeV3Pool_evt_Swap'),
Factory_evt_PoolCreated = source('pancakeswap_v3_linea', 'PancakeV3Factory_evt_PoolCreated')
)
}}
7 changes: 7 additions & 0 deletions seeds/_sector/dex/pancakeswap_linea_base_trades_seed.csv
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may miss the seed schema for this file.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
blockchain,project,version,block_date,tx_hash,evt_index,token_bought_address,token_sold_address,block_number,token_bought_amount_raw,token_sold_amount_raw
linea,pancakeswap,3,2024-06-06,0x423862c172e153d21a9189b1aa9a1e2c695fd40d3ee85f9af1b9d7564cd5e888,16,0x176211869ca2b568f2a7d4ee941e073a821ee1ff,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,5211888,496565,129359184767832
linea,pancakeswap,3,2024-06-06,0x63de14f6bd76e0d75534ed2c96f3997e0f3160bf77be3e0fc5ea18aac9cb1de3,31,0x0d1e753a25ebda689453309112904807625befbe,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,5211829,12949937293941124297,10845214481693491
linea,pancakeswap,3,2024-06-06,0x4a5497538310bd15e8d0718f24a0f84250cf24e384e3cff35cfc88ce9fba5bc5,66,0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,5211830,48016,8900000000000000
linea,pancakeswap,2,2024-06-06,0x88972ff1e3be8a0c3482fe343b6c0b2fa10f5f039a942c73f160fb89d06b08ef,4,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,0xd96536b77ae5500fe850add2253bcf640e7824c1,5209979,158345288962017321,93174475178374246432768
linea,pancakeswap,2,2024-06-06,0x50ea22a95b93395bc9d435847c45275875ef06a7e658e4af0e55da15e0f1c2d4,7,0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,5211323,1200,222040000000000
linea,pancakeswap,2,2024-06-06,0x4887fe6d483b01674ed6183767a41854bc9ef8d0557200d17ffbc803e1071cba,13,0x176211869ca2b568f2a7d4ee941e073a821ee1ff,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,5210736,354102,92186250000000
8 changes: 8 additions & 0 deletions sources/_sector/dex/trades/linea/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ sources:
tables:
- name: SectaFactory_evt_PairCreated
- name: SectaPair_evt_Swap
- name: pancakeswap_v2_linea
tables:
- name: PancakePair_evt_Swap
- name: PancakeFactory_evt_PairCreated
- name: pancakeswap_v3_linea
tables:
- name: PancakeV3Pool_evt_Swap
- name: PancakeV3Factory_evt_PoolCreated
Loading