-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix: use same TVL formula as front-end #13684
base: main
Are you sure you want to change the base?
Conversation
Feat/support base
* fix: use same formula as blockchain to get tvl * fix: use wstEthPrice from defillama * fix: get full smardex tvl
The adapter at projects/SmarDex exports TVL:
|
getBalanceLong: BigInt(balanceLong.output), | ||
rebalancerPendingAssets: BigInt(rebalancerCurrentStateData.output[0]), | ||
wstEthPrice: formattedWstEthPrice, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are balanceVault, balanceLong, rebalancerCurrentStateData counting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are the amount of wstETH locked in USDN protocol contract for Vault, Long and Rebalancer entities: https://docs.smardex.io/ultimate-synthetic-delta-neutral/the-usdn-protocol/protocol-balance
|
||
return { | ||
...uniTVL, | ||
[`ethereum:${USDN_TOKEN_ADDRESS}`]: usdnTVL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd make more sense to export this as a wstETH balance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree. We want to combine SMARDEX DEX TVL and SMARDEX USDN TVL and present the amount in USD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will still show a USD amount on our UI but the TVL is held as wstETH as far as I can tell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a difference for you to record USD or wstETH ?
Adjust calculation for TVL to match what's displayed by the front-end.