-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Adding mainstreet TVL adapter. #14084
Conversation
The adapter at projects/mainstreet exports TVL:
|
} | ||
|
||
async function tvl(api) { | ||
const supply = await api.call({ abi: 'uint256:totalSupply', target: '0xc2896AA335BA18556c09d6155Fac7D76A4578c5A' }) |
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 here 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.
I'm assuming you're referring to using USDC.balanceOf(contract), but the USDC is immediately moved out of the contract into custodial wallets. Using totalSupply makes more sense in this case.
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.
are there any third parties who can verify the balance of the custodial wallets?
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.
Not sure what you mean by this. The assets are moved to generate yield in various places so tracking those balances would be tedious. Ethenafi also uses totalSupply for their tvl.
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.
How can we verify that each token is backed by a real dollar?
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.
Each token is minted 1:1 with USDC.
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 need you to be more specific on the actual issue as this is time sensitive. Ethena, Resolv, and Astherus all use the methodology I used to track TVL. We mint 1 msUSD per 1 USDC. Rewards are rebased based on the USDC earnings of our basis trades. Therefore every msUSD minted is always backed by 1 USDC.
@0xSpartan what is the exchange you are basis trading? What are all the wallets involved? |
@Define101 We use Binance right now. You can see here the tx used to send our initial liquidity into binance. https://etherscan.io/tx/0x498d407108bbf2a0702c5e4ebb9aa602cc079ad76b8fba9f4ee7ba14835ede24 The address you sent (Our ceffu address) was generated after our initial mint so currently it's empty, but won't be for long. It'll be used for future mints. |
@Define101 nudging |
NOTE
Please enable "Allow edits by maintainers" while putting up the PR.
package-lock.json
file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CIName (to be shown on DefiLlama): Mainstreet
Twitter Link: https://x.com/Main_StFinance
List of audit links if any: NA
Website Link: https://mainstreet.finance/
Logo (High resolution, will be shown with rounded borders):
Current TVL: ~54k
Treasury Addresses (if the protocol has treasury): NA
Chain: Sonic
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): Rebasing synthetic dollar
Token address and ticker if any: $msUSD https://sonicscan.org/address/0xc2896AA335BA18556c09d6155Fac7D76A4578c5A#readProxyContract
Category (full list at https://defillama.com/categories) *Please choose only one: Basis Trading
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.): NA
Implementation Details: Briefly describe how the oracle is integrated into your project: NA
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage: NA
forkedFrom (Does your project originate from another project): EthenaFi
methodology (what is being counted as tvl, how is tvl being calculated): The amount of msUSD minted is 1:1 with the amount of USDC deposited into the protocol. So this method simply just calls msUSD::totalSupply to fetch the TVL of the protocol.
Github org/user (Optional, if your code is open source, we can track activity):