Skip to content

setraprotocol/setra-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setra Node — Settlement Relayer

Off-chain relayer node that collects settlement intents, matches counterparties, batches trades and submits them to Setra's DVP Engine on Robinhood Chain.

Architecture

Intent Submission
       │
       ▼
┌─────────────┐
│  Redis Queue │  ← pending intents
└──────┬──────┘
       │
       ▼
┌─────────────┐
│   Matcher    │  ← filters expired, scores priority
└──────┬──────┘
       │
       ▼
┌──────────────┐
│ Batch Executor│  ← gas estimation → on-chain settlement
└──────┬───────┘
       │
       ▼
  DVP Engine (on-chain)

The relayer runs on a configurable interval, pulling pending intents from Redis, filtering expired ones, scoring them by priority (value × urgency), and executing matched batches through the DVP Engine smart contract.

Requirements

  • Node.js 20+
  • Redis 7+
  • Access to Robinhood Chain RPC

Configuration

Copy .env.example to .env and fill in the values:

Variable Description
RPC_URL Robinhood Chain RPC endpoint
PRIVATE_KEY Relayer operator private key
REDIS_URL Redis connection string
DVP_ENGINE_ADDRESS DVP Engine contract address
REGISTRY_ADDRESS Asset Registry contract address
BATCH_SIZE Max intents per batch (default: 25)
BATCH_INTERVAL_MS Batch loop interval in ms (default: 5000)
LOG_LEVEL Logging level (default: info)

Docker Deployment

# Start relayer + Redis
docker compose up -d

# View logs
docker compose logs -f relayer

Development

# Install dependencies
pnpm install

# Run in dev mode with hot reload
pnpm dev

# Build
pnpm build

# Run tests
pnpm test

# Lint
pnpm lint

License

MIT

About

Settlement relayer node - intent matching, batching & on-chain execution

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages