Skip to content

Commit

Permalink
remove tier id
Browse files Browse the repository at this point in the history
  • Loading branch information
aforaleka committed May 28, 2024
1 parent c9e59ca commit 72e2f32
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/commonMain/kotlin/exchange.dydx.abacus/output/Configs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,14 @@ data class EquityTiers(
parser.asMap(item)?.let {
val tier = existing?.getOrNull(i)
val nextTierData = parser.asMap(nextItem)
EquityTier.create(tier, parser, it, i + 1, nextTierData)?.let { equityTier ->
EquityTier.create(tier, parser, it, nextTierData)?.let { equityTier ->
equityTiers.add(equityTier)
}
}
}
return equityTiers
}
Logger.d { "Equity Tiers values not valid" }
Logger.d { "Equity Tiers not valid" }
return null
}
}
Expand All @@ -306,7 +306,6 @@ data class EquityTiers(
@JsExport
@Serializable
data class EquityTier(
val tierId: Int,
val requiredTotalNetCollateralUSD: Double,
val nextLevelRequiredTotalNetCollateralUSD: Double?,
val maxOrders: Int,
Expand All @@ -316,7 +315,6 @@ data class EquityTier(
existing: EquityTier?,
parser: ParserProtocol,
data: Map<*, *>?,
tierId: Int,
nextTierData: Map<*, *>?
): EquityTier? {
data?.let {
Expand All @@ -327,13 +325,12 @@ data class EquityTier(
val maxOrders = parser.asInt(data["maxOrders"])

if (requiredTotalNetCollateralUSD != null && maxOrders != null) {
return if (existing?.tierId != tierId ||
return if (
existing?.requiredTotalNetCollateralUSD != requiredTotalNetCollateralUSD ||
existing?.nextLevelRequiredTotalNetCollateralUSD != nextLevelRequiredTotalNetCollateralUSD ||
existing?.maxOrders != maxOrders
) {
EquityTier(
tierId,
requiredTotalNetCollateralUSD,
nextLevelRequiredTotalNetCollateralUSD,
maxOrders,
Expand Down

0 comments on commit 72e2f32

Please sign in to comment.