Liquidators
Liquidators are participants that liquidate underfunded positions and earn a fee. LiquidatorTool is the relevant SDK component.
LiquidatorTool ⇐ WriteAccessHandler
WriteAccessHandlernew LiquidatorTool(config, signer)
Param
Type
Description
import { LiquidatorTool, PerpetualDataHandler } from '@d8x/perpetuals-sdk';
async function main() {
console.log(LiquidatorTool);
// load configuration for Polygon zkEVM (tesnet)
const config = PerpetualDataHandler.readSDKConfig("cardona");
// LiquidatorTool (authentication required, PK is an environment variable with a private key)
const pk: string = <string>process.env.PK;
let lqudtrTool = new LiquidatorTool(config, pk);
// Create a proxy instance to access the blockchain
await lqudtrTool.createProxyInstance();
}
main();liquidatorTool.liquidateTrader(symbol, traderAddr, [liquidatorAddr], priceFeedData) ⇒
Param
Type
Description
liquidatorTool.isMaintenanceMarginSafe(symbol, traderAddr, indexPrices) ⇒ boolean
booleanParam
Type
Description
liquidatorTool.countActivePerpAccounts(symbol) ⇒ number
numberParam
Type
Description
liquidatorTool.getActiveAccountsByChunks(symbol, from, to) ⇒ Array.<string>
Array.<string>Param
Type
Description
liquidatorTool.getAllActiveAccounts(symbol) ⇒ Array.<string>
Array.<string>Param
Type
Description