@generationsoftware/pt-v5-autotasks-library
Advanced tools
Comparing version 1.2.4 to 1.2.5
export { ERC20Abi } from './ERC20Abi.js'; | ||
export { ERC4626Abi } from './ERC4626Abi.js'; | ||
export { FlashLiquidatorAbi } from './FlashLiquidatorAbi.js'; | ||
export { LiquidationPairAbi } from './LiquidationPairAbi.js'; | ||
@@ -5,0 +4,0 @@ export { GasPriceOracleAbi } from './GasPriceOracleAbi.js'; |
export { ERC20Abi } from './ERC20Abi.js'; | ||
export { ERC4626Abi } from './ERC4626Abi.js'; | ||
export { FlashLiquidatorAbi } from './FlashLiquidatorAbi.js'; | ||
export { LiquidationPairAbi } from './LiquidationPairAbi.js'; | ||
@@ -5,0 +4,0 @@ export { GasPriceOracleAbi } from './GasPriceOracleAbi.js'; |
@@ -110,5 +110,7 @@ export declare const KNOWN_TOKENS: { | ||
ARB: string; | ||
USDA: string; | ||
PRZWETH: string; | ||
PRZUSDC: string; | ||
PRZUSDT: string; | ||
PRZUSDA: string; | ||
WBTC?: undefined; | ||
@@ -128,3 +130,2 @@ DAI?: undefined; | ||
WELL?: undefined; | ||
USDA?: undefined; | ||
PRZAERO?: undefined; | ||
@@ -134,3 +135,2 @@ PRZCBETH?: undefined; | ||
PRZPOOLLUSD?: undefined; | ||
PRZUSDA?: undefined; | ||
PDAI?: undefined; | ||
@@ -137,0 +137,0 @@ PUSDC?: undefined; |
@@ -52,5 +52,7 @@ import { CHAIN_IDS } from './network.js'; | ||
ARB: '0x912ce59144191c1204e64559fe8253a0e49e6548', | ||
USDA: '0x0000206329b97DB379d5E1Bf586BbDB969C63274', | ||
PRZWETH: '0x7b0949204e7da1b0bed6d4ccb68497f51621b574', | ||
PRZUSDC: '0x3c72a2a78c29d1f6454caa1bcb17a7792a180a2e', | ||
PRZUSDT: '0xcacba8be4bc225fb8d15a9a3b702f84ca3eba991', | ||
PRZUSDA: '0x8653084e01Bd8c9e24B9a8fEb2036251Ee0C16A9', | ||
}, | ||
@@ -57,0 +59,0 @@ [CHAIN_IDS.arbitrumSepolia]: { |
import chalk from 'chalk'; | ||
import { ethers, BigNumber } from 'ethers'; | ||
import { getContract } from '@generationsoftware/pt-v5-utils-js'; | ||
import { chainName, logTable, logStringValue, logBigNumber, printAsterisks, printSpacer, getFeesUsd, roundTwoDecimalPlaces, checkOrX, } from './utils/index.js'; | ||
import { chainName, logTable, logStringValue, logBigNumber, printAsterisks, printSpacer, getFeesUsd, roundTwoDecimalPlaces, checkOrX, findRecipient, } from './utils/index.js'; | ||
import { NETWORK_NATIVE_TOKEN_INFO } from './constants/index.js'; | ||
@@ -11,13 +11,5 @@ import { getDrawAuctionContextMulticall, DrawAuctionState, } from './utils/getDrawAuctionContextMulticall.js'; | ||
export async function runDrawAuction(contracts, config) { | ||
const { chainId, relayerAddress } = config; | ||
const { chainId } = config; | ||
printSpacer(); | ||
let rewardRecipient = config.rewardRecipient; | ||
if (!rewardRecipient) { | ||
const message = `Config - REWARD_RECIPIENT not provided, setting swap recipient to relayer address:`; | ||
console.log(chalk.dim(message), chalk.yellow(relayerAddress)); | ||
rewardRecipient = relayerAddress; | ||
} | ||
else { | ||
console.log(chalk.dim(`Config - REWARD_RECIPIENT:`), chalk.yellow(rewardRecipient)); | ||
} | ||
const rewardRecipient = findRecipient(config); | ||
console.log(chalk.dim('Config - MIN_PROFIT_THRESHOLD_USD:'), chalk.yellow(config.minProfitThresholdUsd)); | ||
@@ -24,0 +16,0 @@ const drawAuctionContracts = instantiateDrawAuctionContracts(config, contracts); |
export { runPrizeClaimer } from './prizeClaimer.js'; | ||
export { runFlashLiquidator } from './flashLiquidator.js'; | ||
export { runLiquidator } from './liquidator.js'; | ||
@@ -4,0 +3,0 @@ export { runDrawAuction } from './drawAuction.js'; |
export { runPrizeClaimer } from './prizeClaimer.js'; | ||
export { runFlashLiquidator } from './flashLiquidator.js'; | ||
export { runLiquidator } from './liquidator.js'; | ||
@@ -4,0 +3,0 @@ export { runDrawAuction } from './drawAuction.js'; |
import { ethers, BigNumber } from 'ethers'; | ||
import { getContract } from '@generationsoftware/pt-v5-utils-js'; | ||
import chalk from 'chalk'; | ||
import { logTable, logStringValue, logBigNumber, printAsterisks, printSpacer, getFeesUsd, getNativeTokenMarketRateUsd, roundTwoDecimalPlaces, getLiquidatorContextMulticall, getLiquidationPairsMulticall, checkOrX, } from './utils/index.js'; | ||
import { logTable, logStringValue, logBigNumber, printAsterisks, printSpacer, getFeesUsd, getNativeTokenMarketRateUsd, roundTwoDecimalPlaces, getLiquidatorContextMulticall, getLiquidationPairsMulticall, checkOrX, findRecipient, } from './utils/index.js'; | ||
import { ERC20Abi } from './abis/ERC20Abi.js'; | ||
@@ -105,11 +105,3 @@ import { UniswapV2WethPairFlashLiquidatorAbi } from './abis/UniswapV2WethPairFlashLiquidatorAbi.js'; | ||
printSpacer(); | ||
let swapRecipient = config.swapRecipient; | ||
if (!swapRecipient) { | ||
const message = `Config - SWAP_RECIPIENT not provided, setting swap recipient to relayer address:`; | ||
console.log(chalk.dim(message), chalk.yellow(relayerAddress)); | ||
swapRecipient = relayerAddress; | ||
} | ||
else { | ||
console.log(chalk.dim(`Config - SWAP_RECIPIENT:`), chalk.yellow(swapRecipient)); | ||
} | ||
const swapRecipient = findRecipient(config); | ||
console.log(chalk.dim('Config - MIN_PROFIT_THRESHOLD_USD:'), chalk.yellow(config.minProfitThresholdUsd)); | ||
@@ -250,3 +242,3 @@ printSpacer(); | ||
const processSingleTokenPair = async (config, context, liquidationRouterContract, liquidationPairContract, liquidationPairContracts, amountOut, swapRecipient) => { | ||
const { provider, signer, minProfitThresholdUsd, relayerAddress } = config; | ||
const { signer, minProfitThresholdUsd, relayerAddress } = config; | ||
const pair = getPairName(context); | ||
@@ -253,0 +245,0 @@ const assetRateUsd = context.underlyingAssetToken.assetRateUsd; |
@@ -6,3 +6,3 @@ import nodeFetch from 'node-fetch'; | ||
import chalk from 'chalk'; | ||
import { getComputeTotalClaimFeesMulticall, getFeesUsd, getEthMainnetTokenMarketRateUsd, getNativeTokenMarketRateUsd, getWinnersUri, logTable, logStringValue, logBigNumber, printAsterisks, printSpacer, roundTwoDecimalPlaces, } from './utils/index.js'; | ||
import { getComputeTotalClaimFeesMulticall, getFeesUsd, getEthMainnetTokenMarketRateUsd, getNativeTokenMarketRateUsd, getWinnersUri, logTable, logStringValue, logBigNumber, printAsterisks, printSpacer, roundTwoDecimalPlaces, findRecipient, } from './utils/index.js'; | ||
import { ERC20Abi } from './abis/ERC20Abi.js'; | ||
@@ -14,13 +14,5 @@ import { NETWORK_NATIVE_TOKEN_INFO } from './constants/network.js'; | ||
export async function runPrizeClaimer(contracts, config) { | ||
const { chainId, covalentApiKey, wallet, provider, relayerAddress, subgraphUrl } = config; | ||
const { chainId, covalentApiKey, wallet, provider, subgraphUrl } = config; | ||
printSpacer(); | ||
let rewardRecipient = config.rewardRecipient; | ||
if (!rewardRecipient) { | ||
const message = `Config - REWARD_RECIPIENT not provided, setting swap recipient to relayer address:`; | ||
console.log(chalk.dim(message), chalk.yellow(relayerAddress)); | ||
rewardRecipient = relayerAddress; | ||
} | ||
else { | ||
console.log(chalk.dim(`Config - REWARD_RECIPIENT:`), chalk.yellow(rewardRecipient)); | ||
} | ||
const rewardRecipient = findRecipient(config); | ||
console.log(chalk.dim('Config - MIN_PROFIT_THRESHOLD_USD:'), chalk.yellow(config.minProfitThresholdUsd)); | ||
@@ -27,0 +19,0 @@ const contractsVersion = { |
@@ -56,4 +56,2 @@ import { Contract, BigNumber, Wallet, Signer } from 'ethers'; | ||
} | ||
export interface FlashLiquidatorConfig extends SharedLiquidatorConfig { | ||
} | ||
export interface DrawAuctionConfig extends AutotaskConfig { | ||
@@ -72,4 +70,2 @@ rewardRecipient?: string; | ||
} | ||
export interface FlashLiquidatorContext extends BaseLiquidatorContext { | ||
} | ||
export interface AutotaskEnvVars { | ||
@@ -92,4 +88,2 @@ CHAIN_ID: number; | ||
} | ||
export interface FlashLiquidatorEnvVars extends SharedLiquidatorEnvVars { | ||
} | ||
export interface PrizeClaimerEnvVars extends AutotaskEnvVars { | ||
@@ -96,0 +90,0 @@ SUBGRAPH_URL: string; |
export * from './checkOrX.js'; | ||
export * from './findRecipient.js'; | ||
export * from './math.js'; | ||
@@ -6,3 +7,2 @@ export * from './getProvider.js'; | ||
export * from './getComputeTotalClaimFeesMulticall.js'; | ||
export * from './getFlashLiquidatorContextMulticall.js'; | ||
export * from './getLiquidatorContextMulticall.js'; | ||
@@ -13,3 +13,2 @@ export * from './getLiquidationPairsMulticall.js'; | ||
export * from './loadLiquidatorEnvVars.js'; | ||
export * from './loadFlashLiquidatorEnvVars.js'; | ||
export * from './loadPrizeClaimerEnvVars.js'; | ||
@@ -16,0 +15,0 @@ export * from './loadDrawAuctionEnvVars.js'; |
export * from './checkOrX.js'; | ||
export * from './findRecipient.js'; | ||
export * from './math.js'; | ||
@@ -6,3 +7,2 @@ export * from './getProvider.js'; | ||
export * from './getComputeTotalClaimFeesMulticall.js'; | ||
export * from './getFlashLiquidatorContextMulticall.js'; | ||
export * from './getLiquidatorContextMulticall.js'; | ||
@@ -13,3 +13,2 @@ export * from './getLiquidationPairsMulticall.js'; | ||
export * from './loadLiquidatorEnvVars.js'; | ||
export * from './loadFlashLiquidatorEnvVars.js'; | ||
export * from './loadPrizeClaimerEnvVars.js'; | ||
@@ -16,0 +15,0 @@ export * from './loadDrawAuctionEnvVars.js'; |
@@ -1,2 +0,1 @@ | ||
import { FlashLiquidatorEnvVars } from './../types.js'; | ||
export declare const loadFlashLiquidatorEnvVars: () => FlashLiquidatorEnvVars; |
{ | ||
"name": "@generationsoftware/pt-v5-autotasks-library", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Library of shared utils to run PoolTogether v5 hyperstructure autotasks.", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
159
442301
7308