Closed viniabussafi closed 3 weeks ago
Working on a PR
Status update on this: We're unsure whether to move on with this PR or not. It passes the tests, but the results may be different from what's expected:
hey, @jeff-dude!
Tests should pass now, but I'm still a bit unsure regarding the implementation of incremental models and how it would affect spells that rely on rolling sums of token balances, which is the case of the liquidity spell. In a gross demonstration, considering a specific pool and an incremental refresh interval of 3 days
what should happen: spell merged today day 1 - 100k in - tvl = 100k day 2 - 50k out - tvl = 50k day 3 - 50k in - tvl = 100k day 4 - 100k in - tvl = 200k
what I'm afraid will happen: spell runs incrementally tomorrow day 2 - 50k out - tvl = -50k day 3 - 50k in - tvl = 0k day 4 - 100k in - tvl = 100k day 5 - 50k out - tvl = 50k
Am I correct in my assumption? If so, how are incremental runs of balances spells dealt with at the moment?
Going to put this on hold while we have some extra thought on that matter
👀 for reference: https://github.com/duneanalytics/spellbook/pull/5980#discussion_r1619402803
If that's the case: https://github.com/duneanalytics/spellbook/discussions/6037#discussion-6753023, making this change won't be useful
Moving forward, all spells outside of the main sub-projects will run on a daily cadence. No changes need to be made to materialization type, rather the orchestration logic will change to make it work.
Will close this one and maybe reopen in the future, based on the comment above
I had some issues with incremental runs of a few spells on the past, such as protocol fees (see this and this). I will try to address this issue again by tackling multiple spells at once (liquidity, bpt prices, bpt supply and protocol fees).
With that, spells would be refreshed hourly, instead of daily