From 3898ec95ede09a2b3fa599ff08bda3f96a2f0b9b Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Fri, 10 Jun 2022 09:12:44 -0700 Subject: [PATCH] Tweak interface --- web/pages/swap.tsx | 53 +++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/web/pages/swap.tsx b/web/pages/swap.tsx index 7d99e546..3bc54a49 100644 --- a/web/pages/swap.tsx +++ b/web/pages/swap.tsx @@ -150,13 +150,14 @@ export default function Swap() { const [minTick, setMinTick] = useState(0) const [maxTick, setMaxTick] = useState(0) + const [deltaL, setDeltaL] = useState(100) const [buyAmount, setBuyAmount] = useState(0) const { requiredN, requiredY } = calculateLPCost( pool.tick, minTick, maxTick, - 100 // deltaL + deltaL ) const { newPoolTick, yesPurchased } = buyYes(pool, buyAmount) @@ -182,25 +183,34 @@ export default function Swap() { /> - Alice: Add liquidity +

Add liquidity

{/* */} - setMinTick(inputPercentToTick(e))} - /> - Min Tick: {minTick} - setMaxTick(inputPercentToTick(e))} - /> - Max Tick: {maxTick} + + setMinTick(inputPercentToTick(e))} + /> + {/* Min Tick: {minTick} */} + setMaxTick(inputPercentToTick(e))} + /> + {/* Max Tick: {maxTick} */} + setDeltaL(parseFloat(e.target.value))} + /> + -
Y required: {requiredY}
-
N required: {requiredN}
{' '} +
Y required: {requiredY.toFixed(2)}
+
N required: {requiredN.toFixed(2)}
{' '}