Skip to content

Commit

Permalink
chore(dex): dex stabilization fee (#3934)
Browse files Browse the repository at this point in the history
  • Loading branch information
thedoublejay authored Mar 14, 2023
1 parent e2dfee6 commit df265d3
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export function useDexStabilization(
tokenADisplaySymbol: string,
tokenBDisplaySymbol: string
): string => {
// TODO: Replace with more robust logic, store in wallet-website-api

let fee;
const dusdDFIPair = pairs.find((p) => p.data.displaySymbol === "DUSD-DFI");
const dUSDCDUSDPair = pairs.find(
Expand All @@ -85,6 +87,9 @@ export function useDexStabilization(
const dUSDTDUSDPair = pairs.find(
(p) => p.data.displaySymbol === "dUSDT-DUSD"
);
const dEUROCDUSDPair = pairs.find(
(p) => p.data.displaySymbol === "dEUROC-DUSD"
);

if (
dusdDFIPair !== undefined &&
Expand All @@ -104,6 +109,12 @@ export function useDexStabilization(
tokenBDisplaySymbol === "dUSDT"
) {
fee = dUSDTDUSDPair.data.tokenB.fee?.pct;
} else if (
dEUROCDUSDPair !== undefined &&
tokenADisplaySymbol === "DUSD" &&
tokenBDisplaySymbol === "dEUROC"
) {
fee = dEUROCDUSDPair.data.tokenB.fee?.pct;
}

return fee === undefined
Expand Down

0 comments on commit df265d3

Please sign in to comment.