Skip to content

Commit

Permalink
fix: pool fee percantage and calculated values
Browse files Browse the repository at this point in the history
  • Loading branch information
ogous committed Aug 26, 2024
1 parent 426d778 commit e616e3a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions web/src/components/ConfirmStake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,8 @@ export const ConfirmStake = ({ mode, positionId }: ConfirmStakeProps) => {
<div className="flex flex-row justify-between">
<div>Fees</div>
<div>
Pool Fee {+feePercentage.toFixed(6)}% ={" "}
{+(usdTokenOPrice * feePercentage).toFixed(6)}$
Pool Fee {+feePercentage.toFixed(3)}% ={" "}
{+((usdTokenOPrice * feePercentage) / 100).toFixed(6)}$
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions web/src/components/ConfirmSwap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ export const ConfirmSwap = () => {
</div>
<div className="flex flex-row justify-end">
<span>
Pool Fee {+feePercentage.toFixed(6)}% ={" "}
{+(usdPriceToken0 * feePercentage).toFixed(6)}$
Pool Fee {+feePercentage.toFixed(3)}% ={" "}
{+((usdPriceToken0 * feePercentage) / 100).toFixed(6)}$
</span>
</div>

Expand Down
7 changes: 3 additions & 4 deletions web/src/components/StakeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ export const StakeForm = ({ mode, poolId, positionId }: StakeFormProps) => {
>
<div className="flex flex-col items-center gap-[3px]">
<div className="iridescent-text text-xs font-medium md:text-sm">
{+feePercentage.toFixed(6)}%
{+feePercentage.toFixed(3)}%
</div>
<Badge
variant="iridescent"
Expand Down Expand Up @@ -870,8 +870,7 @@ export const StakeForm = ({ mode, poolId, positionId }: StakeFormProps) => {
}
>
<div>
{/* {+feePercentage.toFixed(6)}% ={" "} */}
{+(feePercentage * usdPriceToken0).toFixed(2)}$
{+((usdPriceToken0 * feePercentage) / 100).toFixed(6)}$
</div>
<div
className={
Expand Down Expand Up @@ -981,7 +980,7 @@ export const StakeForm = ({ mode, poolId, positionId }: StakeFormProps) => {
<div className={"flex flex-row items-center"}>
<Token />
<Token className={"-ml-1 mr-1"} />
{+feePercentage.toFixed(6)}%
{+feePercentage.toFixed(3)}%
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions web/src/components/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ export const SwapForm = () => {
</div>
<div className={"flex flex-row justify-end"}>
<span>
Pool Fee {+feePercentage.toFixed(6)}% ={" "}
{+(usdPriceToken0 * feePercentage).toFixed(6)}$
Pool Fee {+feePercentage.toFixed(3)}% ={" "}
{+((usdPriceToken0 * feePercentage) / 100).toFixed(6)}$
</span>
</div>
<div className={"flex flex-row justify-between"}>
Expand Down
2 changes: 1 addition & 1 deletion web/src/stores/useStakeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,5 @@ export const useStakeStore = create<StakeStore>((set) => ({
});
},
feePercentage: 0,
setFeePercentage: (fee) => set({ feePercentage: 100 / (fee * 100) }),
setFeePercentage: (fee) => set({ feePercentage: 100 / fee }),
}));
2 changes: 1 addition & 1 deletion web/src/stores/useSwapStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ export const useSwapStore = create<SwapStore>((set) => ({
gas: 0n,
setGas: (gas) => set({ gas }),
feePercentage: 0,
setFeePercentage: (fee) => set({ feePercentage: 100 / (fee * 100) }),
setFeePercentage: (fee) => set({ feePercentage: 100 / fee }),
}));

0 comments on commit e616e3a

Please sign in to comment.