Skip to content

Commit

Permalink
automatically set range for full range/auto settings
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-d committed Jun 13, 2024
1 parent d68092f commit 47ff973
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions web/src/components/StakeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export const StakeForm = ({ mode, poolId, positionId }: StakeFormProps) => {
setToken1AmountRaw,
priceLower,
priceUpper,
tickLower,
priceLowerRaw,
setPriceLower,
setPriceUpper,
} = useStakeStore();
Expand Down Expand Up @@ -134,6 +136,21 @@ export const StakeForm = ({ mode, poolId, positionId }: StakeFormProps) => {
"full-range" | "auto" | "custom"
>("full-range");

useEffect(() => {
if (liquidityRangeType === "full-range") {
// TODO set to price of min/max tick
setPriceLower("-100")
setPriceLower("100")
}
else if (liquidityRangeType === "auto") {
// TODO determine auto price
setPriceLower("-100")
setPriceLower("100")
} else {

}
}, [liquidityRangeType])

// Price of the current pool
const { data: poolSqrtPriceX96 } = useSimulateContract({
address: ammAddress,
Expand Down

0 comments on commit 47ff973

Please sign in to comment.