🧭 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

FeatureStatusDescription
Policy purchase⏳ PendingAllow users to buy coverage with premium payment
Claims / payout⏳ PendingAuto payout via trigger or manual approval
Dynamic pricing⏳ PendingTiered plans (Bronze, Silver, Gold)
Indexer + metrics⏳ PendingAggregate and expose on-chain data via API
Frontend syncβš™οΈ In progressWallet 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.