Skip to content

Commit

Permalink
Merge pull request #50 from bleu/fix-withdraw-data-processing
Browse files Browse the repository at this point in the history
Withdraw Fix rounding issue
  • Loading branch information
yvesfracari authored Oct 25, 2024
2 parents 5585f8f + 46e433f commit 2cf89f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
1 change: 0 additions & 1 deletion apps/withdraw-pool/src/hooks/useUserPoolBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export function useUserPoolBalance({
() => fetchUserPoolBalance(chainId, poolId, user),
{
revalidateOnFocus: false,
revalidateOnReconnect: false,
},
);
}
18 changes: 3 additions & 15 deletions packages/cow-hooks-ui/src/hooks/usePools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ interface IQuery {
weight: number;
}[];
userBalance: {
totalBalance: string;
walletBalance: string;
totalBalanceUsd: number;
walletBalanceUsd: number;
stakedBalances: {
balance: string;
Expand Down Expand Up @@ -84,9 +82,7 @@ const USER_POOLS_QUERY = gql`
weight
}
userBalance {
totalBalance
walletBalance
totalBalanceUsd
walletBalanceUsd
stakedBalances {
balance
Expand Down Expand Up @@ -127,25 +123,18 @@ export function usePools(
userBalance: {
...pool.userBalance,
walletBalance: parseUnits(
Number(pool.userBalance.walletBalance).toFixed(pool.decimals),
pool.decimals,
),
totalBalance: parseUnits(
Number(pool.userBalance.totalBalance).toFixed(pool.decimals),
pool.userBalance.walletBalance,
pool.decimals,
),
stakedBalances: pool.userBalance.stakedBalances.map((staked) => ({
balance: parseUnits(
Number(staked.balance).toFixed(pool.decimals),
pool.decimals,
),
balance: parseUnits(staked.balance, pool.decimals),
stakingId: staked.stakingId,
})),
},
dynamicData: {
...pool.dynamicData,
totalShares: parseUnits(
Number(pool.dynamicData.totalShares).toFixed(pool.decimals),
pool.dynamicData.totalShares,
pool.decimals,
),
},
Expand All @@ -154,7 +143,6 @@ export function usePools(
},
{
revalidateOnFocus: false,
revalidateOnReconnect: false,
},
);
}
2 changes: 0 additions & 2 deletions packages/cow-hooks-ui/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ export interface IPool {
allTokens: IToken[];

userBalance: {
totalBalance: BigNumberish;
walletBalance: BigNumberish;
totalBalanceUsd: number;
walletBalanceUsd: number;
stakedBalances: {
balance: BigNumberish;
Expand Down

0 comments on commit 2cf89f9

Please sign in to comment.