-
Notifications
You must be signed in to change notification settings - Fork 15
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
Update stop market order liquidity warning + params #313
Update stop market order liquidity warning + params #313
Conversation
src/commonMain/kotlin/exchange.dydx.abacus/calculator/TradeInputCalculator.kt
Outdated
Show resolved
Hide resolved
"code": "STOP_MARKET_ORDER_MAY_NOT_EXECUTE" | ||
} | ||
] | ||
"errors": null |
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.
[q] is this supposed to be an unhappy path test? if so should we change the test input params to ensure this still throws an error?
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.
eh it wasn't really an unhappy path - it was just a warning (non blocking for a user; errors are blocking) that we ripped out. I think I'm fine leaving it like this for now; we could add a test for SELL_TRIGGER_TOO_CLOSE_TO_LIQUIDATION_PRICE
but I didn't touch that logic (and the mock data doesn't currently have a liquidation price) so inclined to leave it like this for now!
As per product, update stop market slippages from:
For cleanliness, updated constants to be shared between
TriggerOrdersInputCalculator
andTradeInputCalculator
; removed unusedMARKET_ORDER_SLIPPAGE_WARNING_THRESHOLD
.Also remove
STOP_MARKET_ORDER_MAY_NOT_EXECUTE
warning prompting users to use stop limit orders.