From a345afd53dfa60d453840b10bc36c5ede4dbb258 Mon Sep 17 00:00:00 2001 From: Mihai Date: Thu, 6 Feb 2025 20:53:50 -0500 Subject: [PATCH 1/3] increase short padding to 2% from 1% --- .../src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx index 8b67e9d42..fb9aaf3b0 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx @@ -173,7 +173,7 @@ export function OpenShortForm({ amount: traderDeposit || 0n, decimals: activeToken.decimals, direction: "up", - percentage: 1n, + percentage: 2n, }); const hasEnoughAllowance = getHasEnoughAllowance({ allowance: activeTokenAllowance, From 794bb16dfdb5be869be901aa595406f2d9bf7afc Mon Sep 17 00:00:00 2001 From: MazyGio Date: Fri, 7 Feb 2025 00:16:04 -0500 Subject: [PATCH 2/3] decrease short allowance padding back to 1. fix padding math --- .../src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx index fb9aaf3b0..8c5ab803e 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx @@ -173,7 +173,7 @@ export function OpenShortForm({ amount: traderDeposit || 0n, decimals: activeToken.decimals, direction: "up", - percentage: 2n, + percentage: fixed(10n).pow(activeToken.decimals).bigint * 1n, }); const hasEnoughAllowance = getHasEnoughAllowance({ allowance: activeTokenAllowance, From 349ab3dac3e57f6532f9db72c80e700037437a8b Mon Sep 17 00:00:00 2001 From: MazyGio Date: Fri, 7 Feb 2025 11:07:32 -0500 Subject: [PATCH 3/3] remove unnecessary multiplication --- .../src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx index 8c5ab803e..412a299c9 100644 --- a/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx +++ b/apps/hyperdrive-trading/src/ui/hyperdrive/shorts/OpenShortForm/OpenShortForm.tsx @@ -173,7 +173,7 @@ export function OpenShortForm({ amount: traderDeposit || 0n, decimals: activeToken.decimals, direction: "up", - percentage: fixed(10n).pow(activeToken.decimals).bigint * 1n, + percentage: fixed(10n).pow(activeToken.decimals).bigint, }); const hasEnoughAllowance = getHasEnoughAllowance({ allowance: activeTokenAllowance,