-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add Beracana Protocol TVL on Berachain #14520
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
Conversation
The adapter at projects/beracana exports TVL:
|
projects/beracana/index.js
Outdated
const { banks, vaults } = await getContracts(); | ||
const tokens = banks.map(i => i.token) | ||
const bankAddresses = banks.map(i => i.bank) | ||
const currentFunds = await api.multiCall({ abi: 'function currentFunds() view returns (uint256)', calls: bankAddresses }) |
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.
can we use erc20:balanceOf rather than currentFunds() and totalFunds() ?
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.
Hey we can't use erc20:balanceOf directly because
currentFunds() returns the amount of funds available to borrow in the bank, while totalFunds() returns the total amount the bank controls: both the available funds plus the amount already lent out as debt.
Since funds are distributed across different vaults and not just held in the contract itself, there's no single balanceOf function that can accurately reflect the true total value locked (TVL). That’s why we need these custom functions—to get the full picture across all assets, not just what’s sitting in the contract.
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.
please export currentFunds() as tvl
and the difference between totalFunds() and currentFunds() as borrowed
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.
Hey Our protocol has a utilization of 98% so the TVL would not be reflective of the actual value locked in the protocol.
There is way to do looping in our protocol because we only allow borrows that go into vaults within our own protocol.
We can either add the borrowed value to the TVL, or if you prefer, we can include the vaults in the TVL where the entirety of the borrowed amount resides.
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.
do the tokens sit in the vault contracts? what do the vaults do?
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.
the vaults convert tokens to lp for farming and auto compound the earned rewards
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.
okay lets try counting the vault assets instead
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.
Hey , sorry for the delay , pushed the changes let me know if this works .
Thanks
The adapter at projects/beracana exports TVL:
|
Name (to be shown on DefiLlama): Beracana
Twitter Link: https://x.com/beracana
List of audit links if any: https://app.beracana.com/beracana-audit.pdf
Website Link: https://beracana.com/
Logo (High resolution, will be shown with rounded borders): https://app.beracana.com/beracana.png
Current TVL: 16.36 k
Treasury Addresses (if the protocol has treasury)
Chain: Berachain
Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama):Beracana focuses on providing users with a way to amplify their gains while participating in the Berachain ecosystem. At its core, Beracana facilitates undercollateralized lending, meaning users can deposit assets and borrow more than the value of their initial deposit, up to 5x the leverage.
Token address and ticker if any:
Category (full list at https://defillama.com/categories) *Please choose only one: Leveraged Farming
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.):
Implementation Details: Briefly describe how the oracle is integrated into your project:
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:
forkedFrom (Does your project originate from another project):
methodology (what is being counted as tvl, how is tvl being calculated):
Github org/user (Optional, if your code is open source, we can track activity): AuroBlocks-Studios