# 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 <= '2023-08-18 21:00' 
    order by slot_no desc limit 1 ;
```

The result will be:&#x20;

```
100826079,2023-08-18 20:59:30.000000
```

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

### 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-100826079.json --min-slot 0 --max-slot 100826079 --network-id mainnet
```

This will produce three files:

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

### Processing the snapshot with Fund 10 parameters

This filters registrations for minimum allowed voting power:

Run:

```sh
./target/release/catalyst-toolbox sve-snapshot --file cexplorer-100826079.json --discrimination production --min-stake-threshold 450000000 --output-format json --lovelace > cexplorer-100826079.final.json
```

This produces the final snapshot: `cexplorer-100826079.final.json`

## Official Snapshot Artifacts

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

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