-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NNS1-3281: Add function to get TVL (#5406)
# Motivation The NNS dapp displays the USD value of the total amount of ICP locked in neurons. It gets this information from the TVL canister but we want to move this functionality to the nns-dapp canister and remove the TVL canister. There are 2 inputs to this data: 1. The amount of ICP locked in neurons 2. The price of ICP in USD. We already have functions which periodically fetch this data and store it in the canister state. This PR adds a function to get the TVL calculated from these 2 inputs. # Changes Add `get_tvl` which returns the current TVL. The return type is the way it is to make it compatible with the existing TVL canister. This allows us to migrate the frontend from using the TVL canister to getting the same data from the nns-dapp canister without changing frontend code. # Tests 1. Unit test added. 2. Tested manually in another branch which has more changes. 3. Will add an integration test when the feature is ready. # Todos - [ ] Add entry to changelog (if necessary). not yet.
- Loading branch information
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters