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

[Request feature] Chart that shows the last movement of CKBytes in existence #424

Closed
alejandroRbit opened this issue Sep 5, 2023 · 12 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@alejandroRbit
Copy link

alejandroRbit commented Sep 5, 2023

I recently wrote this article (https://www.nervos.org/knowledge-base/surprisingly_secondary_issuance_is_not_inflationary) in which I try to explain how the loss of coins affects the total spendable CKBytes over time. As a result of this article, I think it would be interesting for the community to have a chart in the CKB explorer that shows the liquidity of the network but taking into account how this liquidity moves over time. For example, we could display how many CKBytes have been moved in the last year, how many CKBytes have not been moved for X years, etc. In fact, Glassnode has similar charts like "Hold Wave" and "Hodled or lost coins" (we don't have to call it the same way, we simply show the temporalities and let the reader draw his own conclusions. It doesn't have to be the same either, it's just an example):

hold waves

Thanks to NervosDAO we can better identify and represent saving behaviors in the network compared to Bitcoin, but I think adding temporalities would add a richer and more nuanced view of network liquidity, especially to liquid CKBs that are not in the DAO, i.e. those CKBytes with transactional priorities. CKB economic model is richly nuanced and this type of chart can help community members understand it better. I also think it would be a good complement and contextualizes this other chart: https://explorer.nervos.org/charts/liquidity.

Some reference articles on this topic:
Bitcoin Data Science (Pt. 1): HODL Waves
Bitcoin Data Science (Pt. 2): The Geology of Lost Coins
Bitcoin Data Science (Pt. 3): Dust & Thermodynamics
A Primer on Bitcoin Investor Sentiment and Changes in Saving Behavior

@alejandroRbit alejandroRbit changed the title [Request feature] Chart that shows the last movement of the CKBytes in existence [Request feature] Chart that shows the last movement of CKBytes in existence Sep 5, 2023
@Keith-CY Keith-CY added the documentation Improvements or additions to documentation label Sep 6, 2023
@Danie0918 Danie0918 moved this to 📌Planning in CKB Explorer Oct 30, 2023
@poor-defined
Copy link
Contributor

@Keith-CY @Kirl70
We can make a similar chart like the one above with some little changes. Proposal here.

@Keith-CY
Copy link
Member

@Keith-CY @Kirl70 We can make a similar chart like the one above with some little changes. Proposal here.

LGTM

@zmcNotafraid
Copy link
Member

zmcNotafraid commented Dec 18, 2023

PR: nervosnetwork/ckb-explorer#1534


  • API
curl --location --request GET 'https://ckb-explorer-api.staging.layerview.io/api/v1/statistics/ckb_hodl_waves' \                   
--header 'Content-Type: application/vnd.api+json' \--header 'Accept: application/vnd.api+json'

{"data":{"id":"1","type":"statistic","attributes":{"ckb_hodl_waves":{"latest_day":"152030773.52948624","updated_at":1702957156,"total_supply":"40852833513.19522553","day_to_one_week":"103991882.93154158","over_three_years":"19539412295.26189161","one_week_to_one_month":"455724216.73713526","six_months_to_one_year":"19610055191.11351636","one_year_to_three_years":"23338728323.07790978","one_month_to_three_months":"816836356.02697056","three_months_to_six_months":"2220316233.84348105"}}}}%

@zmcNotafraid zmcNotafraid moved this from 🏗 In Progress to 🔎 Code Review in CKB Explorer Dec 18, 2023
@Keith-CY
Copy link
Member

The API is ready, we may start the UX @Sven-TBD

@poor-defined
Copy link
Contributor

poor-defined commented Jan 22, 2024

Okay. The front-end work of issue has been delegated to @zmcNotafraid , coz it's not a high priority work, and Mingchang finished the backend

Do we still need a UI for this one as well? Something like the color for the Chart

@poor-defined poor-defined moved this from 🔎 Code Review to 📌Planning in CKB Explorer Jan 22, 2024
@zmcNotafraid zmcNotafraid moved this from 📌Planning to 🏗 In Progress in CKB Explorer Jan 23, 2024
@zmcNotafraid
Copy link
Member

image

@poor-defined poor-defined moved this from 🚩Pre Release to 🔎 Code Review in CKB Explorer Feb 26, 2024
@zmcNotafraid
Copy link
Member

zmcNotafraid commented Feb 26, 2024

In above chart, we needs to calcuate every day's different time range live cell's capacity as
numerator.To get the ratio, we use every day's tip dao's C_i as denominator.But from the chart we can see, the all time range ratio's sum is less than 100%. So which dao's column should we use as denominator?

@zmcNotafraid zmcNotafraid moved this from 🔎 Code Review to 📫Hold On in CKB Explorer Mar 4, 2024
@poor-defined poor-defined moved this from 📫Hold On to 🏗 In Progress in CKB Explorer Mar 4, 2024
@Keith-CY
Copy link
Member

Keith-CY commented Mar 5, 2024

In above chart, we needs to calcuate every day's different time range live cell's capacity as numerator.To get the ratio, we use every day's tip dao's C_i as denominator.But from the chart we can see, the all time range ratio's sum is less than 100%. So which dao's column should we use as denominator?

Based on the distribution mentioned at #424 (comment)

dao.c includes total live cells, unclaimed dao rewards, burned to treasury.
dao.s includes unclaimed dao rewards, burned to treasury

The chart is about live_cells_in_app / total_live_cells, so the denominator should be total live cells, which is dao.c - dao.s

@poor-defined poor-defined moved this from 🏗 In Progress to 📌CurrentWeek in CKB Explorer Apr 29, 2024
@zmcNotafraid zmcNotafraid moved this from 📌CurrentWeek to 🏗 In Progress in CKB Explorer Apr 29, 2024
@poor-defined poor-defined removed their assignment May 6, 2024
@poor-defined poor-defined moved this from 🏗 In Progress to 📌CurrentWeek in CKB Explorer May 13, 2024
@zmcNotafraid
Copy link
Member

zmcNotafraid commented May 16, 2024

mainnet

block_0: #<OpenStruct c_i=3360000145238488200, ar_i=10000000000000000, s_i=35209330473, u_i=504120308900000000>
block_1: #<OpenStruct c_i=3360000290476976400, ar_i=10000000104789669, s_i=65136000891, u_i=504120308900000000>
- - -
block_0's live_cell_outputs in database capacity: 3360000000000000000
block_0_live_cells_capacity = [c_i] - [s_i] = 3360000110029157727
block_1's live_cell_outputs in database capacity: 0
block_1_live_cells_capacity = [c_i] - [s_i] = 3360000225340975509
---
But block 1 only have 1 tx that with no cell_outputs, so  why it increase capacity?

https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0023-dao-deposit-withdraw/0023-dao-deposit-withdraw.md#calculation
C_i : C_{i-1} + p_i + s_i

@zmcNotafraid

This comment was marked as resolved.

@zmcNotafraid
Copy link
Member

After research, we can't directly get live cell ouputs capacity from dao field.So we use our explorer's data as taotal live cell capacity.

@zmcNotafraid zmcNotafraid moved this from 📌CurrentWeek to 🔎 Code Review in CKB Explorer Jun 24, 2024
@zmcNotafraid zmcNotafraid moved this from 🔎 Code Review to ✅ Done in CKB Explorer Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: ✅ Done
Development

No branches or pull requests

6 participants
@Keith-CY @zmcNotafraid @poor-defined @alejandroRbit @Danie0918 and others