Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ set delta_configs = [
['ethereum', 'delta-v1-batch', 'paraswapdelta_ethereum.ParaswapDeltav1_call_safeSettleBatchSwap', 'contract_address', 'call_block_time', 'call_tx_hash', null, '0'],

['ethereum', 'delta-v2', 'paraswapdelta_ethereum.ParaswapDeltav2_evt_OrderSettled', 'contract_address', 'evt_block_time', 'evt_tx_hash', null, '0'],
['ethereum', 'delta-v2', 'paraswapdelta_base.ParaswapDeltav2_evt_OrderPartiallyFilled', 'contract_address', 'evt_block_time', 'evt_tx_hash', 'evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53', '0'],
['base', 'delta-v2', 'paraswapdelta_base.ParaswapDeltav2_evt_OrderSettled', 'contract_address', 'evt_block_time', 'evt_tx_hash', 'evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53', '0'],
['base', 'delta-v2', 'paraswapdelta_base.ParaswapDeltav2_evt_OrderPartiallyFilled', 'contract_address', 'evt_block_time', 'evt_tx_hash', 'evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53', '0'],
['optimism', 'delta-v2', 'paraswapdelta_optimism.ParaswapDeltav2_evt_OrderSettled', 'contract_address', 'evt_block_time', 'evt_tx_hash', 'evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53', '0'],
['optimism', 'delta-v2', 'paraswapdelta_optimism.ParaswapDeltav2_evt_OrderPartiallyFilled', 'contract_address', 'evt_block_time', 'evt_tx_hash', 'evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53', '0'],

['ethereum', 'augustus', 'dex_aggregator.trades', 'project_contract_address', 'block_time', 'tx_hash', "project='paraswap' and blockchain='ethereum'", 'amount_usd'],

['polygon', 'augustus', 'dex_aggregator.trades', 'project_contract_address', 'block_time', 'tx_hash', "project='paraswap' and blockchain='polygon'", 'amount_usd'],
['bnb', 'augustus', 'dex_aggregator.trades', 'project_contract_address', 'block_time', 'tx_hash', "project='paraswap' and blockchain='bnb'", 'amount_usd'],
['arbitrum', 'augustus', 'dex_aggregator.trades', 'project_contract_address', 'block_time', 'tx_hash', "project='paraswap' and blockchain='arbitrum'", 'amount_usd'],
Expand All @@ -41,4 +44,4 @@ with entities as (
{% if not loop.last %} union all {% endif %}
{% endfor %}
)
{% endmacro %}
{% endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ with entities as (

union all

select 'delta-v2' as entity, 'ethereum' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_base.ParaswapDeltav2_evt_OrderPartiallyFilled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')

AND evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53

union all

select 'delta-v2' as entity, 'base' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_base.ParaswapDeltav2_evt_OrderSettled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')
Expand All @@ -33,6 +41,30 @@ with entities as (

union all

select 'delta-v2' as entity, 'base' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_base.ParaswapDeltav2_evt_OrderPartiallyFilled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')

AND evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53

union all

select 'delta-v2' as entity, 'optimism' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_optimism.ParaswapDeltav2_evt_OrderSettled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')

AND evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53

union all

select 'delta-v2' as entity, 'optimism' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_optimism.ParaswapDeltav2_evt_OrderPartiallyFilled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')

AND evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53

union all

select 'augustus' as entity, 'ethereum' as blockchain, project_contract_address as contract_address, block_time as block_time, tx_hash as tx_hash, amount_usd as usd_value from dex_aggregator.trades
where
(block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ with entities as (

union all

select 'delta-v2' as entity, 'ethereum' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_base.ParaswapDeltav2_evt_OrderPartiallyFilled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')

AND evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53

union all

select 'delta-v2' as entity, 'base' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_base.ParaswapDeltav2_evt_OrderSettled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')
Expand All @@ -35,6 +43,30 @@ with entities as (

union all

select 'delta-v2' as entity, 'base' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_base.ParaswapDeltav2_evt_OrderPartiallyFilled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')

AND evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53

union all

select 'delta-v2' as entity, 'optimism' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_optimism.ParaswapDeltav2_evt_OrderSettled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')

AND evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53

union all

select 'delta-v2' as entity, 'optimism' as blockchain, contract_address as contract_address, evt_block_time as block_time, evt_tx_hash as tx_hash, 0 as usd_value from paraswapdelta_optimism.ParaswapDeltav2_evt_OrderPartiallyFilled
where
(evt_block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')

AND evt_tx_from <> 0xace5ae3de4baffc4a45028659c5ee330764e4f53

union all

select 'augustus' as entity, 'ethereum' as blockchain, project_contract_address as contract_address, block_time as block_time, tx_hash as tx_hash, amount_usd as usd_value from dex_aggregator.trades
where
(block_time BETWEEN timestamp '{{date_from}}' AND timestamp '{{date_to}}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,24 +297,24 @@ from delta_v1_safe_settle_batch_swap_model
-- d.trace_address,
-- d.evt_index
-- FROM dexs d
-- INNER JOIN delta_prod.ethereum.transactions tx ON d.tx_hash = tx.hash
-- INNER JOIN "delta_prod"."ethereum"."transactions" tx ON d.tx_hash = tx.hash
-- AND d.block_number = tx.block_number
--
-- AND tx.block_time >= TIMESTAMP '2024-05-01'
--
--
-- LEFT JOIN delta_prod.tokens.erc20 e1 ON e1.contract_address = d.token_bought_address
-- LEFT JOIN "delta_prod"."tokens"."erc20" e1 ON e1.contract_address = d.token_bought_address
-- AND e1.blockchain = 'ethereum'
-- LEFT JOIN delta_prod.tokens.erc20 e2 ON e2.contract_address = d.token_sold_address
-- LEFT JOIN "delta_prod"."tokens"."erc20" e2 ON e2.contract_address = d.token_sold_address
-- AND e2.blockchain = 'ethereum'
-- LEFT JOIN delta_prod.prices.usd p1 ON p1.minute = date_trunc('minute', d.block_time)
-- LEFT JOIN "delta_prod"."prices"."usd" p1 ON p1.minute = date_trunc('minute', d.block_time)
-- AND p1.contract_address = d.token_bought_address
-- AND p1.blockchain = 'ethereum'
--
-- AND p1.minute >= TIMESTAMP '2024-05-01'
--
--
-- LEFT JOIN delta_prod.prices.usd p2 ON p2.minute = date_trunc('minute', d.block_time)
-- LEFT JOIN "delta_prod"."prices"."usd" p2 ON p2.minute = date_trunc('minute', d.block_time)
-- AND p2.contract_address = d.token_sold_address
-- AND p2.blockchain = 'ethereum'
--
Expand Down
Loading