From 6ca12620749f57e40b6b865ec78e503b48577439 Mon Sep 17 00:00:00 2001 From: archie17277 <160746411+archie17277@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:58:15 +0530 Subject: [PATCH] Add flashliquidity dex to trades (#7219) * Add flashliquidity dex * updated csv file * update sql file --------- Co-authored-by: jeff-dude <102681548+jeff-dude@users.noreply.github.com> --- dbt_subprojects/dex/models/dex_info.sql | 1 + .../dex/models/trades/base/_schema.yml | 19 ++++++++++++++++- .../trades/base/dex_base_base_trades.sql | 1 + .../flashliquidity_base_base_trades.sql | 21 +++++++++++++++++++ dbt_subprojects/dex/seeds/trades/_schema.yml | 15 +++++++++++++ .../flashliquidity_base_base_trades_seed.csv | 3 +++ sources/_sector/dex/trades/base/_sources.yml | 6 +++++- 7 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 dbt_subprojects/dex/models/trades/base/platforms/flashliquidity_base_base_trades.sql create mode 100644 dbt_subprojects/dex/seeds/trades/flashliquidity_base_base_trades_seed.csv diff --git a/dbt_subprojects/dex/models/dex_info.sql b/dbt_subprojects/dex/models/dex_info.sql index ad3c562c04f..42fd54da190 100644 --- a/dbt_subprojects/dex/models/dex_info.sql +++ b/dbt_subprojects/dex/models/dex_info.sql @@ -185,5 +185,6 @@ FROM (VALUES , ('kaia_swap', 'KaiaSwap', 'Direct', 'KaiaSwap') , ('defi_kingdoms', 'DeFi Kingdoms', 'Direct', 'DeFiKingdoms') , ('hyperjump', 'HyperJump', 'Direct', 'Hyperjump_fi') + , ('flashliquidity', 'Flashliquidity', 'Direct', 'flashliquidity') , ('akronswap', 'Akronswap', 'Direct', 'AkronFinance') ) AS temp_table (project, name, marketplace_type, x_username) diff --git a/dbt_subprojects/dex/models/trades/base/_schema.yml b/dbt_subprojects/dex/models/trades/base/_schema.yml index f960a1a8393..76c546922e4 100644 --- a/dbt_subprojects/dex/models/trades/base/_schema.yml +++ b/dbt_subprojects/dex/models/trades/base/_schema.yml @@ -997,6 +997,23 @@ models: - check_dex_base_trades_seed: seed_file: ref('xchange_base_base_trades_seed') + - name: flashliquidity_base_base_trades + meta: + blockchain: base + sector: dex + project: flashliquidity + contributors: archie + config: + tags: [ 'base', 'dex', 'trades', 'flashliquidity' ] + description: "flashliquidity base base trades" + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - tx_hash + - evt_index + - check_dex_base_trades_seed: + seed_file: ref('flashliquidity_base_base_trades_seed') + - name: akronswap_base_base_trades meta: blockchain: base @@ -1012,4 +1029,4 @@ models: - tx_hash - evt_index - check_dex_base_trades_seed: - seed_file: ref('akronswap_base_base_trades_seed') \ No newline at end of file + seed_file: ref('akronswap_base_base_trades_seed') diff --git a/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql index ab4ddf7d67b..9cbced710cb 100644 --- a/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/base/dex_base_base_trades.sql @@ -50,6 +50,7 @@ , ref('solidly_v3_base_base_trades') , ref('swaap_v2_base_base_trades') , ref('xchange_base_base_trades') + , ref('flashliquidity_base_base_trades') , ref('akronswap_base_base_trades') ] %} diff --git a/dbt_subprojects/dex/models/trades/base/platforms/flashliquidity_base_base_trades.sql b/dbt_subprojects/dex/models/trades/base/platforms/flashliquidity_base_base_trades.sql new file mode 100644 index 00000000000..98c4ae25d82 --- /dev/null +++ b/dbt_subprojects/dex/models/trades/base/platforms/flashliquidity_base_base_trades.sql @@ -0,0 +1,21 @@ +{{ + config( + schema = 'flashliquidity_base', + 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 = 'base', + project = 'flashliquidity', + version = '1', + Pair_evt_Swap = source('flashliquidity_base', 'FlashLiquidityPair_evt_Swap'), + Factory_evt_PairCreated = source('flashliquidity_base', 'FlashLiquidityFactory_evt_PairCreated') + ) +}} diff --git a/dbt_subprojects/dex/seeds/trades/_schema.yml b/dbt_subprojects/dex/seeds/trades/_schema.yml index ac10a1d666f..3c8a3436252 100644 --- a/dbt_subprojects/dex/seeds/trades/_schema.yml +++ b/dbt_subprojects/dex/seeds/trades/_schema.yml @@ -4456,6 +4456,21 @@ seeds: token_sold_amount_raw: uint256 block_date: timestamp + - name: flashliquidity_base_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: akronswap_base_base_trades_seed config: column_types: diff --git a/dbt_subprojects/dex/seeds/trades/flashliquidity_base_base_trades_seed.csv b/dbt_subprojects/dex/seeds/trades/flashliquidity_base_base_trades_seed.csv new file mode 100644 index 00000000000..e5d50a8bcc9 --- /dev/null +++ b/dbt_subprojects/dex/seeds/trades/flashliquidity_base_base_trades_seed.csv @@ -0,0 +1,3 @@ +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 +base,flashliquidity_base,1,2024-01-02,0xe9bf79692277d80abe35da70d44e6a4fe1154bff25cd435fcf257f5981ed8f46,18,0x4200000000000000000000000000000000000006,0x833589fcd6edb6e08f4c7c32d4f71b54bda02913,8695071,2074983733705749,5000000 +base,flashliquidity_base,1,2024-01-10,0xcbd2ef2440ad8f360b33a58423960d9cd3073317448e6e5364e76af316776046,37,0x4200000000000000000000000000000000000006,0x833589fcd6edb6e08f4c7c32d4f71b54bda02913,9028475,2434495227355002,5652787 \ No newline at end of file diff --git a/sources/_sector/dex/trades/base/_sources.yml b/sources/_sector/dex/trades/base/_sources.yml index 38f2266b51a..3411997a305 100644 --- a/sources/_sector/dex/trades/base/_sources.yml +++ b/sources/_sector/dex/trades/base/_sources.yml @@ -186,7 +186,11 @@ sources: tables: - name: XchangePair_evt_Swap - name: XchangeFactory_evt_PairCreated + - name: flashliquidity_base + tables: + - name: FlashLiquidityPair_evt_Swap + - name: FlashLiquidityFactory_evt_PairCreated - name: akronswap_base tables: - name: UniswapV2Pair_evt_Swap - - name: UniswapV2Factory_evt_PairCreated \ No newline at end of file + - name: UniswapV2Factory_evt_PairCreated