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

feat: adjust pumpbtc adapter #11482

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

xianshui
Copy link

@xianshui xianshui commented Aug 31, 2024

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

PumpBTC

Twitter Link:

https://x.com/Pumpbtcxyz

List of audit links if any:

https://drive.google.com/file/d/1kUmOPM8J63JmzM20H1Cg38oAfPRBJwLy/view?pli=1

Website Link:

https://pumpbtc.xyz/

Logo (High resolution, will be shown with rounded borders):

https://drive.google.com/file/d/1jIj9IwhrEsnMI4BFBF8TYGxQO_uCZ3-s/view?usp=drive_link

Current TVL:

1.14 M

Treasury Addresses (if the protocol has treasury)

Chain:

ETH/BSC/Mantle

Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)

pumpbtc

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

PumpBTC serves as a Liquid Restaking Solution for Babylon. PumpBTC aims to help BTC holders maximize yields through Babylon's liquid staking - essentially rebuilding WBTC with native yield.

Token address and ticker if any:

ETH: 0xf469fbd2abcd6b9de8e169d128226c0fc90a012e
BSC: 0xf9C4FF105803A77eCB5DAE300871Ad76c2794fa4
Mantle: 0xC75D7767F2EdFbc6a5b18Fc1fA5d51ffB57c2B37

Category (full list at https://defillama.com/categories) *Please choose only one:

Liquid Staking

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

TVL for pumpBTC is calculated based on the total value of WBTC, FBTC staked in the contract that were utilized in the minting process of pumpBTC.

Github org/user (Optional, if your code is open source, we can track activity):

https://github.com/pumpbtc/pumpBTC-contract

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

ethereum                  15.20 M
bsc                       4.40 M
mantle                    917.34 k

total                    20.51 M 

}

try {
const res = await axios.get(`https://api.dune.com/api/v1/query/${queryId}/results?limit=1000`, {headers: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @xianshui
total minted - burned will be supply right? We might as we read token supply.I guess the issue here, is no easy way to get babylon staking balance?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @g1nt0ki , thanks for this reply. Yes, (total minted - burned) counts as the total supply in our system. It is definitely no easy way to get babylon staking balance when querying. In this PR, it gets the total staked WBTC/FBTC amount which equal to the total supply of PumpBTC. We still want to know that can we calculating the total supply to represent the TVL?

@g1nt0ki g1nt0ki self-assigned this Sep 3, 2024
@xianshui
Copy link
Author

xianshui commented Sep 3, 2024

hi @g1nt0ki , thanks for this reply. Yes, (total minted - burned) counts as the total supply in our system. It is definitely no easy way to get babylon staking balance when querying. In this PR, it gets the total staked WBTC/FBTC amount which equal to the total supply of PumpBTC. We still want to know that can we calculating the total supply to represent the TVL?

@xianshui xianshui changed the title feat: adjust pumpbtc adapter feat: adjust pumpbtc adapter (please don't merge) Sep 3, 2024
@g1nt0ki
Copy link
Member

g1nt0ki commented Sep 4, 2024

hi @xianshui
I will be honest, I dont like the solution of using token supply as tvl as it is blackbox and no way for us/our users to verify the backing. Since we have no way to fetch data from babylon staking atm, we can use token supply for computing tvl for now

@g1nt0ki
Copy link
Member

g1nt0ki commented Sep 4, 2024

on second thought, would it be possible to get babylon staking addresses via api call? then we can query the balance on bitcoin network and count it as tvl

@xianshui
Copy link
Author

xianshui commented Sep 4, 2024

on second thought, would it be possible to get babylon staking addresses via api call? then we can query the balance on bitcoin network and count it as tvl

@g1nt0ki do you mean an API that from our own PumpBTC staking system?

@g1nt0ki
Copy link
Member

g1nt0ki commented Sep 4, 2024

yeah, or a json file in a git repo controlled by your team that you update periodically and we read to get bitcoin address list

@xianshui
Copy link
Author

xianshui commented Sep 4, 2024

yeah, or a json file in a git repo controlled by your team that you update periodically and we read to get bitcoin address list

@g1nt0ki Sorry that currently it is no not possible to return the babylon staking addresses via api call. The reason is that this system is a restaking system, how the coins staked in Babylon is a core strategy of the system which is not suitable to published publicly(it would be analyzed and copied by the industry competitor).

@g1nt0ki
Copy link
Member

g1nt0ki commented Sep 4, 2024

returning list of btc adddreses is dangerous?

@xianshui
Copy link
Author

xianshui commented Sep 4, 2024

hi @xianshui I will be honest, I dont like the solution of using token supply as tvl as it is blackbox and no way for us/our users to verify the backing. Since we have no way to fetch data from babylon staking atm, we can use token supply for computing tvl for now

Understanding your concern. Actually we provide a transparency board site every user can access, it show all the asset on the platform. Its url is: https://dashboard.pumpbtc.xyz/ . How do you think that we change the query method and get the data from this site as another way, is that ok?

@g1nt0ki
Copy link
Member

g1nt0ki commented Sep 4, 2024

but in your dashboard, most of it is in the native BTC whose backing we cant check

@g1nt0ki
Copy link
Member

g1nt0ki commented Sep 4, 2024

Lombard is a similar product right?t they just provided an api to pull btc address list

@xianshui
Copy link
Author

xianshui commented Sep 6, 2024

Lombard is a similar product right?t they just provided an api to pull btc address list

@g1nt0ki Seems it is a similar product. But as mentioned before, our platform will not release the staking addresses publicly currently, so this solution will not work for us.

@xianshui
Copy link
Author

xianshui commented Sep 6, 2024

@g1nt0ki So can we just counting the total supply of PumpBTC instead ?

@Define101
Copy link
Member

@xianshui no. If you cant provide /release the btc wallets we are not able to track it .

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

bitcoin                   815.26 k
ethereum                  667.49 k
mantle                    239.50 k
bsc                       125.57 k

total                    1.85 M 

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

ethereum                  666.39 k
bitcoin                   652.19 k
mantle                    239.50 k
bsc                       125.57 k

total                    1.68 M 

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

bitcoin                   815.50 k
ethereum                  666.39 k
mantle                    239.50 k
bsc                       125.57 k

total                    1.85 M 

@xianshui
Copy link
Author

xianshui commented Sep 8, 2024

@xianshui no. If you cant provide /release the btc wallets we are not able to track it .

hi @g1nt0ki @Define101 After discussion in the team, we released the staking BTC address list and return it through an API, but currently it is still not able to get the BTC balance with its address in Defillama executing platform, could we return this part of amount through our API? Or is there any other better suggested method to do this?

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

bitcoin                   824.67 k
ethereum                  675.71 k
mantle                    246.50 k
bsc                       126.78 k

total                    1.87 M 

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

ethereum                  675.50 k
mantle                    246.50 k
bsc                       126.89 k
bitcoin                   0

total                    1.05 M 

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

bitcoin                   820.39 k
ethereum                  671.42 k
mantle                    246.01 k
bsc                       126.62 k

total                    1.86 M 

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

bitcoin                   829.89 k
ethereum                  680.85 k
mantle                    295.80 k
bsc                       127.93 k

total                    1.93 M 


const btcAddresses = res.data.data.details.btc.details.filter(i => +i.amount > 0).map(d => d.address)
const babylonAddresses = res.data.data.details.babylon.details.filter(i => +i.amount > 0).map(d => d.address)
return [... new Set(btcAddresses.concat(babylonAddresses))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @xianshui I noticed that addresses are duplicated between btc & babylon, so refactored to remove duplicates.

Checked a few addresses randomly, the value match the one returned by our api?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @g1nt0ki, thanks for the modification. I checked some addresses both in btc address list and babylon address list, the values for the btc address list match. But the values for the babylon address list does not match, for instance the actual balance of an address is 0.05, but the platform api sumTokens returns 0, that made us can not count the balance staked in babylon chain. This is the point we need to handle, could we return the total amount of the babylon part through our API? Or is there any other better suggested method to do this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xianshui sorry, missed this comment, sorry to keep bothering you but can you update the api to return the babylon addresses as well?
We are caching api response, so, would be fine even if api goes down. but if rely on number from api, we are lost if api becomes inaccessible

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @g1nt0ki , we update the api to return the babylon addresses, please have a check and merge the PR, thanks.

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

bitcoin                   829.50 k
ethereum                  680.09 k
mantle                    295.80 k
bsc                       127.93 k

total                    1.93 M 

@xianshui
Copy link
Author

xianshui commented Sep 9, 2024

hi @g1nt0ki, thanks for the modification. I checked some addresses both in btc address list and babylon address list, the values for the btc address list match. But the values for the babylon address list does not match, for instance the actual balance of an address is 0.05, but the platform api sumTokens returns 0, that made us can not count the balance staked in babylon chain. This is the point we need to handle, could we return the total amount of the babylon part through our API? Or is there any other better suggested method to do this?

@g1nt0ki
Copy link
Member

g1nt0ki commented Sep 9, 2024

@xianshui are the babylon addresses correct? because right now, it is the same as bitcoin addresses

@g1nt0ki
Copy link
Member

g1nt0ki commented Sep 9, 2024

like babylon has this address: bc1pl2q2qa6pne4549psz3aaq34trxa5y44ahyhppqcnc4dny7udap7qhkcnzu but maybe it should be bc1p07t86u5qfsulvd4a86j27a62qqhqaqldwypfaugwhthphzr2f8fqye02dj?

@xianshui
Copy link
Author

like babylon has this address: bc1pl2q2qa6pne4549psz3aaq34trxa5y44ahyhppqcnc4dny7udap7qhkcnzu but maybe it should be bc1p07t86u5qfsulvd4a86j27a62qqhqaqldwypfaugwhthphzr2f8fqye02dj?

@g1nt0ki yes, we noticed that. The BTC is not on the staker address after staking in babylon. I would like to know that if it is not able to get the addresses with btc stored in babylon, can we count all of the staked BTC in babylon (this data is recored) and return it in the API?

@llamatester
Copy link

The adapter at projects/pumpbtc exports TVL:

bitcoin                   50.29 M
ethereum                  1.02 M
mantle                    366.81 k
bsc                       144.49 k

total                    51.82 M 

@xianshui
Copy link
Author

hi @g1nt0ki, we have update the BTC Staking addresses through a new API, please have a look and merge the PR, thanks.

@xianshui xianshui changed the title feat: adjust pumpbtc adapter (please don't merge) feat: adjust pumpbtc adapter Sep 18, 2024
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