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

lido liquidity updates #6033

Merged
merged 18 commits into from
Jun 11, 2024
Merged

Conversation

ppclunghe
Copy link
Contributor

@ppclunghe ppclunghe commented May 30, 2024

Adding new wstETH pools to Lido liquidity spell, update for Uniswap wstETH pools spell on Base

@dune-eng
Copy link

Workflow run id 9299895516 approved.

@dune-eng
Copy link

Workflow run id 9299895747 approved.

@dune-eng
Copy link

Workflow run id 9300083408 approved.

@dune-eng
Copy link

Workflow run id 9300083604 approved.

@dune-eng
Copy link

Workflow run id 9302723579 approved.

@dune-eng
Copy link

Workflow run id 9302723858 approved.

@dune-eng
Copy link

Workflow run id 9303700350 approved.

@dune-eng
Copy link

Workflow run id 9303700450 approved.

@dune-eng
Copy link

Workflow run id 9304014045 approved.

@dune-eng
Copy link

Workflow run id 9304014509 approved.

@dune-eng
Copy link

Workflow run id 9304558124 approved.

@dune-eng
Copy link

Workflow run id 9304557874 approved.

@dune-eng
Copy link

Workflow run id 9305697366 approved.

@dune-eng
Copy link

Workflow run id 9305697616 approved.

@dune-eng
Copy link

Workflow run id 9306048671 approved.

@dune-eng
Copy link

Workflow run id 9306048835 approved.

@dune-eng
Copy link

Workflow run id 9315992299 approved.

@dune-eng
Copy link

Workflow run id 9315992662 approved.

@dune-eng
Copy link

Workflow run id 9316220259 approved.

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.

Hi @ppclunghe,

we can apply the new format for post_hooks in this PR.

Also I think we may use || to replace concat to shorten the long line.

Comment on lines 8 to 11
post_hook='{{ expose_spells(\'["base"]\',
"project",
"lido_liquidity",
\'["pipistrella"]\') }}'
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
post_hook='{{ expose_spells(\'["base"]\',
"project",
"lido_liquidity",
\'["pipistrella"]\') }}'
post_hook='{{ expose_spells(blockchains = \'["base"]\',
spell_type = "project",
spell_name = "lido_liquidity",
contributors = \'["pipistrella"]\') }}'

{% if not is_incremental() %}
WHERE DATE_TRUNC('day', s.evt_block_time) >= DATE '{{ project_start_date }}'
{% else %}
WHERE DATE_TRUNC('day', s.evt_block_time) >= DATE_TRUNC('day', NOW() - INTERVAL '1' day)
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 use incremental predicate for incremental filters:

Suggested change
WHERE DATE_TRUNC('day', s.evt_block_time) >= DATE_TRUNC('day', NOW() - INTERVAL '1' day)
WHERE {{ incremental_predicate('s.evt_block_time') }}

)


select CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(blockchain,CONCAT(' ', project)) ,' '), coalesce(paired_token_symbol,'unknown')),':') , main_token_symbol, ' ', pool_type, ' ', format('%,.3f',round(coalesce(fee,0),4))) as pool_name,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure concat can be replaced by || here.

Comment on lines 8 to 11
post_hook='{{ expose_spells(\'["scroll"]\',
"project",
"lido_liquidity",
\'["pipistrella"]\') }}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above post_hook.

Comment on lines 8 to 11
post_hook='{{ expose_spells(\'["scroll"]\',
"project",
"lido_liquidity",
\'["pipistrella"]\') }}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot for your review, @Hosuke
I have updated code according to your comments

@Hosuke Hosuke added in review Assignee is currently reviewing the PR and removed ready-for-review this PR development is complete, please review labels Jun 3, 2024
@dune-eng
Copy link

dune-eng commented Jun 5, 2024

Workflow run id 9387920600 approved.

@dune-eng
Copy link

dune-eng commented Jun 5, 2024

Workflow run id 9387920945 approved.

@dune-eng
Copy link

dune-eng commented Jun 5, 2024

Workflow run id 9389266383 approved.

@dune-eng
Copy link

dune-eng commented Jun 5, 2024

Workflow run id 9389266254 approved.

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.

LGTM.✅
Thank you @ppclunghe

Sample lido.liquidity

@Hosuke Hosuke added ready-for-final-review and removed in review Assignee is currently reviewing the PR labels Jun 7, 2024
@dune-eng
Copy link

Workflow run id 9447607654 approved.

@dune-eng
Copy link

Workflow run id 9447607884 approved.

@ppclunghe
Copy link
Contributor Author

ppclunghe commented Jun 10, 2024

I have added a all fix for SyncSwap wstETH pools on zksync, sorry for it, all comments from @Hosuke were taken into account for this fix

@dune-eng
Copy link

Workflow run id 9448574961 approved.

@dune-eng
Copy link

Workflow run id 9448575259 approved.

@@ -63,7 +63,7 @@ with
{% if not is_incremental() %}
WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}'
{% else %}
WHERE DATE_TRUNC('day', p.minute) >= DATE_TRUNC('day', NOW() - INTERVAL '1' day)
WHERE {{ incremental_predicate('p.minute') }}
Copy link
Member

Choose a reason for hiding this comment

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

similar to the changes made here to use incremental predicate on source reads, we also leverage them for filtering the target data. this allows the generated merge statement to filter both to same time period and speed up processing. i won't consider a blocker for now, but it'd be nice to see a follow up PR soon that implements on all lido models. looks like this:
https://github.com/duneanalytics/spellbook/blob/main/models/_sector/dex/trades/arbitrum/platforms/airswap_arbitrum_base_trades.sql#L9

be sure the column name passed in matches target spell column name, sometimes it changes from source to target

@jeff-dude jeff-dude self-assigned this Jun 11, 2024
@jeff-dude jeff-dude merged commit 304c59d into duneanalytics:main Jun 11, 2024
2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants