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

Swapline DEX on Base #7284

Closed
wants to merge 8 commits into from
Closed

Conversation

PatelPrinci
Copy link
Contributor

Thank you for contributing to Spellbook 🪄

Please open the PR in draft and mark as ready when you want to request a review.

Description:

[...]


quick links for more information:

@0xRobin 0xRobin added ready-for-review this PR development is complete, please review dbt: dex covers the DEX dbt subproject labels Dec 10, 2024
Copy link
Collaborator

@Hosuke Hosuke left a comment

Choose a reason for hiding this comment

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

Filter version does not match the seed version, we may need to remove the filter in this case.

Comment on lines 588 to 589
filter:
version: 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
filter:
version: 2

@Hosuke Hosuke self-assigned this Dec 10, 2024
@Hosuke Hosuke added in review Assignee is currently reviewing the PR and removed ready-for-review this PR development is complete, please review labels Dec 10, 2024
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['block_date', 'blockchain', 'project', 'version', 'tx_hash', 'evt_index']
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
unique_key = ['block_date', 'blockchain', 'project', 'version', 'tx_hash', 'evt_index']
unique_key = ['tx_hash', 'evt_index']

@jeff-dude jeff-dude added the WIP work in progress label Dec 17, 2024
Comment on lines +204 to +206
- name: swapline_base
tables:
- name: SwaplinePair_evt_Swap
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- name: swapline_base
tables:
- name: SwaplinePair_evt_Swap
- name: swapline_base
tables:
- name: SwaplinePair_evt_Swap
- name: LBPair_evt_Swap
- name: LBFactory_evt_LBPairCreated

Comment on lines +11 to +30
WITH token_swaps AS (
SELECT
evt_block_number AS block_number,
CAST(evt_block_time AS timestamp(3) with time zone) AS block_time,
evt_tx_from AS maker,
evt_tx_to AS taker,
amount0In AS token_sold_amount_raw,
amount0Out AS token_bought_amount_raw,
sender AS token_sold_address,
to AS token_bought_address,
contract_address AS project_contract_address,
evt_tx_hash AS tx_hash,
evt_index AS evt_index
FROM
{{ source('swapline_base', 'SwaplinePair_evt_Swap') }}
{% if is_incremental() %}
WHERE
{{ incremental_predicate('evt_block_time') }}
{% endif %}
)
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 need to apply uniswap_compatible_v2_trades macro here with LBFactory_evt_LBPairCreated table to produce dex.trades.

@Hosuke Hosuke removed the in review Assignee is currently reviewing the PR label Dec 30, 2024
@jeff-dude
Copy link
Member

closing due to inactivity

@jeff-dude jeff-dude closed this Jan 23, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2025
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 WIP work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants