Skip to content

Commit

Permalink
detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredvu committed Jun 14, 2024
1 parent 7ac7ce6 commit 8c3aaaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package exchange.dydx.abacus.calculator

import abs
import exchange.dydx.abacus.protocols.ParserProtocol
import exchange.dydx.abacus.utils.MAX_LEVERAGE_BUFFER_PERCENT
import exchange.dydx.abacus.utils.MAX_SUBACCOUNT_NUMBER
import exchange.dydx.abacus.utils.NUM_PARENT_SUBACCOUNTS
import kollections.iListOf
Expand Down Expand Up @@ -255,7 +256,7 @@ internal object MarginModeCalculator {

// Cap targetLeverage to 98% of max leverage
val adjustedTargetLeverage = if (maxLeverageForMarket != null) {
val cappedLeverage = maxLeverageForMarket * 0.98
val cappedLeverage = maxLeverageForMarket * MAX_LEVERAGE_BUFFER_PERCENT
if (targetLeverage > cappedLeverage) {
cappedLeverage
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ internal const val MAX_SUBACCOUNT_NUMBER = 128_000

// Short Term Order Duration (Blocks) to add to GTB
internal const val SHORT_TERM_ORDER_DURATION = 10

internal const val QUANTUM_MULTIPLIER = 1_000_000

// Route Param Constants
internal const val SLIPPAGE_PERCENT = "1"

// Isolated Margin Constants
internal const val MAX_LEVERAGE_BUFFER_PERCENT = 0.98

0 comments on commit 8c3aaaa

Please sign in to comment.