diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt index 20581a270..63bef5cf2 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt @@ -564,10 +564,8 @@ internal class SubaccountSupervisor( // Derive transfer params from trade input val targetLeverage = trade?.targetLeverage ?: error("targetLeverage is null") - val size = orderPayload.size - val price = orderPayload.price - val notionalUsdc = price * size - val amountToTransfer = (notionalUsdc / targetLeverage).toString() + val usdcSize = trade.size?.usdcSize ?: error("usdcSize is null") + val amountToTransfer = (usdcSize / targetLeverage).toString() val childSubaccountNumber = orderPayload.subaccountNumber val transferPayload = HumanReadableSubaccountTransferPayload(