π§ Overview
SPARQ Shield is a Solana-based decentralized protection protocol designed to provide automated on-chain coverage for DeFi users and protocols. Itβs part of the Coinsparq ecosystem, which focuses on transparent, user-friendly crypto solutions.
This repository contains the smart contract (Anchor), Node.js testing scripts, and frontend integration references for the SPARQ Shield MVP.
π§± Project Structure
/clean
βββ Anchor.toml
βββ Cargo.toml
βββ programs/
β βββ sparq_shield/
β βββ src/
β β βββ lib.rs
β βββ Cargo.toml
βββ target/ (generated after build)
βββ tests/
β βββ state.json
β βββ init_pool_tx.js
β βββ mint_and_deposit_tx.js
β βββ withdraw_tx.js
β βββ …
βββ package.json
π§° Environment Setup
1. Install dependencies
sudo apt update && sudo apt install -y build-essential pkg-config libssl-dev jq
2. Install Rust + Solana + Anchor
curl https://sh.rustup.rs -sSf | sh-s—y
source$HOME/.cargo/env
sh-c”$(curl -sSfL https://release.solana.com/v1.18.17/install)”
cargo install –git https://github.com/coral-xyz/anchor avm –locked–force
avm install 0.30.1
avm use 0.30.1
3. Check versions
anchor –version# should show anchor-cli 0.30.x
solana –version# e.g., 2.3.x
rustc –version# e.g., 1.81.0
4. Local validator setup
solana-test-validator –reset–bpf-program <PROGRAM_ID> target/deploy/sparq_shield.so
5. Configure wallet
solana config set–url localhost
solana-keygen new –outfile ~/.config/solana/id.json
βοΈ Build & Deploy
anchor build
anchor deploy
Once built successfully, check for:
target/deploy/sparq_shield.so
target/idl/sparq_shield.json
Then update your tests/state.json with the latest program ID and PDA addresses.
π§© Current Features
- Pool initialization via PDA
- Deposit and withdraw logic using SPL Token CPI
- Token vault ATA creation (off-curve enabled)
- Anchor + Node.js testing scripts for integration
π§ Remaining Development
| Feature | Status | Description |
|---|---|---|
| Policy purchase | β³ Pending | Allow users to buy coverage with premium payment |
| Claims / payout | β³ Pending | Auto payout via trigger or manual approval |
| Dynamic pricing | β³ Pending | Tiered plans (Bronze, Silver, Gold) |
| Indexer + metrics | β³ Pending | Aggregate and expose on-chain data via API |
| Frontend sync | βοΈ In progress | Wallet connect + policy display + metrics integration |
π§Ύ Deployment Targets
- Localnet β for development & simulation
- Devnet β for public testing & frontend integration
Program ID (current dev build):
H8w6Qkb9QpdsujfjKVXBqN7E8AoE6EvMVDEJS1XuDw2S
π Related Repositories / Links
- Frontend: https://coinsparq.com
- Docs:
/canmore/sparq_dev_onboarding_brief - Job Post:
/canmore/sparq_job_post_draft - Team Contact: Peter (alias: Sparq)
π§ Notes for New Developers
- Ubuntu (via WSL) occasionally shuts down unexpectedly β use
wsl --shutdown+ restart if build fails. - Keep
target/deploy/backed up between builds. - Always verify PDAs after each redeploy using
solana address -k target/deploy/sparq_shield-keypair.json.
β Goal for Handoff Developer
Deliver a fully functional MVP with on-chain logic, off-chain metrics API, and frontend wallet integration on Devnet β matching all functional promises on Coinsparq.com.