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

Adding mainstreet TVL adapter. #14084

Merged
merged 1 commit into from
Apr 10, 2025
Merged

Adding mainstreet TVL adapter. #14084

merged 1 commit into from
Apr 10, 2025

Conversation

0xSpartan
Copy link
Contributor

NOTE

Please enable "Allow edits by maintainers" while putting up the PR.


  • If you would like to add a volume adapter please submit the PR here.
  • If you would like to add a liquidations adapter, please refer to this readme document for details.
  1. Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.
  2. Sorry, We no longer accept fetch adapter for new projects, we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
  3. Please fill the form below only if the PR is for listing a new protocol else it can be ignored/replaced with reason/details about the PR
  4. For updating listing info It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data2.ts, you can edit it there and put up a PR
  5. Do not edit/push package-lock.json file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CI
  6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap

Name (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):

mainStreet-white

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):

@llamabutler
Copy link

The adapter at projects/mainstreet exports TVL:

sonic                     53.83 k

total                    53.83 k 

}

async function tvl(api) {
const supply = await api.call({ abi: 'uint256:totalSupply', target: '0xc2896AA335BA18556c09d6155Fac7D76A4578c5A' })
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@waynebruce0x waynebruce0x self-assigned this Mar 31, 2025
@Define101
Copy link
Member

@0xSpartan what is the exchange you are basis trading? What are all the wallets involved?
This is empty https://blockscan.com/address/0x5eb037dccef333ea821eda2e40e9441fc1fe3ac1#transactions

@Define101 Define101 self-assigned this Apr 4, 2025
@0xSpartan
Copy link
Contributor Author

@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.

@0xSpartan
Copy link
Contributor Author

@Define101 nudging

@Define101 Define101 merged commit ff5147a into DefiLlama:main Apr 10, 2025
1 check passed
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.

4 participants