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

feat: add chainswap #6332

Closed
wants to merge 22 commits into from
Closed

Conversation

clizzard7
Copy link
Contributor

@clizzard7 clizzard7 commented Jul 5, 2024

This PR adds a dedicated spellbook for chainswap trades.
Dashboard: https://dune.com/whale_hunter/chainswap

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811148524 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811148648 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811273295 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811273479 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811405393 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811632666 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811405538 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811632793 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811790049 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811789963 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811924073 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811924061 approved.

@dune-eng
Copy link

dune-eng commented Jul 5, 2024

Workflow run id 9811981783 approved.

@Hosuke Hosuke self-assigned this Jul 6, 2024
@dune-eng
Copy link

Workflow run id 9894534877 approved.

@dune-eng
Copy link

Workflow run id 9894534986 approved.

@dune-eng
Copy link

Workflow run id 9894537227 approved.

@dune-eng
Copy link

Workflow run id 9894537614 approved.

Comment on lines 20 to 32
{% set deployer_3 = "0xc1cc1a300Dcfe5359eBe37f2007A77d1F91533ba" %}
{% set deployer_4 = "0x3A510C5a32bCb381c53704AED9c02b0c70041F7A" %}
{% set deployer_5 = "0xb7b953e81612c57256ff0aebd62b6a2f0546f7da" %}
{% set weth_contract_address = "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" %}
{% set usdc_contract_address = "0xaf88d065e77c8cC2239327C5EDb3A432268e5831" %}
{% set fee_recipient_1 = "0x415EEc63c95e944D544b3088bc682B759edB8548" %}
{% set fee_recipient_2 = "0xe1ff5a4c489b11e094bfbb5d23c6d4597a3a79ad" %}

with
bot_contracts as (
select address
from {{ source("arbitrum", "creation_traces") }}
where
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes (') in the code as much as possible. Double quotes (") can sometimes break the code.

@jeff-dude jeff-dude added the in review Assignee is currently reviewing the PR label Jul 12, 2024
@dune-eng
Copy link

Workflow run id 9920578611 approved.

@dune-eng
Copy link

Workflow run id 9920697985 approved.

@dune-eng
Copy link

Workflow run id 9920698243 approved.

@dune-eng
Copy link

Workflow run id 9920742605 approved.

@dune-eng
Copy link

Workflow run id 9920742499 approved.

@dune-eng
Copy link

Workflow run id 9920775014 approved.

@dune-eng
Copy link

Workflow run id 9920775092 approved.

@dune-eng
Copy link

Workflow run id 9920830494 approved.

@dune-eng
Copy link

Workflow run id 9920830549 approved.

@whalehunting
Copy link
Contributor

@Hosuke the uniqueness test is failing on the incremental run only, initial run works fine.
any idea why this is happening? we probably need to set an incremental filter somewhere (fee_deposits CTE?)

@Hosuke
Copy link
Collaborator

Hosuke commented Jul 15, 2024

@Hosuke the uniqueness test is failing on the incremental run only, initial run works fine. any idea why this is happening? we probably need to set an incremental filter somewhere (fee_deposits CTE?)

I think we may need to add incremental filters into these spells first.
Currently I cannot identify any incremental filters in these spells.

@dune-eng
Copy link

Workflow run id 10071784899 approved.

@dune-eng
Copy link

Workflow run id 10071785209 approved.

@whalehunting
Copy link
Contributor

@Hosuke the uniqueness test is failing on the incremental run only, initial run works fine. any idea why this is happening? we probably need to set an incremental filter somewhere (fee_deposits CTE?)

I think we may need to add incremental filters into these spells first. Currently I cannot identify any incremental filters in these spells.

ok will try that out and report back, thank you sir!

@dune-eng
Copy link

Workflow run id 10132637251 approved.

@dune-eng
Copy link

Workflow run id 10132686143 approved.

@dune-eng
Copy link

Workflow run id 10132730375 approved.

@clizzard7 clizzard7 requested a review from Hosuke July 28, 2024 15:36
Comment on lines +40 to +41
and block_time >= timestamp '{{project_start_date}}'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add an incremental filter here.

tx_to as bot,
trades.tx_hash,
evt_index
from {{ source('dex', 'trades') }} as trades
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can apply incremental filters to most selection from large tables/sources.

trades.blockchain = '{{blockchain}}'
and trades.block_time >= timestamp '{{project_start_date}}'
and (tx_from != {{ fee_recipient_1 }} and tx_from != {{ fee_recipient_2 }})
order by trades.block_time desc, trades.evt_index desc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is not the final select, I am not sure if the order by works here.

@jeff-dude jeff-dude closed this Aug 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dbt: dex covers the DEX dbt subproject in review Assignee is currently reviewing the PR WIP work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants