diff --git a/dbt_subprojects/dex/models/_projects/curvefi/curvefi_trades.sql b/dbt_subprojects/dex/models/_projects/curvefi/curve_trades.sql similarity index 89% rename from dbt_subprojects/dex/models/_projects/curvefi/curvefi_trades.sql rename to dbt_subprojects/dex/models/_projects/curvefi/curve_trades.sql index 6a67dee3c6a..9df6447f1b1 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/curvefi_trades.sql +++ b/dbt_subprojects/dex/models/_projects/curvefi/curve_trades.sql @@ -1,10 +1,10 @@ {{ config( - schema = 'curvefi', + schema = 'curve', alias = 'trades', materialized = 'view', post_hook='{{ expose_spells(blockchains = \'["ethereum","avalanche_c","optimism","fantom","celo"]\', spell_type = "project", - spell_name = "curvefi", + spell_name = "curve", contributors = \'["jeff-dude","yulesa","dsalv","Henrystats","msilb7","ilemi","agaperste","tomfutago"]\') }}' ) }} @@ -35,4 +35,4 @@ SELECT blockchain , tx_to , evt_index FROM {{ ref('dex_trades') }} -WHERE project = 'curvefi' \ No newline at end of file +WHERE project = 'curve' \ No newline at end of file diff --git a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/_schema.yml b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/_schema.yml index 3d776f0086e..df369f8b544 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/_schema.yml @@ -1,13 +1,13 @@ version: 2 models: - - name: curvefi_ethereum_pool_details + - name: curve_ethereum_pool_details meta: blockchain: ethereum - project: curvefi + project: curve contributors: [agaperste, yulesa] config: - tags: ["ethereum", "curvefi", "view"] + tags: ["ethereum", "curve", "view"] description: > a dictionary view of pool details for a lot of regular pools on Curve.fi on Ethereum columns: @@ -66,13 +66,13 @@ models: name: undercoin3 description: "Address for third underlying coin, when applicable" - - name: curvefi_ethereum_view_pools + - name: curve_ethereum_view_pools meta: blockchain: ethereum - project: curvefi + project: curve contributors: [agaperste, yulesa, ilemi, viniabussafi] config: - tags: ["ethereum", "curvefi", "view_pools", "view"] + tags: ["ethereum", "curve", "view_pools", "view"] description: > view details of pools for Curve.fi on Ethereum columns: diff --git a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_pool_details.sql b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_pool_details.sql similarity index 99% rename from dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_pool_details.sql rename to dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_pool_details.sql index cebcd240178..bca828d1162 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_pool_details.sql +++ b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_pool_details.sql @@ -1,5 +1,5 @@ {{ config( - schema = 'curvefi_ethereum' + schema = 'curve_ethereum' , alias = 'pool_details' ) }} diff --git a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_view_pools.sql b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_view_pools.sql similarity index 99% rename from dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_view_pools.sql rename to dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_view_pools.sql index e1974b65253..332f7e9f5c6 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curvefi_ethereum_view_pools.sql +++ b/dbt_subprojects/dex/models/_projects/curvefi/ethereum/curve_ethereum_view_pools.sql @@ -1,11 +1,11 @@ {{ config( - schema = 'curvefi_ethereum', + schema = 'curve_ethereum', alias = 'view_pools', materialized='table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', "project", - "curvefi", + "curve", \'["yulesa", "agaperste", "ilemi", "viniabussafi"]\') }}' ) }} @@ -29,7 +29,7 @@ WITH regular_pools AS ( deposit_contract, coin3 FROM - {{ ref('curvefi_ethereum_pool_details') }} + {{ ref('curve_ethereum_pool_details') }} ), regular_pools_deployed AS ( SELECT diff --git a/dbt_subprojects/dex/models/_projects/curvefi/optimism/_schema.yml b/dbt_subprojects/dex/models/_projects/curvefi/optimism/_schema.yml index 311dc638b22..3eaf8b43999 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/optimism/_schema.yml +++ b/dbt_subprojects/dex/models/_projects/curvefi/optimism/_schema.yml @@ -1,15 +1,15 @@ version: 2 models: - - name: curvefi_optimism_pools + - name: curve_optimism_pools meta: blockchain: optimism - project: curvefi + project: curve contributors: msilb7 config: - tags: ['optimism','curvefi','curve','dex'] + tags: ['optimism','curve','dex'] description: > - A table containing all known pools of curvefi on optimism (i.e. metapool, basicpool). Additional types should be monitored to ensure they're accurately shown. + A table containing all known pools of curve on optimism (i.e. metapool, basicpool). Additional types should be monitored to ensure they're accurately shown. tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: diff --git a/dbt_subprojects/dex/models/_projects/curvefi/optimism/curvefi_optimism_pools.sql b/dbt_subprojects/dex/models/_projects/curvefi/optimism/curve_optimism_pools.sql similarity index 98% rename from dbt_subprojects/dex/models/_projects/curvefi/optimism/curvefi_optimism_pools.sql rename to dbt_subprojects/dex/models/_projects/curvefi/optimism/curve_optimism_pools.sql index 042ab581f63..7e942c70f6f 100644 --- a/dbt_subprojects/dex/models/_projects/curvefi/optimism/curvefi_optimism_pools.sql +++ b/dbt_subprojects/dex/models/_projects/curvefi/optimism/curve_optimism_pools.sql @@ -1,5 +1,5 @@ {{ config( - schema = 'curvefi_optimism', + schema = 'curve_optimism', alias = 'pools', materialized = 'incremental', file_format = 'delta', @@ -7,7 +7,7 @@ unique_key = ['version', 'tokenid', 'token', 'pool'], post_hook='{{ expose_spells(\'["optimism"]\', "project", - "curvefi", + "curve", \'["msilb7"]\') }}' ) }} diff --git a/dbt_subprojects/dex/models/_projects/dex_trades_views_schema.yml b/dbt_subprojects/dex/models/_projects/dex_trades_views_schema.yml index 8b969c29d8d..855bc5c3f54 100644 --- a/dbt_subprojects/dex/models/_projects/dex_trades_views_schema.yml +++ b/dbt_subprojects/dex/models/_projects/dex_trades_views_schema.yml @@ -12,7 +12,7 @@ models: - name: camelot_trades - name: carbon_defi_trades - name: clipper_trades - - name: curvefi_trades + - name: curve_trades - name: defiswap_trades - name: dfx_trades - name: dodo_trades diff --git a/dbt_subprojects/dex/models/trades/dex_trades.sql b/dbt_subprojects/dex/models/trades/dex_trades.sql index 1ada8309146..1e5ae87c0a6 100644 --- a/dbt_subprojects/dex/models/trades/dex_trades.sql +++ b/dbt_subprojects/dex/models/trades/dex_trades.sql @@ -45,8 +45,8 @@ WITH curve AS ( enrich_curve_dex_trades( base_trades = ref('dex_base_trades') , filter = "project = 'curve'" - , curve_ethereum = ref('curvefi_ethereum_base_trades') - , curve_optimism = ref('curvefi_optimism_base_trades') + , curve_ethereum = ref('curve_ethereum_base_trades') + , curve_optimism = ref('curve_optimism_base_trades') , tokens_erc20_model = source('tokens', 'erc20') ) }} diff --git a/dbt_subprojects/dex/models/trades/ethereum/_schema.yml b/dbt_subprojects/dex/models/trades/ethereum/_schema.yml index 144e2b8f8e2..fba051b0a13 100644 --- a/dbt_subprojects/dex/models/trades/ethereum/_schema.yml +++ b/dbt_subprojects/dex/models/trades/ethereum/_schema.yml @@ -539,15 +539,15 @@ models: - check_dex_base_trades_seed: seed_file: ref('xchange_ethereum_base_trades_seed') - - name: curvefi_ethereum_base_trades + - name: curve_ethereum_base_trades meta: blockchain: ethereum sector: dex - project: curvefi + project: curve contributors: dsalv, yulesa, ilemi, jeff-dude, tomfutago config: - tags: ['ethereum', 'dex', 'trades', 'curvefi'] - description: "Curvefi ethereum base trades" + tags: ['ethereum', 'dex', 'trades', 'curve'] + description: "Curve ethereum base trades" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: diff --git a/dbt_subprojects/dex/models/trades/ethereum/dex_ethereum_base_trades.sql b/dbt_subprojects/dex/models/trades/ethereum/dex_ethereum_base_trades.sql index 45260e99033..24a983063ef 100644 --- a/dbt_subprojects/dex/models/trades/ethereum/dex_ethereum_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/ethereum/dex_ethereum_base_trades.sql @@ -34,7 +34,7 @@ , ref('clipper_ethereum_base_trades') , ref('mstable_ethereum_base_trades') , ref('xchange_ethereum_base_trades') - , ref('curvefi_ethereum_base_trades') + , ref('curve_ethereum_base_trades') , ref('solidly_v3_ethereum_base_trades') , ref('swaap_v2_ethereum_base_trades') ] %} diff --git a/dbt_subprojects/dex/models/trades/ethereum/platforms/curvefi_ethereum_base_trades.sql b/dbt_subprojects/dex/models/trades/ethereum/platforms/curve_ethereum_base_trades.sql similarity index 97% rename from dbt_subprojects/dex/models/trades/ethereum/platforms/curvefi_ethereum_base_trades.sql rename to dbt_subprojects/dex/models/trades/ethereum/platforms/curve_ethereum_base_trades.sql index e39c3c48265..74d36ba14bf 100644 --- a/dbt_subprojects/dex/models/trades/ethereum/platforms/curvefi_ethereum_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/ethereum/platforms/curve_ethereum_base_trades.sql @@ -1,6 +1,6 @@ {{ config( - schema = 'curvefi_ethereum', + schema = 'curve_ethereum', alias = 'base_trades', materialized = 'incremental', file_format = 'delta', @@ -51,7 +51,7 @@ WITH dexs AS , l.tx_hash , l.index as evt_index FROM {{ source('ethereum', 'logs') }} l - JOIN {{ ref('curvefi_ethereum_view_pools') }} p + JOIN {{ ref('curve_ethereum_view_pools') }} p ON l.contract_address = p.pool_address AND p.version IN ('Factory V1 Meta', 'Factory V1 Plain', 'Regular', 'Factory V1 Stableswap Plain', 'Factory V1 Stableswap Meta', 'Factory V1 Stableswap Plain NG') --note Plain only has TokenExchange. WHERE l.topic0 IN @@ -82,7 +82,7 @@ WITH dexs AS , l.tx_hash , l.index as evt_index FROM {{ source('ethereum', 'logs') }} l - JOIN {{ ref('curvefi_ethereum_view_pools') }} p + JOIN {{ ref('curve_ethereum_view_pools') }} p ON l.contract_address = p.pool_address AND (p.version = 'Factory V2' or p.version = 'Factory V2 updated' or p.version = 'Regular' or p.version = 'Factory Twocrypto') --some Regular pools are new and use the below topic instead WHERE (l.topic0 = 0xb2e76ae99761dc136e598d4a629bb347eccb9532a5f8bbd72e18467c3c34cc98 --TokenExchange diff --git a/dbt_subprojects/dex/models/trades/optimism/_schema.yml b/dbt_subprojects/dex/models/trades/optimism/_schema.yml index 79c68fd08c4..9963700f4bc 100644 --- a/dbt_subprojects/dex/models/trades/optimism/_schema.yml +++ b/dbt_subprojects/dex/models/trades/optimism/_schema.yml @@ -382,15 +382,15 @@ models: seed_file: ref('rubicon_optimism_base_trades_seed') - - name: curvefi_optimism_base_trades + - name: curve_optimism_base_trades meta: blockchain: optimism sector: dex - project: curvefi + project: curve contributors: msilb7, tomfutago config: - tags: ['optimism', 'dex', 'trades', 'curvefi'] - description: "Curvefi optimism base trades" + tags: ['optimism', 'dex', 'trades', 'curve'] + description: "Curve optimism base trades" tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: diff --git a/dbt_subprojects/dex/models/trades/optimism/dex_optimism_base_trades.sql b/dbt_subprojects/dex/models/trades/optimism/dex_optimism_base_trades.sql index c14490e2149..f81d356fac8 100644 --- a/dbt_subprojects/dex/models/trades/optimism/dex_optimism_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/optimism/dex_optimism_base_trades.sql @@ -24,7 +24,7 @@ , ref('openxswap_optimism_base_trades') , ref('openocean_optimism_base_trades') , ref('chainhop_optimism_base_trades') - , ref('curvefi_optimism_base_trades') + , ref('curve_optimism_base_trades') , ref('rubicon_optimism_base_trades') , ref('gridex_optimism_base_trades') , ref('solidly_v3_optimism_base_trades') diff --git a/dbt_subprojects/dex/models/trades/optimism/platforms/curvefi_optimism_base_trades.sql b/dbt_subprojects/dex/models/trades/optimism/platforms/curve_optimism_base_trades.sql similarity index 96% rename from dbt_subprojects/dex/models/trades/optimism/platforms/curvefi_optimism_base_trades.sql rename to dbt_subprojects/dex/models/trades/optimism/platforms/curve_optimism_base_trades.sql index 8979457ec41..bae80bd53a3 100644 --- a/dbt_subprojects/dex/models/trades/optimism/platforms/curvefi_optimism_base_trades.sql +++ b/dbt_subprojects/dex/models/trades/optimism/platforms/curve_optimism_base_trades.sql @@ -1,6 +1,6 @@ {{ config( - schema = 'curvefi_optimism', + schema = 'curve_optimism', alias = 'base_trades', materialized = 'incremental', file_format = 'delta', @@ -10,7 +10,7 @@ ) }} --- This should depend on 'curvefi_optimism_pools' running first +-- This should depend on 'curve_optimism_pools' running first -- Original Ref - Dune v1 Abstraction: https://github.com/duneanalytics/spellbook/blob/main/deprecated-dune-v1-abstractions/optimism2/dex/insert_curve.sql -- Start Time -- SELECT MIN(evt_block_time) FROM curvefi_optimism.StableSwap_evt_TokenExchange @@ -152,10 +152,10 @@ SELECT AND {{ incremental_predicate('t.evt_block_time') }} {% endif %} ) cp - INNER JOIN {{ ref('curvefi_optimism_pools') }} ta + INNER JOIN {{ ref('curve_optimism_pools') }} ta ON cp.project_contract_address = ta.pool AND cp.bought_id = ta.tokenid - INNER JOIN {{ ref('curvefi_optimism_pools') }} tb + INNER JOIN {{ ref('curve_optimism_pools') }} tb ON cp.project_contract_address = tb.pool AND cp.sold_id = tb.tokenid )