-
Notifications
You must be signed in to change notification settings - Fork 3
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
An 5651/marinade ez swaps #760
base: main
Are you sure you want to change the base?
Conversation
{{ ref('defi__ez_dex_swaps') }} | ||
WHERE | ||
(swap_from_mint IN ('MNDEFzGvMt87ueuHvVU9VcTqsAP5b3fTGPsHuuPA5ey', 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So') OR swap_to_mint IN ('MNDEFzGvMt87ueuHvVU9VcTqsAP5b3fTGPsHuuPA5ey', 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So')) | ||
AND tx_id NOT IN (SELECT tx_id FROM swaps_jupiter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work if the swap is inside of the subset that is being loaded in the incremental. I think the logic needs to be revisited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is true. Would we use jupiter_inner to identify the ones that are part of a jupiter swap and exclude those
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a better approach but I am still concerned w/ some timing issues that would surface jupiter inner swaps in the single dex swaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated logic - attempting to get a 3hour buffer for the modified_timestamp in the fact_swaps_jupiter_summary
, and then use that block_range filter when selecting from the marinade_swaps
table so we always get the related swaps
table only containing MNDE and MSOL token swaps
created silver table with incremental on _inserted_timestamp for stand alone dex program swaps
in gold: filter out swaps that are routes in jupiter by using
index
, and union jupiter summary swapsfr on 2xl:
silver:
03:29:59 1 of 1 OK created sql incremental model silver.marinade_swaps .................. [SUCCESS 1 in 58.13s]
gold:
04:31:04 1 of 1 OK created sql incremental model marinade.ez_swaps ...................... [SUCCESS 1 in 125.89s]
test
silver:
03:36:11 Finished running 16 data tests, 7 project hooks in 0 hours 0 minutes and 53.79 seconds (53.79s). 03:36:11 03:36:11 Completed successfully 03:36:11 03:36:11 Done. PASS=16 WARN=0 ERROR=0 SKIP=0 TOTAL=16
gold:
4:33:48 Finished running 28 data tests, 7 project hooks in 0 hours 0 minutes and 59.77 seconds (59.77s). 04:33:48 04:33:48 Completed successfully 04:33:48 04:33:48 Done. PASS=28 WARN=0 ERROR=0 SKIP=0 TOTAL=28