From 1dbd98e19482956efab1aedbc41afa612e7c2fa1 Mon Sep 17 00:00:00 2001 From: Myroslav Sviderok Date: Mon, 16 Dec 2024 10:08:59 +0200 Subject: [PATCH] add explanation comment to balance management --- src/earn/EarnEnterAmount.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/earn/EarnEnterAmount.tsx b/src/earn/EarnEnterAmount.tsx index 721ed25ffdb..8b4226926b7 100644 --- a/src/earn/EarnEnterAmount.tsx +++ b/src/earn/EarnEnterAmount.tsx @@ -112,7 +112,12 @@ export default function EarnEnterAmount({ route }: Props) { } }, [mode]) - // Use different balance for the withdrawal flow. + /** + * Use different balance for the withdrawal flow. As described in this discussion + * (https://github.com/valora-inc/wallet/pull/6246#discussion_r1883426564) the intent of this + * is to abstract away the LP token from the user and just display the token they're depositing, + * so we need to convert the LP token balance to deposit and back to LP token when transacting." + */ const [inputToken, setInputToken] = useState(() => ({ ...availableInputTokens[0], balance: isWithdrawal