Skip to content

Commit

Permalink
Utilize usdcSize Input instead of orderPayload price * size (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredvu authored May 24, 2024
1 parent 12b0d51 commit ab4a7ce
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ab4a7ce

Please sign in to comment.