ci(release): publish latest release

parent 65288f49
IPFS hash of the deployment: IPFS hash of the deployment:
- CIDv0: `QmcDLYNCmBY8GZivEGAw4fwyeT24YpT1FqttKTkcRFfivc` - CIDv0: `QmSR5NDYo4zoKKUQJ6fbr7QBw8VzMSYTPLCKWFrnEy3siH`
- CIDv1: `bafybeigoeqbd3sgqs3ry32353einpmrcuy5p45hutcmjp4qummebbwhw7e` - CIDv1: `bafybeib4sdzwnyzjkgip3tbxxpwp76goocrdu77z5cnshiitjqcpnv2pci`
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org). The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
...@@ -10,14 +10,14 @@ You can also access the Uniswap Interface from an IPFS gateway. ...@@ -10,14 +10,14 @@ You can also access the Uniswap Interface from an IPFS gateway.
Your Uniswap settings are never remembered across different URLs. Your Uniswap settings are never remembered across different URLs.
IPFS gateways: IPFS gateways:
- https://bafybeigoeqbd3sgqs3ry32353einpmrcuy5p45hutcmjp4qummebbwhw7e.ipfs.dweb.link/ - https://bafybeib4sdzwnyzjkgip3tbxxpwp76goocrdu77z5cnshiitjqcpnv2pci.ipfs.dweb.link/
- [ipfs://QmcDLYNCmBY8GZivEGAw4fwyeT24YpT1FqttKTkcRFfivc/](ipfs://QmcDLYNCmBY8GZivEGAw4fwyeT24YpT1FqttKTkcRFfivc/) - [ipfs://QmSR5NDYo4zoKKUQJ6fbr7QBw8VzMSYTPLCKWFrnEy3siH/](ipfs://QmSR5NDYo4zoKKUQJ6fbr7QBw8VzMSYTPLCKWFrnEy3siH/)
### 5.80.2 (2025-04-25) ### 5.80.3 (2025-04-25)
### Bug Fixes ### Bug Fixes
* **web:** reenable logging in statsig config (#18894) ae7ebce * **web:** prod hotfix v4 eth pair liq chart fix (#18899) bab7ea8
web/5.80.2 web/5.80.3
\ No newline at end of file \ No newline at end of file
import { BigNumber } from '@ethersproject/bignumber' import { BigNumber } from '@ethersproject/bignumber'
import { ProtocolVersion } from '@uniswap/client-pools/dist/pools/v1/types_pb' import { ProtocolVersion } from '@uniswap/client-pools/dist/pools/v1/types_pb'
import { CurrencyAmount, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
import { FeeAmount, Pool as PoolV3, TICK_SPACINGS, TickMath as TickMathV3, tickToPrice } from '@uniswap/v3-sdk' import { FeeAmount, Pool as PoolV3, TICK_SPACINGS, TickMath as TickMathV3, tickToPrice } from '@uniswap/v3-sdk'
import { Pool as PoolV4 } from '@uniswap/v4-sdk' import { Pool as PoolV4, tickToPrice as tickToPriceV4 } from '@uniswap/v4-sdk'
import { ChartHoverData, ChartModel, ChartModelParams } from 'components/Charts/ChartModel' import { ChartHoverData, ChartModel, ChartModelParams } from 'components/Charts/ChartModel'
import { LiquidityBarSeries } from 'components/Charts/LiquidityChart/liquidity-bar-series' import { LiquidityBarSeries } from 'components/Charts/LiquidityChart/liquidity-bar-series'
import { import {
...@@ -123,6 +123,7 @@ function maxAmount(token: Token) { ...@@ -123,6 +123,7 @@ function maxAmount(token: Token) {
} }
/** Calculates tokens locked in the active tick range based on the current tick */ /** Calculates tokens locked in the active tick range based on the current tick */
// TODO(WEB-7564): determine how to support v4
async function calculateActiveRangeTokensLocked( async function calculateActiveRangeTokensLocked(
token0: Token, token0: Token,
token1: Token, token1: Token,
...@@ -224,9 +225,10 @@ export async function calculateTokensLockedV3( ...@@ -224,9 +225,10 @@ export async function calculateTokensLockedV3(
} }
} }
// TODO(WEB-7564): determine if tick math needs to be converted to support v4
export async function calculateTokensLockedV4( export async function calculateTokensLockedV4(
token0: Token, token0: Currency,
token1: Token, token1: Currency,
feeTier: FeeAmount, feeTier: FeeAmount,
tickSpacing: number, tickSpacing: number,
hooks: string, hooks: string,
...@@ -278,8 +280,8 @@ export async function calculateTokensLockedV4( ...@@ -278,8 +280,8 @@ export async function calculateTokensLockedV4(
} }
export function useLiquidityBarData({ export function useLiquidityBarData({
tokenA, currencyA,
tokenB, currencyB,
feeTier, feeTier,
isReversed, isReversed,
chainId, chainId,
...@@ -288,8 +290,8 @@ export function useLiquidityBarData({ ...@@ -288,8 +290,8 @@ export function useLiquidityBarData({
hooks, hooks,
poolId, poolId,
}: { }: {
tokenA: Token currencyA: Currency
tokenB: Token currencyB: Currency
feeTier: FeeAmount feeTier: FeeAmount
isReversed: boolean isReversed: boolean
chainId: UniverseChainId chainId: UniverseChainId
...@@ -299,9 +301,15 @@ export function useLiquidityBarData({ ...@@ -299,9 +301,15 @@ export function useLiquidityBarData({
poolId?: string poolId?: string
}) { }) {
const { formatNumber, formatPrice } = useFormatter() const { formatNumber, formatPrice } = useFormatter()
// Determine the correct tokens to use based on the protocol version
// V3 requires tokens, V4 can handle native or tokens
const tokenAWrapped = currencyA.wrapped
const tokenBWrapped = currencyB.wrapped
const activePoolData = usePoolActiveLiquidity({ const activePoolData = usePoolActiveLiquidity({
currencyA: tokenA, currencyA,
currencyB: tokenB, currencyB,
feeAmount: feeTier, feeAmount: feeTier,
version, version,
poolId, poolId,
...@@ -341,15 +349,18 @@ export function useLiquidityBarData({ ...@@ -341,15 +349,18 @@ export function useLiquidityBarData({
activeRangeIndex = index activeRangeIndex = index
activeRangePercentage = (activePoolData.currentTick - t.tick) / TICK_SPACINGS[feeTier] activeRangePercentage = (activePoolData.currentTick - t.tick) / TICK_SPACINGS[feeTier]
price0 = tickToPrice(tokenA, tokenB, t.tick) price0 =
version === ProtocolVersion.V3
? tickToPrice(tokenAWrapped, tokenBWrapped, t.tick)
: tickToPriceV4(currencyA, currencyB, t.tick)
price1 = price0.invert() price1 = price0.invert()
} }
const { amount0Locked, amount1Locked } = await (version === ProtocolVersion.V3 const { amount0Locked, amount1Locked } = await (version === ProtocolVersion.V3
? calculateTokensLockedV3(tokenA, tokenB, feeTier, t) ? calculateTokensLockedV3(tokenAWrapped, tokenBWrapped, feeTier, t)
: calculateTokensLockedV4( : calculateTokensLockedV4(
tokenA, currencyA,
tokenB, currencyB,
feeTier, feeTier,
tickSpacing ?? TICK_SPACINGS[feeTier], tickSpacing ?? TICK_SPACINGS[feeTier],
hooks ?? ZERO_ADDRESS, hooks ?? ZERO_ADDRESS,
...@@ -379,8 +390,8 @@ export function useLiquidityBarData({ ...@@ -379,8 +390,8 @@ export function useLiquidityBarData({
// For active range, adjust amounts locked to adjust for where current tick/price is within the range // For active range, adjust amounts locked to adjust for where current tick/price is within the range
if (activeRangeIndex !== undefined && activeRangeData) { if (activeRangeIndex !== undefined && activeRangeData) {
const activeTickTvl = await calculateActiveRangeTokensLocked( const activeTickTvl = await calculateActiveRangeTokensLocked(
tokenA, tokenAWrapped,
tokenB, tokenBWrapped,
feeTier, feeTier,
ticksProcessed[activeRangeIndex], ticksProcessed[activeRangeIndex],
activePoolData, activePoolData,
...@@ -398,7 +409,20 @@ export function useLiquidityBarData({ ...@@ -398,7 +409,20 @@ export function useLiquidityBarData({
} }
formatData() formatData()
}, [activePoolData, tokenA, tokenB, formatNumber, formatPrice, isReversed, feeTier, version, tickSpacing, hooks]) }, [
activePoolData,
currencyA,
currencyB,
tokenAWrapped,
tokenBWrapped,
formatNumber,
formatPrice,
isReversed,
feeTier,
version,
tickSpacing,
hooks,
])
return { tickData, activeTick: activePoolData.activeTick, loading: activePoolData.isLoading || !tickData } return { tickData, activeTick: activePoolData.activeTick, loading: activePoolData.isLoading || !tickData }
} }
import { ProtocolVersion as RestProtocolVersion } from '@uniswap/client-pools/dist/pools/v1/types_pb' import { ProtocolVersion as RestProtocolVersion } from '@uniswap/client-pools/dist/pools/v1/types_pb'
import { CurrencyAmount, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
import { FeeAmount } from '@uniswap/v3-sdk' import { FeeAmount } from '@uniswap/v3-sdk'
import { ChartHeader } from 'components/Charts/ChartHeader' import { ChartHeader } from 'components/Charts/ChartHeader'
import { Chart, refitChartContentAtom } from 'components/Charts/ChartModel' import { Chart, refitChartContentAtom } from 'components/Charts/ChartModel'
...@@ -188,8 +188,9 @@ export default function ChartSection(props: ChartSectionProps) { ...@@ -188,8 +188,9 @@ export default function ChartSection(props: ChartSectionProps) {
} }
// TODO(WEB-3740): Integrate BE tick query, remove special casing for liquidity chart // TODO(WEB-3740): Integrate BE tick query, remove special casing for liquidity chart
// Pass currencyA/B to LiquidityChart to avoid wrapping native tokens for v4 pools
if (activeQuery.chartType === ChartType.LIQUIDITY) { if (activeQuery.chartType === ChartType.LIQUIDITY) {
return <LiquidityChart {...selectedChartProps} /> return <LiquidityChart {...selectedChartProps} currencyA={currencyA} currencyB={currencyB} />
} }
if (activeQuery.dataQuality === DataQuality.INVALID || !currencyA || !currencyB) { if (activeQuery.dataQuality === DataQuality.INVALID || !currencyA || !currencyB) {
const errorText = loading ? undefined : <Trans i18nKey="chart.error.pools" /> const errorText = loading ? undefined : <Trans i18nKey="chart.error.pools" />
...@@ -376,8 +377,8 @@ function LiquidityTooltipDisplay({ ...@@ -376,8 +377,8 @@ function LiquidityTooltipDisplay({
} }
function LiquidityChart({ function LiquidityChart({
tokenA, currencyA,
tokenB, currencyB,
feeTier, feeTier,
isReversed, isReversed,
chainId, chainId,
...@@ -386,8 +387,8 @@ function LiquidityChart({ ...@@ -386,8 +387,8 @@ function LiquidityChart({
hooks, hooks,
poolId, poolId,
}: { }: {
tokenA: Token currencyA: Currency
tokenB: Token currencyB: Currency
feeTier: FeeAmount feeTier: FeeAmount
isReversed: boolean isReversed: boolean
chainId: UniverseChainId chainId: UniverseChainId
...@@ -397,12 +398,12 @@ function LiquidityChart({ ...@@ -397,12 +398,12 @@ function LiquidityChart({
poolId?: string poolId?: string
}) { }) {
const { t } = useTranslation() const { t } = useTranslation()
const tokenADescriptor = tokenA.symbol ?? tokenA.name ?? t('common.tokenA') const tokenADescriptor = currencyA.symbol ?? currencyA.name ?? t('common.tokenA')
const tokenBDescriptor = tokenB.symbol ?? tokenB.name ?? t('common.tokenB') const tokenBDescriptor = currencyB.symbol ?? currencyB.name ?? t('common.tokenB')
const { tickData, activeTick, loading } = useLiquidityBarData({ const { tickData, activeTick, loading } = useLiquidityBarData({
tokenA, currencyA,
tokenB, currencyB,
feeTier, feeTier,
isReversed, isReversed,
chainId, chainId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment