diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/output/input/TradeInput.kt b/src/commonMain/kotlin/exchange.dydx.abacus/output/input/TradeInput.kt index 5dc8dff60..2faf9496e 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/output/input/TradeInput.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/output/input/TradeInput.kt @@ -783,6 +783,11 @@ enum class OrderSide(val rawValue: String) { Buy("BUY"), Sell("SELL"); + fun opposite() = when (this) { + Buy -> Sell + Sell -> Buy + } + companion object { operator fun invoke(rawValue: String?) = OrderSide.values().firstOrNull { it.rawValue == rawValue } diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/notification/providers/FillsNotificationProvider.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/notification/providers/FillsNotificationProvider.kt index aa1b663d4..5ee66d4f8 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/notification/providers/FillsNotificationProvider.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/notification/providers/FillsNotificationProvider.kt @@ -156,8 +156,11 @@ class FillsNotificationProvider( val asset = stateMachine.state?.assetOfMarket(marketId) ?: return null val assetText = asset.name val marketImageUrl = asset.resources?.imageUrl - val side = fill.side.rawValue + + // opposite because these notifications are all about positions, not the fill that triggered the notif. + val side = fill.side.opposite().rawValue val sideText = uiImplementations.localizer?.localize("APP.GENERAL.$side") + val amountText = parser.asString(fill.size) val priceText = parser.asString(fill.price) val fillType = fill.type.rawValue