Skip to content

Commit 7fdc3a1

Browse files
authored
Elaborated on tx-lifetime analysis (#628)
* Scripts for computing active slots * Generated SVG figures * Computed number of utxos spend when they are created * Documented findings
1 parent 68dad1e commit 7fdc3a1

File tree

8 files changed

+600
-91
lines changed

8 files changed

+600
-91
lines changed

docs/post-cip-findings.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,18 @@ The `linleios` program executes the Markov model for EB production in Linear L
3333

3434
The figure below shows example results for the probability distribution of the number of EBs generated per 100 RBs. This directly relates to Leios efficiency.
3535

36-
![Example results](../analysis/markov/example-results.png)
36+
![Example results](../analysis/markov/example-results.png)
37+
38+
## Analysis of UTxO set size and UTxO lifetime
39+
40+
[Analysis of Cardano mainnet](../post-cip/tx-lifetime/tx-lifetime.ipynb) indicates that the number of active UTxOs has leveled off at approximately 11 million unspent transaction outputs. The data likely is not sufficient to build a statistical model to forecast the size of the UTxO set as a function of demand: a more speculative model would be needed.
41+
42+
![Size of mainnet UTxO set as a function of slot number](../post-cip/tx-lifetime/utxo-set.png)
43+
In terms of lifetime, UTxOs have a trimodal distribution:
44+
- About 3% of UTxOs are spent in the same block that they are created.
45+
- About 65% of the UTxOs are active less than one day.
46+
- The remainder are active for multiple days, sometimes for months or years.
47+
48+
| | |
49+
| --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
50+
| ![Distribution of UTxO lifetime on mainnet (square-root scale)](../post-cip/tx-lifetime/utxo-lifetime-sqrt.svg) | ![Distribution of UTxO lifetime on mainnet (logarithmic scale)](../post-cip/tx-lifetime/utxo-lifetime-log10.svg) |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
psql -f active-slots.sql mainnet
4+
5+
pigz -9fv active-slots.tsv
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
drop table if exists active_slots;
3+
4+
create table active_slots as
5+
select
6+
slot_no
7+
, cast(slot_no - lag(slot_no, 30, null) over (order by slot_no asc) as float)
8+
/ (block_no - lag(block_no, 30, null) over (order by block_no asc))
9+
as slots_per_block
10+
, (block_no - lag(block_no, 30, null) over (order by block_no asc))
11+
/ cast(slot_no - lag(slot_no, 30, null) over (order by slot_no asc) as float)
12+
as blocks_per_slot
13+
from block
14+
where block_no is not null
15+
order by block_no
16+
desc
17+
;
18+
19+
\copy active_slots to 'active-slots.tsv' csv header delimiter E'\t'
20+

post-cip/mempool-measurements/analysis.ipynb

Lines changed: 68 additions & 68 deletions
Large diffs are not rendered by default.

post-cip/tx-lifetime/tx-lifetime.ipynb

Lines changed: 148 additions & 22 deletions
Large diffs are not rendered by default.

post-cip/tx-lifetime/utxo-lifetime-log10.svg

Lines changed: 169 additions & 0 deletions
Loading

post-cip/tx-lifetime/utxo-lifetime-sqrt.svg

Lines changed: 175 additions & 0 deletions
Loading

post-cip/tx-lifetime/utxo-set.png

26.3 KB
Loading

0 commit comments

Comments
 (0)