Skip to content

Comprehensive testing & validation framework for DeFi trading strategies. 14 categories, 3 certification levels, production-validated.

License

Notifications You must be signed in to change notification settings

VaultBricks/DSS

Repository files navigation

DeFi Strategy Standard (DSS)

Comprehensive testing & validation framework for DeFi trading strategies

Version License Status Documentation SDK MAS Compatible ERC4626
Tests Security Docs


Overview

The DeFi Strategy Standard (DSS) is the industry standard for validating DeFi trading strategies. DSS introduces a streamlined 14-point architecture focused on code quality, economic soundness, interoperability, and developer experience.

NEW in v1.2.0: DSS SDK & Tooling - Build DSS-compliant strategies with ready-to-use contracts, testing utilities, and CLI tools!

DSS combines:

  • Developer Tools: SDK with contracts, testing framework, and CLI for rapid development.
  • Rigorous Validation: DSS architecture with strict coverage requirements.
  • Interoperability: Native support for ERC-4626 and MAS (Multi-Asset Standard).
  • 2025 Best Practices: Formal verification, mutation testing, and full invariant coverage.

Why DSS?

The Problem: The DeFi industry lacks standardized testing practices. Most protocols launch with:

Common Practice Risk
"Audit coming soon" Unverified code handling user funds
40-60% test coverage Critical paths untested
No fuzzing Edge cases undiscovered
No backtesting Strategy performance unknown
No operational procedures Incident response undefined

The Solution: DSS provides a complete framework that standardizes:

  1. What to test — Specific categories (DSS-1 through DSS-14)
  2. How much to test — Quantitative coverage metrics per certification level
  3. How to validate — Economic and market condition testing
  4. How to operate — Deployment and monitoring standards
  5. How to govern — Upgrade and documentation requirements

Framework Structure (DSS 1-14)

DSS organizes requirements into 14 Functional Categories:

Core Engineering

  • DSS-1: Core Strategy Tests - Weight logic, bounds, and basic correctness.
  • DSS-2: Economic Invariants - Portfolio value conservation and math guarantees.
  • DSS-3: Trigger & Timing Tests - Automation logic, cooldowns, and stale data handling.
  • DSS-4: Risk Management Tests - Stop-losses, drawdowns, and emergency pauses.
  • DSS-5: Integration Tests - Interactions with DEXs, Lending protocols, and Oracles.
  • DSS-6: Security Tests - Flash loans, reentrancy, and manipulation resistance.

Advanced Validation

  • DSS-7: Stress Tests & Fuzzing - Random inputs, market crashes, and chaos testing.
  • DSS-8: Gas Efficiency - Benchmarks and scaling limits.

Operational & Governance

  • DSS-9: Operational Security - Deployment, keys, and monitoring.
  • DSS-10: Governance & Upgrades - Timelocks, audits, and disclosure.

Interoperability

  • DSS-11: Interoperability - ERC-4626 and MAS Protocol compliance.

Tooling & Automation

  • DSS-12: Developer Experience & Documentation - API docs, code templates, and tutorials.
  • DSS-13: CI/CD & Automation - Automated testing, security scanning, and deployment workflows.
  • DSS-14: Production Monitoring & Observability - Event monitoring, health checks, and incident response.

Certification Levels

Level Focus Key Requirements
🥉 Bronze MVP / Testnet DSS 1-6, Basic Interoperability. >80% Coverage.
🥈 Silver Mainnet <$10M All Bronze + Stress Tests (DSS-7), Audits. >95% Coverage.
🥇 Gold Institutional Formal Verification, L2 Optimization, Bug Bounty. >98% Coverage.

🏆 Certified Strategies

The DSS Registry showcases projects that have achieved DSS certification. These strategies demonstrate excellence in security, testing, and operational practices.

Current Registry Statistics:

  • Total Certified: 0
  • Gold 🥇: 0 | Silver 🥈: 0 | Bronze 🥉: 0

Be the first! Achieve DSS certification and submit your strategy to the registry.

Why get listed?

  • 🎯 Showcase your commitment to security and quality
  • 📚 Provide reference implementations for the community
  • 🤝 Build trust with users and auditors
  • 🚀 Get featured in DSS updates and announcements

View Full Registry →

🚀 Quick Start

Using the DSS CLI (Recommended)

# Install the DSS CLI globally
npm install -g @vaultbricks/dss-cli

# Create a new DSS-compliant strategy
dss init my-strategy

# Navigate to your project
cd my-strategy

# Install dependencies
npm install

# Run tests
npm test

# Check DSS compliance
dss check --level silver

# Generate certification report
dss report

Manual Setup

# Clone the DSS repository
git clone https://github.com/VaultBricks/DSS.git
cd DSS

# Install dependencies
npm install

# Run the test suite
npm test

# Generate coverage report
npm run coverage

📚 Production Examples

DSS includes production-tested strategy examples:

Strategy Examples

Operational Examples (NEW!)

All examples include comprehensive test coverage and demonstrate DSS compliance.

See Examples README for details.

📦 DSS SDK Packages

DSS now provides a complete SDK for building compliant strategies:

📚 New! Check out the SDK Usage Guide for comprehensive examples and tutorials.

@vaultbricks/dss-core - Solidity Contracts

Base contracts and interfaces for DSS strategies:

npm install @vaultbricks/dss-core
# or
forge install VaultBricks/DSS

Includes:

  • IDSSStrategy - Core strategy interface
  • DSSAccessControl - Role-based access control (DSS-9)
  • DSSPausable - Emergency pause (DSS-4)
  • DSSTimelock - Governance timelock (DSS-10)
  • DSSWeightLib - Battle-tested weight normalization library

@vaultbricks/dss-test - Testing Framework

Ready-to-use testing utilities:

npm install --save-dev @vaultbricks/dss-test

Includes:

  • InvariantRunner - Property-based testing (DSS-2)
  • InvariantHelpers - Extended invariant testing utilities (value conservation, share price monotonicity, weight sum checks)
  • FuzzHelpers - Extended fuzzing utilities with arbitraries (DSS-7)
  • StandardTests - Pre-built test suites

@vaultbricks/dss-cli - Command Line Tool

Project initialization and certification:

npm install -g @vaultbricks/dss-cli

Commands:

  • dss init - Create new project
  • dss check - Verify compliance
  • dss report - Generate certification report

Documentation

Getting Started

Core Documentation

SDK Documentation

Specification Parts

DSS & MAS: Better Together

DSS complements the VaultBricks Multi-Asset Standard (MAS):

Standard Focus Scope
MAS Architecture Multi-asset vault structure
DSS Validation Strategy testing & security

See Integration Guide for details.

Contributing

DSS is an open-source standard that welcomes contributions from the community. See Contributing Guide for details.

License

MIT License - see LICENSE file.