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 Uniswap V3 Linea Dex Trades #6200

Merged
merged 6 commits into from
Jun 19, 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
19 changes: 19 additions & 0 deletions dex/models/trades/linea/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,22 @@ models:
filter:
version: 1

- name: uniswap_v3_linea_base_trades
meta:
blockchain: linea
sector: dex
project: uniswap
contributors: chef_seaweed
config:
tags: [ 'linea', 'dex', 'trades', 'uniswap', 'v3' ]
description: "uniswap linea v3 base trades"
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- check_dex_base_trades_seed:
seed_file: ref('uniswap_linea_base_trades_seed')
filter:
version: 3

1 change: 1 addition & 0 deletions dex/models/trades/linea/dex_linea_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
, ref('pancakeswap_v2_linea_base_trades')
, ref('pancakeswap_v3_linea_base_trades')
, ref('horizondex_linea_base_trades')
, ref('uniswap_v3_zksync_base_trades')
Hosuke marked this conversation as resolved.
Show resolved Hide resolved
] %}

WITH base_union AS (
Expand Down
21 changes: 21 additions & 0 deletions dex/models/trades/linea/platforms/uniswap_v3_linea_base_trades.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{ config(
schema = 'uniswap_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 = 'uniswap'
, version = '3'
, Pair_evt_Swap = source('uniswap_v3_linea', 'UniswapV3Pool_evt_Swap')
, Factory_evt_PoolCreated = source('uniswap_v3_linea', 'UniswapV3Factory_evt_PoolCreated')
)
}}

15 changes: 15 additions & 0 deletions dex/seeds/trades/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2010,6 +2010,21 @@ seeds:
token_sold_amount_raw: uint256
block_date: timestamp

- name: uniswap_linea_base_trades_seed
config:
column_types:
blockchain: varchar
project: varchar
version: varchar
tx_hash: varbinary
evt_index: uint256
block_number: uint256
token_bought_address: varbinary
token_sold_address: varbinary
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: velodrome_optimism_base_trades_seed
config:
column_types:
Expand Down
4 changes: 4 additions & 0 deletions dex/seeds/trades/uniswap_linea_base_trades_seed.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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,uniswap,3,2024-06-18,0x9a565c9faab8d043b23c0f46fd3e499f102c03c58fceba98052c6985bdcf163d,10,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,0x176211869ca2b568f2a7d4ee941e073a821ee1ff,5659062,500000000000000000,1691314139
linea,uniswap,3,2024-06-18,0xcc3bc023858ab85b067ab12c65dddc0a7822fb8d5e78168cf7c3354a24279cb9,5,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4,5659061,384578225348879304,2015494
linea,uniswap,3,2024-06-18,0x0e957a3383db59cdb8ece4e99253726b571e7f939a6080e070c75e03be9e92e1,26,0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f,0x176211869ca2b568f2a7d4ee941e073a821ee1ff,5661062,527210960128358766,1794523511
4 changes: 4 additions & 0 deletions sources/_sector/dex/trades/linea/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ sources:
tables:
- name: Pool_evt_Swap
- name: Factory_evt_PoolCreated
- name: uniswap_v3_linea
tables:
- name: UniswapV3Pool_evt_Swap
- name: UniswapV3Factory_evt_PoolCreated

Loading