ci(release): publish latest release

parent 65288f49
IPFS hash of the deployment:
- CIDv0: `QmcDLYNCmBY8GZivEGAw4fwyeT24YpT1FqttKTkcRFfivc`
- CIDv1: `bafybeigoeqbd3sgqs3ry32353einpmrcuy5p45hutcmjp4qummebbwhw7e`
- CIDv0: `QmSR5NDYo4zoKKUQJ6fbr7QBw8VzMSYTPLCKWFrnEy3siH`
- CIDv1: `bafybeib4sdzwnyzjkgip3tbxxpwp76goocrdu77z5cnshiitjqcpnv2pci`
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.
Your Uniswap settings are never remembered across different URLs.
IPFS gateways:
- https://bafybeigoeqbd3sgqs3ry32353einpmrcuy5p45hutcmjp4qummebbwhw7e.ipfs.dweb.link/
- [ipfs://QmcDLYNCmBY8GZivEGAw4fwyeT24YpT1FqttKTkcRFfivc/](ipfs://QmcDLYNCmBY8GZivEGAw4fwyeT24YpT1FqttKTkcRFfivc/)
- https://bafybeib4sdzwnyzjkgip3tbxxpwp76goocrdu77z5cnshiitjqcpnv2pci.ipfs.dweb.link/
- [ipfs://QmSR5NDYo4zoKKUQJ6fbr7QBw8VzMSYTPLCKWFrnEy3siH/](ipfs://QmSR5NDYo4zoKKUQJ6fbr7QBw8VzMSYTPLCKWFrnEy3siH/)
### 5.80.2 (2025-04-25)
### 5.80.3 (2025-04-25)
### 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
\ No newline at end of file
web/5.80.3
\ No newline at end of file
import { BigNumber } from '@ethersproject/bignumber'
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 { 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 { LiquidityBarSeries } from 'components/Charts/LiquidityChart/liquidity-bar-series'
import {
......@@ -123,6 +123,7 @@ function maxAmount(token: Token) {
}
/** Calculates tokens locked in the active tick range based on the current tick */
// TODO(WEB-7564): determine how to support v4
async function calculateActiveRangeTokensLocked(
token0: Token,
token1: Token,
......@@ -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(
token0: Token,
token1: Token,
token0: Currency,
token1: Currency,
feeTier: FeeAmount,
tickSpacing: number,
hooks: string,
......@@ -278,8 +280,8 @@ export async function calculateTokensLockedV4(
}
export function useLiquidityBarData({
tokenA,
tokenB,
currencyA,
currencyB,
feeTier,
isReversed,
chainId,
......@@ -288,8 +290,8 @@ export function useLiquidityBarData({
hooks,
poolId,
}: {
tokenA: Token
tokenB: Token
currencyA: Currency
currencyB: Currency
feeTier: FeeAmount
isReversed: boolean
chainId: UniverseChainId
......@@ -299,9 +301,15 @@ export function useLiquidityBarData({
poolId?: string
}) {
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({
currencyA: tokenA,
currencyB: tokenB,
currencyA,
currencyB,
feeAmount: feeTier,
version,
poolId,
......@@ -341,15 +349,18 @@ export function useLiquidityBarData({
activeRangeIndex = index
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()
}
const { amount0Locked, amount1Locked } = await (version === ProtocolVersion.V3
? calculateTokensLockedV3(tokenA, tokenB, feeTier, t)
? calculateTokensLockedV3(tokenAWrapped, tokenBWrapped, feeTier, t)
: calculateTokensLockedV4(
tokenA,
tokenB,
currencyA,
currencyB,
feeTier,
tickSpacing ?? TICK_SPACINGS[feeTier],
hooks ?? ZERO_ADDRESS,
......@@ -379,8 +390,8 @@ export function useLiquidityBarData({
// For active range, adjust amounts locked to adjust for where current tick/price is within the range
if (activeRangeIndex !== undefined && activeRangeData) {
const activeTickTvl = await calculateActiveRangeTokensLocked(
tokenA,
tokenB,
tokenAWrapped,
tokenBWrapped,
feeTier,
ticksProcessed[activeRangeIndex],
activePoolData,
......@@ -398,7 +409,20 @@ export function useLiquidityBarData({
}
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 }
}
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 { ChartHeader } from 'components/Charts/ChartHeader'
import { Chart, refitChartContentAtom } from 'components/Charts/ChartModel'
......@@ -188,8 +188,9 @@ export default function ChartSection(props: ChartSectionProps) {
}
// 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) {
return <LiquidityChart {...selectedChartProps} />
return <LiquidityChart {...selectedChartProps} currencyA={currencyA} currencyB={currencyB} />
}
if (activeQuery.dataQuality === DataQuality.INVALID || !currencyA || !currencyB) {
const errorText = loading ? undefined : <Trans i18nKey="chart.error.pools" />
......@@ -376,8 +377,8 @@ function LiquidityTooltipDisplay({
}
function LiquidityChart({
tokenA,
tokenB,
currencyA,
currencyB,
feeTier,
isReversed,
chainId,
......@@ -386,8 +387,8 @@ function LiquidityChart({
hooks,
poolId,
}: {
tokenA: Token
tokenB: Token
currencyA: Currency
currencyB: Currency
feeTier: FeeAmount
isReversed: boolean
chainId: UniverseChainId
......@@ -397,12 +398,12 @@ function LiquidityChart({
poolId?: string
}) {
const { t } = useTranslation()
const tokenADescriptor = tokenA.symbol ?? tokenA.name ?? t('common.tokenA')
const tokenBDescriptor = tokenB.symbol ?? tokenB.name ?? t('common.tokenB')
const tokenADescriptor = currencyA.symbol ?? currencyA.name ?? t('common.tokenA')
const tokenBDescriptor = currencyB.symbol ?? currencyB.name ?? t('common.tokenB')
const { tickData, activeTick, loading } = useLiquidityBarData({
tokenA,
tokenB,
currencyA,
currencyB,
feeTier,
isReversed,
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