Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions dbt_subprojects/dex/models/dex_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,5 @@ FROM (VALUES
, ('somnex', 'SomneX', 'Direct', 'SomneX')
, ('machinex', 'Machine X', 'Direct', 'machinexdotxyz')
, ('cldex', 'CLDEX', 'Direct', 'KaiaChain')
, ('graphene', 'Graphene', 'Direct', 'GetGraphene')
) AS temp_table (project, name, marketplace_type, x_username)
23 changes: 21 additions & 2 deletions dbt_subprojects/dex/models/trades/arbitrum/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ models:
- name: eulerswap_arbitrum_base_trades
meta:
blockchain: arbitrum
sector: dex
sector: dex
project: eulerswap
contributors: Henrystats
config:
Expand All @@ -960,4 +960,23 @@ models:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- tx_hash
- evt_index
- evt_index

- name: graphene_arbitrum_base_trades
meta:
blockchain: arbitrum
sector: dex
project: graphene
contributors: principatel
config:
tags: ["arbitrum", "dex", "trades", "graphene"]
description: "graphene arbitrum 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('graphene_arbitrum_base_trades_seed')
filter:
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
, ref('gammaswap_arbitrum_base_trades')
, ref('native_arbitrum_base_trades')
, ref('eulerswap_arbitrum_base_trades')
, ref('graphene_arbitrum_base_trades')
] %}

with base_union as (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{
config(
schema = 'graphene_arbitrum',
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')]
)
}}

WITH dexs AS (
SELECT
'arbitrum' AS blockchain,
'graphene' AS project,
'1' AS version,
CAST(DATE_TRUNC('month', evt_block_time) AS DATE) AS block_month,
CAST(DATE_TRUNC('day', evt_block_time) AS DATE) AS block_date,
evt_block_time AS block_time,
evt_block_number AS block_number,
targetAmount AS token_bought_amount_raw,
sourceAmount AS token_sold_amount_raw,
targetToken AS token_bought_address,
sourceToken AS token_sold_address,
trader AS taker,
CAST(NULL AS VARBINARY) AS maker,
contract_address AS project_contract_address,
evt_tx_hash AS tx_hash,
evt_index
FROM {{ source('graphene_arbitrum', 'carboncontroller_evt_tokenstraded') }}
{% if is_incremental() %}
WHERE {{ incremental_predicate('evt_block_time') }}
{% endif %}
)

SELECT * FROM dexs
15 changes: 15 additions & 0 deletions dbt_subprojects/dex/seeds/trades/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5958,3 +5958,18 @@ seeds:
token_bought_amount_raw: uint256
token_sold_amount_raw: uint256
block_date: timestamp

- name: graphene_arbitrum_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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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
arbitrum,graphene,1,2023-11-08,0x471458c4a10dc9a13bc822ff932e27e292b9cbeb0aba9b6caa6911858a5d8bbb,33,0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,0xaf88d065e77c8cc2239327c5edb3a432268e5831,148316068,1000000000000000,1003
3 changes: 3 additions & 0 deletions sources/_sector/dex/trades/arbitrum/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,6 @@ sources:
- name: native_arbitrum
tables:
- name: NativeRFQPool_evt_RFQTrade
- name: graphene_arbitrum
tables:
- name: carboncontroller_evt_tokenstraded