# Reproducing the Snapshot

### Getting the Registration Deadline slot number

Getting the `slot_no` aligned with the registration deadline.

Query the dbSync database with:

```sql
select slot_no, time from block 
    where slot_no is not null and time <= '2024-01-15 21:45:00' 
    order by slot_no desc limit 1 ;
```

The result will be:&#x20;

```
113788796,2024-01-15 21:44:30.000000
```

Therefore the `slot#` that the snapshot needs to target is: 113788796

### Running the Raw snapshot

The first part of the snapshot accumulates raw registration and staked ada information and validates it according to [CIP-15 ](https://cips.cardano.org/cips/cip15/)and [CIP-36](https://cips.cardano.org/cips/cip36/). &#x20;

*Note: Multiple delegations, as specified by CIP-36, are not supported.  These will be detected as invalid registrations.  Only registrations that contain a single voting key are supported and valid.*

Run (replace your credentials as appropriate):&#x20;

```sh
export USERNAME=<Your dbSync postgresql Username>
export PASSWORD=<Your dbSync postgresql Password>
export DBSYNC_POSTGRES="localhost:5432"
./target/release/snapshot_tool --db cexplorer --db-user $USERNAME --db-pass $password --db-host $DBSYNC_POSTGRES --out-file ./cexplorer-113788796.json --min-slot 0 --max-slot 113788796 --network-id mainnet
```

This will produce three files:

* `cexplorer-113788796.json` <- Raw Snapshot Data
* `cexplorer-113788796.unregistered.json` <- Unregistered but staked ADA.
* `cexplorer-113788796.errors.json` <- Errors or Obsolete registrations.

### Processing the snapshot with Fund 11 parameters

This filters registrations for minimum allowed voting power:

Run:

```sh
./target/release/catalyst-toolbox snapshot --snapshot cexplorer-113788796.json --min-stake-threshold 450000000 --slot-no 113788796 cexplorer-113788796.final.json
```

This produces the final snapshot: `cexplorer-113788796.summary.json`

## Official Snapshot Artifacts

As soon as the official snapshot artifacts that will be used for Fund 11 are available, they will be linked to here.

It is possible to run the snapshot independently until they are published.
