This repository was archived by the owner on Dec 11, 2025. It is now read-only.
forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
Calculate TVL across all chains #1
Open
zajck
wants to merge
5
commits into
main
Choose a base branch
from
boson-tvl-adapter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+309
−2
Conversation
This file contains hidden or 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
projects/boson/index.js
Outdated
Comment on lines
86
to
95
| // staking: staking( | ||
| // [ | ||
| // "0x6244bc0d4b661526c0c62c3610571cd1ac9df2dd", | ||
| // "0xbacc083795846a67b0782327a96622447ddafe6c", | ||
| // "0x081a52f02e51978ad419dd7894d7ae3555f8bc26", | ||
| // "0x3ed0c99c8e8eb94438837cc8a08ca3bb187424cf", | ||
| // "0x3810d9d6685812af6ef4257de0542ecdba9bfd95" | ||
| // ], | ||
| // "0xC477D038d5420C6A9e0b031712f61c5120090de9" | ||
| // ), |
Member
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.
Suggested change
| // staking: staking( | |
| // [ | |
| // "0x6244bc0d4b661526c0c62c3610571cd1ac9df2dd", | |
| // "0xbacc083795846a67b0782327a96622447ddafe6c", | |
| // "0x081a52f02e51978ad419dd7894d7ae3555f8bc26", | |
| // "0x3ed0c99c8e8eb94438837cc8a08ca3bb187424cf", | |
| // "0x3810d9d6685812af6ef4257de0542ecdba9bfd95" | |
| // ], | |
| // "0xC477D038d5420C6A9e0b031712f61c5120090de9" | |
| // ), |
levalleux-ludo
approved these changes
Nov 14, 2025
levalleux-ludo
approved these changes
Nov 21, 2025
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TVL methodology
Get the total value of all encumbered funds and reduce them for the value of funds that were released upon exchange finalisation. This covers all active exchanges, regardless if the offer is fixed price or price discovery. It also includes sequential commits.FundsEncumberedandFundsDepositedevents to get the list of unique token addresses. Then it uses defillama's helper function to sum balances. Both events must be used (FundsEncumberedcatches tokens for offers without seller deposit, whileFundsDepositedcatches offers where no exchange was made yet).If the quantity available is known, first reduce it by the number of commits for that offer to reduce double-counting (commits are already included in step 1.). Calculate TVL asuncommitedQuantity*(price+sellerDeposit+disputeResolverfee)(the value that would be encumbered if someone commits to the offer)If the quantity available is unlimited, check if some rNFTs were preminted. This value is equivalent to quantity available for limited offers. Check if any commit belongs to the range and deduce the uncommitted quantity. Calculate TVL in the same way as in 2.3. If there were any additional commits in addition to the preminted range, they are already included in step 1.priceto TVL (ignore the quantity).