Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@SmaugPool
SmaugPool / pool_owners_txs.csv
Created February 29, 2024 10:21
Cardano transactions between stake pool owners
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 5 columns, instead of 2. in line 8.
ticker_in,hash_in,ticker_out,hash_out,ada
MIN,ec3308cedfbe904927d51f9a0d9cb93492da29e22e32900f85a15d8c,ARBP,30b950b3afb549a467966978c67e2b8c0e03f7e2776e9a7a84a265ac,113562500
ARBP,30b950b3afb549a467966978c67e2b8c0e03f7e2776e9a7a84a265ac,MIN,ec3308cedfbe904927d51f9a0d9cb93492da29e22e32900f85a15d8c,112313015
RETIR,e778b14f2470ba19be2bcf811837d1f19a9cc912ff2bb6a642f6dd90,ADALO,cdb10209d937fc1559c635e35b9147febde5307b4a7d276f868775cd,73921550
SWM08,9b9f891c4d56f5ce7a3b807dda4253bafdd0c439f46dc037d893a1b1,EMUR8,0ef7aa564933ce75b695cdad66be4a39b43a22726de7c58908e0e033,70186781
RETIR,53195c685e224f2aed5dd8b32ac8eb9a9b569adf05a9300962f3bef5,ADALO,cdb10209d937fc1559c635e35b9147febde5307b4a7d276f868775cd,39701957
SWM08,9b9f891c4d56f5ce7a3b807dda4253bafdd0c439f46dc037d893a1b1,EMUR7,8efb053977341471256685b1069d67f4aca7166bc3f94e27ebad217f,35000001
SKY,4511bcca3896bcb6d43b66fb89fe079f00f44bed505c9ca232704dc9,WAV8,ea00ab4ff7004cc9aafe7a32106afd1e55d5f1c6b5a63224219a78b6,22656425
RETIR,e778b14f2470ba19be2bcf811837d1f19a9cc9
@SmaugPool
SmaugPool / empty_blocks.sql
Last active August 16, 2023 15:36
Cardano empty blocks producers from epoch 400 to 430
SELECT
ticker_name AS ticker,
VIEW,
count AS blocks,
empty_pct AS empty_pct
FROM ( SELECT DISTINCT ON (pool_offline_data.pool_id)
ticker_name,
VIEW,
count,
round(100 * avg, 1) || '%' AS empty_pct
@SmaugPool
SmaugPool / scripts_resources.md
Last active December 17, 2023 22:35
Scripts Memory Units & Execution Steps used by Cardano transactions & blocks

Smart Contracts on Cardano are Plutus scripts. We often talk about the size of transactions and blocks compared to the maximum currently authorized by the protocol parameters, but scripts are also limited in CPU and memory units.

Here is the description of those 3 properties from Cardano docs:

  • The total on-chain transaction size in bytes: a simple transaction, for example, is around 300 bytes, one with metadata is around 650 bytes, and Plutus scripts are typically 4,000-8,000 bytes (future optimizations and improvements will reduce this).
  • The number of computational (CPU) steps that the script uses: each step represents 1 picosecond of execution time on a benchmark machine. Typical scripts should consume less than 1,000,000,000 (1 millisecond).
  • The number of memory units that the script uses: this represents the number of bytes that the script allocates. Typical scripts should consume less than 1,000,000 memory units (
@SmaugPool
SmaugPool / some_cardano_plutus_scripts_addresses.md
Last active March 15, 2022 08:40
Some Cardano Smart Contracts (on-chain validators) Addresses
@SmaugPool
SmaugPool / cardano-db-sync_pool_live_stake.sql
Last active November 1, 2022 23:51
Pool Live Stake with cardano-db-sync 11.0.0
WITH stake AS
(SELECT d1.addr_id
FROM delegation d1, pool_hash
WHERE pool_hash.id=d1.pool_hash_id
AND pool_hash.hash_raw='\xabacadaba9f12a8b5382fc370e4e7e69421fb59831bb4ecca3a11d9b'
AND NOT EXISTS
(SELECT TRUE
FROM delegation d2
WHERE d2.addr_id=d1.addr_id
AND d2.tx_id>d1.tx_id)
@SmaugPool
SmaugPool / 1PCT_Website_FAQ_QA.md
Created November 22, 2020 22:14
1PCT - Re: Questions about your FAQ
for <smaug@pool.pm>; Sun, 22 Nov 2020 20:27:20 +0000 (UTC)

Hi,

As a pool operator concerned by the effectiveness of the Sybil attack you started testing during ITN and the similar strategy you use on mainnet, I have the following questions:

Hi Smaug,

@SmaugPool
SmaugPool / cardano-cli-completion.md
Last active November 29, 2023 11:57
cardano-cli Bash auto-completion

To enable cardano-cli and cardano-node bash auto-completion for the current shell:

source <(cardano-cli --bash-completion-script cardano-cli)
source <(cardano-cli --bash-completion-script cardano-node)

To enable it for all future sessions: