Skip to content

Commit

Permalink
Merge pull request #865 from invariant-labs/dev
Browse files Browse the repository at this point in the history
Update staging env
  • Loading branch information
wojciech-cichocki authored Jan 22, 2025
2 parents bcb47ab + 895ddf1 commit 844d99d
Show file tree
Hide file tree
Showing 7 changed files with 10,019 additions and 10,089 deletions.
15 changes: 14 additions & 1 deletion src/components/Modals/Priority/Priority.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const Priority: React.FC<IPriority> = ({
}, [inputValue, selectedIndex])

const handleClick = (index: number) => {
setInputValue('')
setInputValue(priorityFeeOptions[index].value.toString())

setPriorityMode(priorityFeeOptions[index].label)
setSelectedIndex(index)
Expand Down Expand Up @@ -216,6 +216,19 @@ const Priority: React.FC<IPriority> = ({
return () => clearInterval(interval)
}, [priorityMode])

const [firstLoad, setFirstLoad] = useState(true)

useEffect(() => {
if (priorityMode === PriorityMode.Custom) {
setFirstLoad(false)
return
}
if (firstLoad && dynamicFee !== null) {
setFirstLoad(false)
setInputValue(priorityFeeOptions[selectedIndex].saveValue.toString())
}
}, [priorityFeeOptions])

const getCurrentDynamicFee = async () => {
const response = await fetch('https://solanacompass.com/api/fees')
const data = await response.json()
Expand Down
10 changes: 5 additions & 5 deletions src/components/PopularPools/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ const Card: React.FC<ICard> = ({
const handleOpenPosition = () => {
if (fee === undefined) return

const revertRatio = initialXtoY(addressFrom ?? '', addressTo ?? '')
const isXToY = initialXtoY(addressFrom ?? '', addressTo ?? '')

const tokenA = revertRatio
? addressToTicker(network, addressTo ?? '')
: addressToTicker(network, addressFrom ?? '')
const tokenB = revertRatio
const tokenA = isXToY
? addressToTicker(network, addressFrom ?? '')
: addressToTicker(network, addressTo ?? '')
const tokenB = isXToY
? addressToTicker(network, addressTo ?? '')
: addressToTicker(network, addressFrom ?? '')

navigate(
`/newPosition/${tokenA}/${tokenB}/${parseFeeToPathFee(Math.round(fee * 10 ** (DECIMAL - 2)))}`,
Expand Down
4 changes: 2 additions & 2 deletions src/components/PositionDetails/PositionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ const PositionDetails: React.FC<IProps> = ({
className={classes.button}
variant='contained'
onClick={() => {
const parsedFee = parseFeeToPathFee(fee)
const parsedFee = parseFeeToPathFee(fee.v)
const address1 = addressToTicker(network, tokenXAddress.toString())
const address2 = addressToTicker(network, tokenYAddress.toString())

const revertRatio = !initialXtoY(
const revertRatio = initialXtoY(
tokenXAddress.toString() ?? '',
tokenYAddress.toString() ?? ''
)
Expand Down
10 changes: 5 additions & 5 deletions src/components/Stats/PoolListItem/PoolListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ const PoolListItem: React.FC<IProps> = ({
const isMd = useMediaQuery(theme.breakpoints.down('md'))

const handleOpenPosition = () => {
const revertRatio = initialXtoY(addressFrom ?? '', addressTo ?? '')
const isXtoY = initialXtoY(addressFrom ?? '', addressTo ?? '')

const tokenA = revertRatio
? addressToTicker(network, addressTo ?? '')
: addressToTicker(network, addressFrom ?? '')
const tokenB = revertRatio
const tokenA = isXtoY
? addressToTicker(network, addressFrom ?? '')
: addressToTicker(network, addressTo ?? '')
const tokenB = isXtoY
? addressToTicker(network, addressTo ?? '')
: addressToTicker(network, addressFrom ?? '')

navigate(
`/newPosition/${tokenA}/${tokenB}/${parseFeeToPathFee(Math.round(fee * 10 ** (DECIMAL - 2)))}`,
Expand Down
11 changes: 8 additions & 3 deletions src/store/consts/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,16 @@ export const SIGNING_SNACKBAR_CONFIG: Omit<ISnackbar, 'open'> = {
persist: true
}

export const ADDRESSES_TO_REVERT_TOKEN_PAIRS: string[] = [
export const ADDRESSES_ORDER_TO_REVERT: string[] = [
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', // USDT
'So11111111111111111111111111111111111111112', //SOL
'7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs' //ETH
'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX', // USDH
'So11111111111111111111111111111111111111112', // SOL
'J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn', // JitoSOL
'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So', // mSol
'27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4', // JLP
'jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v', // JupSOL
'7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs' // ETH
]

export const REFRESHER_INTERVAL = 120
Expand Down
Loading

0 comments on commit 844d99d

Please sign in to comment.