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

allow empty pool for sushi-swap graph reading. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

noambergIL
Copy link
Contributor

i added an option that if pool is null in graph response it will just calc the harvested. but i'm not sure why pool data is empty.

@noambergIL noambergIL requested review from Rotemy and talkol June 25, 2021 21:44
const sushiPerShare = new BigNumber(user.pool.accSushiPerShare).dividedBy('1e12');
const sushiDebt = new BigNumber(user.rewardDebt).dividedBy('1e18');
const pending = new BigNumber(user.amount).dividedBy('1e18').multipliedBy(sushiPerShare).minus(sushiDebt);

const harvested = new BigNumber(user.sushiHarvested);
const locked = pending.plus(harvested).multipliedBy(2);
return locked;
} else {
return new BigNumber(user.sushiHarvested).multipliedBy(2);
Copy link
Member

Choose a reason for hiding this comment

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

there is no locked sushi program afaik, ended months ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants