Skip to content

Commit

Permalink
Refactor omni stop loss level calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinciarka committed Mar 26, 2024
1 parent d70e01f commit 38870ec
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,17 @@ export const useOmniStopLossDataHandler = () => {
getDynamicStopLossPrice({
liquidationPrice,
liquidationRatio,
stopLossLevel: one.div(stopLossLevel.div(100)).times(100),
stopLossLevel: isShort ? one.div(stopLossLevel) : one.div(stopLossLevel.div(100)).times(100),
})

const afterDynamicStopLossPrice =
resolvedAfterStopLossLevel &&
getDynamicStopLossPrice({
liquidationPrice,
liquidationRatio,
stopLossLevel: one.div(resolvedAfterStopLossLevel.div(100)).times(100),
stopLossLevel: isShort
? one.div(resolvedAfterStopLossLevel)
: one.div(resolvedAfterStopLossLevel.div(100)).times(100),
})

const resolvedAfterDynamicStopLossPrice =
Expand Down

0 comments on commit 38870ec

Please sign in to comment.