Skip to content

Commit

Permalink
Merge pull request #940 from oraichain/fix/price-impact
Browse files Browse the repository at this point in the history
Fix/price impact
  • Loading branch information
haunv3 authored Aug 29, 2024
2 parents 3baf30d + 8a9f992 commit 5c96f9e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions src/pages/Pool-V3/components/PositionItem/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
@include theme {
color: theme-get('neutral-9');
}
@include mobile {
text-align: right;
}
font-size: 14px;
font-weight: 400;
line-height: 150%; /* 21px */
Expand Down
20 changes: 11 additions & 9 deletions src/pages/Pool-V3/components/PositionItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const PositionItem = ({ position }) => {
<p>My Liquidity</p>
<span className={styles.value}>{formatDisplayUsdt(position.tokenXLiqInUsd + position.tokenYLiqInUsd)}</span>
</div>
<div className={styles.item}>
<div className={classNames(styles.item)}>
<p>APR</p>
<span className={classNames(styles.value, styles.apr)}>
{numberWithCommas(aprInfo.total * 100, undefined, { maximumFractionDigits: 2 })}%&nbsp;
Expand Down Expand Up @@ -468,14 +468,16 @@ const PositionItem = ({ position }) => {
return (
<div className={styles.itemRow} key={'incentEarned-' + i}>
<span className={styles.usd}></span>
<span className={classNames(styles.token, styles[theme])}></span>
<span className={classNames(styles.token, styles[theme])}>
{theme === 'light' ? <token.IconLight /> : <token.Icon />}
{!amount || !Number(amount)
? '--'
: toDisplay(amount.toString(), token.decimals || CW20_DECIMALS)}{' '}
{token?.name}
</span>
<div className={classNames(styles.itemAsset, styles[theme])}>
<span className={classNames(styles.token, styles[theme])}></span>
<span className={classNames(styles.token, styles[theme])}>
{theme === 'light' ? <token.IconLight /> : <token.Icon />}
{!amount || !Number(amount)
? '--'
: toDisplay(amount.toString(), token.decimals || CW20_DECIMALS)}{' '}
{token?.name}
</span>
</div>
</div>
);
})}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/UniversalSwap/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,9 @@ export const isAllowIBCWasm = (fromToken: TokenItemType, toToken: TokenItemType)
}
// Oraichain or Cosmos -> Evm
if ((fromTokenIsOraichain || fromTokenIsCosmos) && !toTokenIsCosmos) return true;
// Evm -> Oraichain or Cosmos or EVM
// Evm -> EVM
if (!fromTokenIsCosmos && !toTokenIsCosmos && toToken.chainId === fromToken.chainId) return false;
// Evm -> Oraichain or Cosmos
if (!fromTokenIsCosmos) return true;
// Cosmos -> Cosmos or Oraichain
if (fromTokenIsCosmos && toTokenIsCosmos) {
Expand Down

0 comments on commit 5c96f9e

Please sign in to comment.