Skip to content

Commit

Permalink
filter transacvtions from corrupted vaults, briefly
Browse files Browse the repository at this point in the history
  • Loading branch information
ewansheldon committed Oct 16, 2023
1 parent 447b2d3 commit 41733c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ schedulePricingIndexing();
// scheduleStatIndexing();
scheduleLiquidation();
scheduleIndexYieldData();
// scheduleVaultTransactionIndexing();
scheduleVaultTransactionIndexing();

const server = http.createServer(async (req, res) => {
res.statusCode = 200;
Expand Down
5 changes: 3 additions & 2 deletions src/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const getStatusAt = async (tx, wallet) => {
}

const addVaultStatus = async (transactions) => {
transactions = transactions.filter(tx => !BANNED.includes(tx.vaultAddress.toLowerCase()));
const transactionsWithStatus = [];
const { wallet } = getWallet(getArchiveNode('arbitrum'));
const statuses = await Promise.all(transactions.map(tx => getStatusAt(tx, wallet)))
Expand Down Expand Up @@ -435,8 +436,8 @@ const indexVaultTransactions = async _ => {
const smartVaultManagerContract = (await getContract(network.name, 'SmartVaultManager')).connect(wallet);
const erc20Tokens = await getAcceptedERC20s(network, wallet);
setTokenDecs(erc20Tokens);
const vaultCreations = await getCreations(smartVaultManagerContract, provider);
const unindexedVaults = vaultCreations.map(event => event.vaultAddress).filter(address => !BANNED.includes(address.toLowerCase()));
const vaultCreations = (await getCreations(smartVaultManagerContract, provider));
const unindexedVaults = vaultCreations.map(event => event.vaultAddress);
const vaults = [... await getIndexedVaults(), ...unindexedVaults];
const transactions = await addVaultStatus(([... await Promise.all([
getERC20DepositsForVaults(vaults, erc20Tokens, wallet, provider),
Expand Down

0 comments on commit 41733c3

Please sign in to comment.