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

allow for a charting entrypoint #675

Open
thedavidmeister opened this issue Jun 6, 2024 · 2 comments · May be fixed by #911
Open

allow for a charting entrypoint #675

thedavidmeister opened this issue Jun 6, 2024 · 2 comments · May be fixed by #911
Assignees

Comments

@thedavidmeister
Copy link
Contributor

thedavidmeister commented Jun 6, 2024

problem

we have an awkward situation where we want to plot things that aren't necessarily relevant to the final prod output

for example, we might want to plot some derived value like x/y that is helpful to visualise but doesn't feed into the final amount/ratio

another example would be wanting to plot things against block timestamp, where the timestamp doesn't actually change the outputs

adding a bunch of extra calculations to the strat just for visualisations makes things complex and fragile because it means we're messing with the core strat logic every time we want to visualise some data, and it also adds gas to the final onchain deployment

https://github.com/rainlanguage/rain.dex.pubstrats/pull/54/files#diff-7e652b6de7bb90e6db187e5017c972873c2d1920750b9791e5f65aff81e787b6R555 is an example of this happening, we have to jump through quote rebinding hoops just to build a basic dashboard

solution

allow for a new #chart-data binding convention that is used as a third entrypoint alongside #calculate-io and #handle-io while simulating, but is not included in the rainlang upon deployment onchain

if the chart data binding wants to plot things from calculate-io or handle-io it can by using e.g. call<'calculate-io>() and pulling as many items off the stack as it wants

this basically inverts the pattern of having the chart data need to be called from inside calculate-io, and rather makes the charting data into a wrapper that calls into calculate/handle as needed and then derives additional chartable information

@thedavidmeister thedavidmeister changed the title allow for a charting endpoint allow for a charting entrypoint Jun 6, 2024
@hardyjosh
Copy link
Contributor

@thedavidmeister should we just allow for optional entrypoint to be defined for a scenario - so it doesn't have to be #chart-data?

then we can disallow deployments that use a scenario with a custom entrypoint.

@thedavidmeister
Copy link
Contributor Author

@thedavidmeister should we just allow for optional entrypoint to be defined for a scenario - so it doesn't have to be #chart-data?

then we can disallow deployments that use a scenario with a custom entrypoint.

yeah that makes sense to me

@hardyjosh hardyjosh self-assigned this Jul 5, 2024
@hardyjosh hardyjosh assigned rouzwelt and unassigned hardyjosh Sep 1, 2024
@hardyjosh hardyjosh assigned findolor and unassigned rouzwelt Sep 12, 2024
@findolor findolor linked a pull request Sep 30, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants