Skip to content

Commit

Permalink
fix: adjust buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Grimal committed Feb 6, 2025
1 parent 307b3fc commit 26ae1d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const check = async <
functionName: "allowance",
args: [executorAddress, morpho],
}),
...new Array(1)
...new Array(10)
.fill(undefined)
.map((_v, i) => seizableCollateral / 2n ** BigInt(i))
.filter(
Expand Down
3 changes: 2 additions & 1 deletion packages/liquidation-sdk-viem/src/LiquidationEncoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
encodeFunctionData,
erc4626Abi,
getAddress,
parseEther,
} from "viem";
import { readContract } from "viem/actions";
import {
Expand Down Expand Up @@ -161,7 +162,7 @@ export class LiquidationEncoder<
ptIndex,
ibtIndex,
),
BigInt(0.98 * 10 ** 18),
parseEther("0.9999999"), // 0.00001
);

srcAmount = await this.previewIBTRedeem(ibt, swapAmount);
Expand Down
6 changes: 2 additions & 4 deletions packages/liquidation-sdk-viem/test/examples/spectra.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ describe("should liquidate Spectra Tokens", () => {
test.sequential(
`should liquidate on a PT standard market before maturity`,
async ({ client, encoder }) => {
/* client.transport.tracer.all = true; */

const collateralPriceUsd = 1;
const ethPriceUsd = 2_644;

Expand Down Expand Up @@ -412,12 +410,12 @@ describe("should liquidate Spectra Tokens", () => {
// const seizedCollateral = accruedPosition.seizableCollateral!;
mockOneInch(encoder, [
{
srcAmount: 8619150349511109684637n,
srcAmount: 8795050497547015034211n,
dstAmount: "9000000000",
},
]);
mockParaSwap(encoder, [
{ srcAmount: 8619150349511109684637n, dstAmount: "9000000000" },
{ srcAmount: 8795050497547015034211n, dstAmount: "9000000000" },
]);

await check(encoder.address, client, client.account, [marketId]);
Expand Down

0 comments on commit 26ae1d5

Please sign in to comment.