Skip to content

Commit

Permalink
Merge pull request #917 from oraichain/hotfix/pool_v3
Browse files Browse the repository at this point in the history
fix pool v3
  • Loading branch information
haunv3 authored Aug 12, 2024
2 parents 9079390 + b641fa1 commit d7280a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/pages/Balance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ const Balance: React.FC<BalanceProps> = () => {
fromAmount,
relayerFee,
userSlippage: 0,
bridgeFee: 1,
amounts: amountsBalance,
simulateAmount
},
Expand Down
16 changes: 6 additions & 10 deletions src/pages/Pool-V3/components/PositionItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ const PositionItem = ({ position, setStatusRemove }) => {
return () => {};
}, []);

const earnXDisplay = toDisplay((earnX || 0).toString(), tokenXDecimal);
const earnYDisplay = toDisplay((earnY || 0).toString(), tokenYDecimal);

const [tokenXClaim, tokenYClaim, tokenXClaimInUsd, tokenYClaimInUsd, incentivesUSD] = useMemo(() => {
if (isClaimSuccess) return [0, 0, 0, 0, 0];
if (position?.poolData && openCollapse && tick.lowerTick && tick.lowerTick && incentives) {
Expand Down Expand Up @@ -395,25 +398,18 @@ const PositionItem = ({ position, setStatusRemove }) => {
<h4>Total Reward Earned</h4>
<div className={styles.itemRow}>
<span className={styles.usd}>
{formatDisplayUsdt(
new BigDecimal(toDisplay((earnX || 0).toString(), tokenXDecimal) * tokenXUsd)
.add(toDisplay((earnY || 0).toString(), tokenYDecimal) * tokenYUsd)
.add(totalEarnIncentiveUsd)
.toNumber(),
6,
6
)}
{formatDisplayUsdt(earnXDisplay * tokenXUsd + earnYDisplay * tokenYUsd + totalEarnIncentiveUsd, 6, 6)}
</span>
<span className={classNames(styles.token, styles[theme])}>
<position.tokenXIcon />
{numberWithCommas(toDisplay((earnX || 0).toString(), tokenXDecimal), undefined, {
{numberWithCommas(earnXDisplay, undefined, {
maximumFractionDigits: 6
})}{' '}
{position?.tokenX.name}
</span>
<span className={classNames(styles.token, styles[theme])}>
<position.tokenYIcon />
{numberWithCommas(toDisplay((earnY || 0).toString(), tokenYDecimal), undefined, {
{numberWithCommas(earnYDisplay, undefined, {
maximumFractionDigits: 6
})}{' '}
{position?.tokenY.name}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/UniversalSwap/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ const SwapComponent: React.FC<{
fromAmount: fromAmountToken,
simulateAmount,
userSlippage,
bridgeFee: 1,
amounts: amountsBalance,
simulatePrice:
// @ts-ignore
Expand Down Expand Up @@ -626,7 +627,7 @@ const SwapComponent: React.FC<{
<img src={getSwitchIcon()} onClick={handleRotateSwapDirection} alt="ant" />
</div>
<div className={cx('swap-ai-dot')}>
{originalFromToken.cosmosBased && originalToToken.cosmosBased && useAlphaSmartRouter && (
{originalFromToken.cosmosBased && originalToToken.cosmosBased && (
<AIRouteSwitch isLoading={isPreviousSimulate} />
)}
{generateRatioComp()}
Expand Down

0 comments on commit d7280a2

Please sign in to comment.