Skip to content

Conversation

@waynebruce0x
Copy link
Collaborator

No description provided.

processor: (vault: string) => fetchVaultPositions(vault, false),
});

async function fetchVaultPositions(vault: string, isCurrent: boolean) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have two flows, simpler one for vaults with less than 5M tvl or borrowed less than 80% and stricter check for the rest?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have something in mind for how this could be simpler? Would this still be for marking down bad debt vaults?

symbol,
timestamp,
"morpho",
1.01
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is to ensure that it never gets overwritten?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah

attributes: { symbol = undefined, quote_currency = undefined } = {},
}: any = {}) => {
if (!id || !symbol || quote_currency !== "USD") return;
feeds.push({ id: "0x" + id, symbol: symbol.replace(/\//g, ":") } as any);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace it with this

const formattedSymbol = symbol.replace(/\//g, ":");
feeds.push({ id: "0x" + id, symbol: formattedSymbol, generic_symbol: formattedSymbol });

because you're not assigning generic_symbol there, yet you're trying to access it later
const { symbol, generic_symbol } = feeds[idx]; → undefined issue

const metadata = await getTokenInfoMap(api.chain, problemVaultList);

const writes: Write[] = [];
problemVaultList.map(async (vault: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small optimization detail here: use forEach instead of map because you're not returning anything. You're using side effects (on writes) rather than transforming the array directly, so map is unnecessary since it’s meant to return data from the array transformation, which isn’t the case here

@0xpeluche 0xpeluche merged commit b274439 into master Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants