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

fix: use same TVL formula as front-end #13684

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

vicenteguedes
Copy link

Adjust calculation for TVL to match what's displayed by the front-end.

@llamabutler
Copy link

The adapter at projects/SmarDex exports TVL:

ethereum-staking          30.05 M
staking                   30.05 M
ethereum                  7.87 M
arbitrum                  565.42 k
bsc                       426.98 k
base                      376.61 k
polygon                   75.39 k

total                    9.31 M 

@waynebruce0x waynebruce0x self-assigned this Feb 27, 2025
getBalanceLong: BigInt(balanceLong.output),
rebalancerPendingAssets: BigInt(rebalancerCurrentStateData.output[0]),
wstEthPrice: formattedWstEthPrice,
};
Copy link
Collaborator

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?

Copy link
Contributor

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,
Copy link
Collaborator

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

Copy link
Contributor

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.

Copy link
Collaborator

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

correct !

Copy link
Contributor

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 ?

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