Skip to content

Commit

Permalink
feat: clean
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Grimal committed Jan 9, 2025
1 parent 8660069 commit cc157ee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,9 @@ export const check = async <
srcToken,
srcAmount,
market.params,
slippage,
slippage / 10n ** 16n,
repaidAssets,
client.account.address,
market.id ===
("0xab4e2a2b60871cbbe808841b1debc1eea1a8a72a9a7bb03f9143a4fee87749fd" as MarketId),
);
Expand Down
12 changes: 9 additions & 3 deletions packages/liquidation-sdk-viem/src/LiquidationEncoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,16 @@ export class LiquidationEncoder<
marketParams: MarketParams,
slippage: bigint,
repaidAssets: bigint,
origin: string,
log: boolean,
) {
let srcToken = initialSrcToken;
const srcAmount = initialSrcAmount;
const tries: SwapAttempt[] = [];
let dstAmount = 0n;

const from = "0xfed6096f550864f8e1175f1e9dfa105ac911e5b4";

if (log) {
console.log("srcToken", srcToken);
console.log("srcAmount", srcAmount);
Expand All @@ -484,7 +487,8 @@ export class LiquidationEncoder<
src: srcToken,
dst: marketParams.loanToken,
amount: srcAmount,
from: this.address,
from,
origin,
slippage,
includeTokensInfo: false,
includeProtocols: false,
Expand Down Expand Up @@ -525,7 +529,8 @@ export class LiquidationEncoder<
src: firstToken!,
dst: marketParams.loanToken,
amount: halfAmount,
from: this.address,
from,
origin,
slippage,
includeTokensInfo: false,
includeProtocols: false,
Expand All @@ -544,7 +549,8 @@ export class LiquidationEncoder<
src: secondToken!,
dst: marketParams.loanToken,
amount: halfAmount,
from: this.address,
from,
origin,
slippage,
includeTokensInfo: false,
includeProtocols: false,
Expand Down
1 change: 1 addition & 0 deletions packages/liquidation-sdk-viem/src/swap/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface SwapParams {
dst: string;
amount: BigIntish;
from: string;
origin: string;
slippage: BigIntish;
protocols?: string;
fee?: BigIntish;
Expand Down

0 comments on commit cc157ee

Please sign in to comment.