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

fix: Store matching fee and trader pnl into trade params #2487

Merged

Conversation

holzeis
Copy link
Contributor

@holzeis holzeis commented Apr 26, 2024

fixes #2484

@holzeis holzeis self-assigned this Apr 26, 2024
@holzeis holzeis merged commit 95f0d28 into main Apr 26, 2024
23 checks passed
@holzeis holzeis deleted the fix/save-order-matching-fee-and-trader-pnl-to-trade-params branch April 26, 2024 09:35
@@ -42,6 +42,8 @@ pub(crate) fn insert(
trade_params::trader_pubkey.eq(params.trader.to_string()),
trade_params::direction.eq(Direction::from(params.direction)),
trade_params::average_price.eq(params.average_price),
trade_params::matching_fee.eq(params.matching_fee.to_sat() as i64),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I think this was my fault.

We should destructure the TradeParams so that the compiler can complain when a new field is missing or not used

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 this pull request may close these issues.

Trader realized pnl is not updated on the trade when resizing a position
2 participants