Skip to content

Commit

Permalink
fix(ui-ux): display euroc stab fee (#3936)
Browse files Browse the repository at this point in the history
fix(ui-ux): display euroc

Co-authored-by: Pierre Gabaldon <[email protected]>
  • Loading branch information
pierregee and Pierre Gabaldon authored Mar 14, 2023
1 parent 28649d0 commit 3439625
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ export function useDexStabilization(
pair.tokenBDisplaySymbol === "dUSDC"
) {
highFeesUrl = "https://defiscan.live/dex/dUSDC-DUSD";
} else if (
pair.tokenADisplaySymbol === "DUSD" &&
pair.tokenBDisplaySymbol === "dEUROC"
) {
highFeesUrl = "https://defiscan.live/dex/dEUROC-DUSD";
}

return highFeesUrl;
Expand Down Expand Up @@ -344,7 +349,8 @@ export function useDexStabilization(
bestPath.length === 1 &&
((tokenA.displaySymbol === "DUSD" && tokenB.displaySymbol === "DFI") ||
(tokenA.displaySymbol === "DUSD" && tokenB.displaySymbol === "dUSDT") ||
(tokenA.displaySymbol === "DUSD" && tokenB.displaySymbol === "dUSDC"))
(tokenA.displaySymbol === "DUSD" && tokenB.displaySymbol === "dUSDC") ||
(tokenA.displaySymbol === "DUSD" && tokenB.displaySymbol === "dEUROC"))
) {
return {
dexStabilizationType: "direct-dusd-with-fee",
Expand All @@ -361,16 +367,17 @@ export function useDexStabilization(

/*
Otherwise, check for composite swap
1. Get index of DUSD-(DFI | USDT | USDC) pair
2. If index === 0 Check if first leg in best path is DUSD-(DFI | USDT | USDC) and second leg is (DFI | USDT | USDC) respectively
3. Else check if the previous pair tokenB is DUSD to ensure that the direction of DUSD-DFI is DUSD -> DFI | USDT | USDC
1. Get index of DUSD-(DFI | USDT | USDC | EUROC) pair
2. If index === 0 Check if first leg in best path is DUSD-(DFI | USDT | USDC) and second leg is (DFI | USDT | USDC | EUROC) respectively
3. Else check if the previous pair tokenB is DUSD to ensure that the direction of DUSD-DFI is DUSD -> DFI | USDT | USDC | EUROC
*/
const compositeSwapDexStabilization = getCompositeSwapDexStabilization(
bestPath,
[
{ tokenADisplaySymbol: "DUSD", tokenBDisplaySymbol: "DFI" },
{ tokenADisplaySymbol: "DUSD", tokenBDisplaySymbol: "dUSDT" },
{ tokenADisplaySymbol: "DUSD", tokenBDisplaySymbol: "dUSDC" },
{ tokenADisplaySymbol: "DUSD", tokenBDisplaySymbol: "dEUROC" },
]
);

Expand Down

0 comments on commit 3439625

Please sign in to comment.