-
Notifications
You must be signed in to change notification settings - Fork 1
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(LT-5061): let special liquidation fail #460
fix(LT-5061): let special liquidation fail #460
Conversation
We'll let special liquidation fail if there were no price provided upon RFQ. The price request retry will happen on a later steps after checking liquidity.
…dationFailedEvent
…ated so, to modify and save it again we have to request it again from database to get latest LastModified value
c88b119
to
5a402af
Compare
configuration: _marginTradingSettings.SpecialLiquidation); | ||
|
||
var nextState = GetNextState(nextAction); | ||
if (!await TrySaveState(executionInfo, nextState)) |
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.
What happens here if the operation is paused? The event is handled and then manual action from a support is required?
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 state will not be affected and saga freezes in the current state. Then manual action is required from support side to "unpause" it.
sender.SendCommand(new CancelSpecialLiquidationCommand | ||
{ | ||
OperationId = liquidationId, | ||
Reason = "Liquidity is enough to close positions within regular flow" |
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.
Name of the method does not indicate that the cancellation is related to liquidity. I suggest to rename the method or add reason as a parameter
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.
Noted
/// <typeparam name="TEvent"></typeparam> | ||
/// <returns></returns> | ||
/// <exception cref="KeyNotFoundException">When no handler found</exception> | ||
public static ISagaEventHandler<TEvent> First<TEvent>( |
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.
If there's only one instance of ISagaEventHandler in handlers, I suggest to rename the method to "Get"
"First" is a bit confusing because it implies that there might be multiple handlers, and we want to receive a random / first registered one.
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.
Indeed we want to get the first one.
I explicitly wanted to get the first to make it clear later if we ever have multiple handlers. Otherwise, if we use "Get" it is not clear what happens in case of multiple handlers.
|
We'll let special liquidation fail if there were no price provided upon RFQ. The price request retry will happen on a later steps after checking liquidity.