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

Refactor amount_usd calculation in paraswap.trades #6216

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Hosuke
Copy link
Collaborator

@Hosuke Hosuke commented Jun 20, 2024

Linked issue: #6215

Thank you for contributing to Spellbook 🪄

Contribution type

Please check the type of contribution this pull request is for:

  • New spell(s)
  • Adding to existing spell lineage
  • Bug fix

Note: You can safely discard any section below which doesn't apply based on selection above


For new spell(s)

If you are building new spell(s), please provide the following information:

  • Spell name(s): schema.table_name
  • Description: [Detailed description of the new spell(s) and their purpose]
  • Who are the new spell(s) for? [Internal team or general community]
  • How will the new spell(s) be used downstream? [Description of downstream usage]
  • Implementation details: [Information on how the spell(s) are implemented]
  • Test instructions: [How to test the new spell(s)]
  • Related issue(s): [Link to related issues, if any]

For adding to existing spell lineage

If you are adding to an existing spell lineage, please provide the following information:

  • Description: [Description of the changes made]

For bug fixes

If you are fixing a bug, please provide the following information:

  • Description: [Description of the bug fix]
  • Steps to reproduce: [How to reproduce the bug]
  • Implementation details: [Information on how the bug was fixed]
  • Test instructions: [How to test the fix]
  • Related issue(s): [Link to related issues, if any]

Additional information

Please provide any additional information that might help us review your pull request:

  • [Any additional information]

Thank you for your contribution!

@Hosuke
Copy link
Collaborator Author

Hosuke commented Jun 20, 2024

Currently I keep avalanche_c implementation untouched.

Comment on lines 65 to 70
-- USDC.e AND USDT.e price are missing before 2022-10
price_missed_previous AS (
WITH usdc_price AS (
SELECT minute, contract_address, decimals, symbol, price
FROM {{ source('prices', 'usd') }}
WHERE contract_address = 0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664 -- USDC.e
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Hosuke Hosuke added ready-for-review this PR development is complete, please review dex labels Jun 21, 2024
@Hosuke
Copy link
Collaborator Author

Hosuke commented Jun 21, 2024

Should we keep the post_hook in sub spells?

Comment on lines 10 to 13
post_hook='{{ expose_spells(blockchains = \'["arbitrum"]\',
spell_type = "project",
spell_name = "paraswap_v5",
contributors = \'["springzhang"]\') }}'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @jeff-dude,
should I remove the post_hook in blockchain-version-level spells?

@@ -19,39 +19,72 @@ ref('paraswap_avalanche_c_trades')
,ref('paraswap_base_trades')
] %}

WITH basic_trades AS (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @jeff-dude,
should I use basic_trades or simply trades here for the CTE naming?
As I may add similar CTE across the spells, so I think we may have an unified naming standard.

@Hosuke
Copy link
Collaborator Author

Hosuke commented Aug 6, 2024

Updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dex ready-for-review this PR development is complete, please review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant