-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add flag to skip slippage computations #407
Conversation
I only glanced over the changes and they look reasonable. Is the changed code part of any test? Or is there a simple way to manually test this change? |
Not yet. I pushed a change in order to make existing tests pass. I will add some test so that we can confirm the flag works as expected. |
reward_target_reduced_df_columns = [ | ||
x for x in list(reward_target_df.columns) if x != "solver_name" | ||
] | ||
reward_target_reduced_df = reward_target_df[reward_target_reduced_df_columns] | ||
service_fee_reduced_df_columns = [ | ||
x for x in list(service_fee_df.columns) if x != "solver_name" | ||
] | ||
service_fee_reduced_df = service_fee_df[service_fee_reduced_df_columns] |
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.
I suppose that we are not really interested in the fully general approach. Then this would work:
reward_target_reduced_df_columns = [ | |
x for x in list(reward_target_df.columns) if x != "solver_name" | |
] | |
reward_target_reduced_df = reward_target_df[reward_target_reduced_df_columns] | |
service_fee_reduced_df_columns = [ | |
x for x in list(service_fee_df.columns) if x != "solver_name" | |
] | |
service_fee_reduced_df = service_fee_df[service_fee_reduced_df_columns] | |
reward_target_reduced_df = reward_target_df.drop("solver_name", axis=1) | |
service_fee_reduced_df = service_fee_df.drop("solver_name", axis=1) |
If we actually want that generality, this and other data transformations should probably happen somewhere else. E.g. right after fetching the data.
Following up on this, I am not sure how easy it would be to add clean tests for this, so don't know how soon i will address this. This is also meant for local testing so I would say this is not urgent so let's leave this PR open until i address the testing part |
Not merging this might complicate other things like deploying on arbitrum. |
There are some issues when i did some local testing today and will try to figure out what is going on. I saw this alert |
This error is probably due to the fact that the dummy slippage data frame does not have the required columns. Thus the check in The dataframe |
This PR adds a flag to completely skip slippage calculations, if they are not needed.