-
Notifications
You must be signed in to change notification settings - Fork 17
Conversation
Signed-off-by: Philipp Hoenisch <[email protected]>
Signed-off-by: Philipp Hoenisch <[email protected]>
Signed-off-by: Philipp Hoenisch <[email protected]>
@bonomat would you mind creating a branch that branches from |
.get(&(cfd.contract_symbol(), cfd.position().counter_position())) | ||
.context("Cannot propose settlement without price")?; | ||
|
||
if !offer.is_safe_to_take(OffsetDateTime::now_utc()) { |
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.
Given the frequent protocol failures the user might see some annoyance of "outdated offer" here when triggering collab settlement. This is unrelated to this fix, nothing to change here, but I wanted to point it out :)
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.
The timeout is currently set to 10 minutes . That's plenty of time to hopefully get an offer :D
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.
But that would mean that the only thing that protects us from using an outdated price is the automation's logic of "what is acceptable" as price. Is this fixing the problem of using an outdated price? Is the problem not that the price in the automation is potentially not up to date?
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.
That should be fine. The taker simply proposes the latest price what he got from the maker in here. The logic whether to accept or decline this price is outside of this scope.
We simply spare the roundtrip and potentially protect the user by sending a settlement request with an outdated price.
|
||
let cfd = self.db.load_open_cfd::<Cfd>(order_id, ()).await?; | ||
|
||
let proposal_closing_price = market_closing_price(bid, ask, Role::Taker, cfd.position()); |
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 should remove the function market_closing_price
and also use the maker's price in the projection - otherwise what we show in the UI does not match what is actually used!
done :) |
Signed-off-by: Philipp Hoenisch <[email protected]>
Signed-off-by: Philipp Hoenisch <[email protected]>
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 think we can actually remove the model::market_closing_price
- I think the now replaced usage in projection
should have been the last usage of that function or did I miss something?
This project is unmaintained now. |
The taker will market close his position.
Resolves #2924
Note: this patch should go against 0.7.0 and can be released as a patch release from there.