-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
27 lines (24 loc) · 813 Bytes
/
index.ts
File metadata and controls
27 lines (24 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { liquidate } from "./src/liquidate";
//-----------------------------------------------------------------
// CONFIGS
//-----------------------------------------------------------------
const WALLET_ADDRESS_TO_LIQUIDATE = ``;
const DEBT_TOKEN = "WUSDC";
const COLLATERAL_TOKEN = "WAR";
const QUANTITY = 0; // example 1.1 Arweave = 1.1
const SLIPPAGE = 5; // example 5 = 5% slippage
//-----------------------------------------------------------------
console.log(
`\x1b[93mLiquidating ${QUANTITY} ${DEBT_TOKEN} to get back ${COLLATERAL_TOKEN},` +
` on wallet address ${WALLET_ADDRESS_TO_LIQUIDATE}, with a slippage of ${SLIPPAGE}%.\x1b[0m`,
);
console.log(
// @ts-ignore
await liquidate(
WALLET_ADDRESS_TO_LIQUIDATE,
DEBT_TOKEN,
COLLATERAL_TOKEN,
QUANTITY,
SLIPPAGE,
),
);