Skip to content

Commit

Permalink
Utilize usdcSize instead of price * size
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredvu committed May 24, 2024
1 parent 12b0d51 commit 6e4db3e
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 6e4db3e

Please sign in to comment.