Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Balance of At Scaled as well as erc721 collateral held #1327

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

publu
Copy link
Contributor

@publu publu commented Oct 19, 2023

Fixes # .

Changes proposed in this pull request:

  • fixed erc721 held (qidao vaults)
  • added balance of at scaled

Copy link
Member

Choose a reason for hiding this comment

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

Hi @publu One PR should contain changes of one strategy only.

Comment on lines +20 to +34
const blockTag =
typeof snapshot === 'number' ? snapshot : await provider.getBlockNumber();

const multi = new Multicaller(network, provider, abi);
addresses.forEach((address) =>
multi.call(address, options.address, 'balanceOfAt', [address, blockTag])
);
const result: Record<string, BigNumberish> = await multi.execute();

return Object.fromEntries(
Object.entries(result).map(([address, balance]) => [
address,
parseFloat(formatUnits(balance, options.decimals)) * options.scaleValue
])
);
Copy link
Member

Choose a reason for hiding this comment

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

You could you math strategy for this @publu let me know if you have some trouble doing so :)

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.

2 participants