-
Notifications
You must be signed in to change notification settings - Fork 82
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
Store price improvement fee #2470
Conversation
Reminder: Please update the DB Readme. Caused by: |
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.
Code looks good (except that this Row
struct is becoming huge and not local to this component)
Closes task 6 of the #2287
I think it's task 5 as of right now (but it might change). From a project management perspective I think it would be better to create issues for each of the items in the overarching task. This would also give us a better overview of how much work is left and how our velocity is going in the Kanban board.
anyhow::anyhow, | ||
bigdecimal::BigDecimal, | ||
number::conversions::{big_decimal_to_u256, u256_to_big_decimal}, | ||
}; | ||
|
||
#[derive(Debug, Clone, PartialEq, sqlx::FromRow)] | ||
pub struct FeePolicy { |
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.
Can we make this struct private and have insert_batch
take the domain representation of fee_policy? This way we can keep this pretty horrendous type local to this module.
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.
Refactored, but not sure if it's possible to make it private since it is used in the outer mod.
ADD COLUMN price_improvement_factor double precision, | ||
ADD COLUMN price_improvement_max_volume_factor double precision, |
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 data model still seems super sketchy to me. Unfortunately I don't really know how to make it better.
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.
We could move to JSONB to avoid column growth.
impl From<FeePolicy> for domain::fee::Policy { | ||
fn from(row: FeePolicy) -> domain::fee::Policy { | ||
match row.kind { | ||
#[allow(dead_code)] |
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.
Why is this dead code now? Can we remove?
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.
It was never used. Removed.
50c8bd0
to
506e9be
Compare
Description
Fixes #2478
Changes
max_volume_factor
column is renamed tosurplus_max_volume_factor
in order to align with the naming convention