Back to Projects

Feels Protocol

Solana DEX Trading Platform

Overview

Solana DEX trading platform built as a two-part system: feels-web, a Next.js 16 trading SPA owned end-to-end, and feels-indexer, a Rust real-time indexer over a four-backend storage layer. The frontend ships real-time market data, wallet-connected swaps, and on-chain position management across 30+ components; the indexer deserializes on-chain Solana account and event data and exposes it over a documented REST surface. A two-lane Playwright E2E setup (deterministic test wallet + LiteSVM in-memory RPC) keeps full-stack runs fast and flake-free.

Key Features

  • feels-web on Next.js 16 (App Router) + React 19 + TypeScript strict, Bun-first toolchain
  • 30+ trading components: market catalog, token swap, position detail with tick-range visualization, k-line charts, launch console, vault redemption
  • Single API proxy as the only browser-to-indexer ingress, enforced by a custom ESLint rule banning raw cross-origin fetch
  • Rust indexer over PostgreSQL + RocksDB + Redis + Tantivy with discriminator-routed Borsh deserialization across 10+ account types
  • ~40 REST endpoints with Scalar OpenAPI docs and Prometheus metrics; mock-Geyser and Yellowstone gRPC streaming via Cargo feature flag
  • Two-lane Playwright E2E with LiteSVM in-memory RPC for fast, deterministic pre-merge tests

Tech Stack

Frontend

Next.js 16React 19TypeScriptTailwind CSSBun

Indexer

RustTokioAxumBorshsqlx

Storage & Search

PostgreSQLRocksDBRedisTantivy

Solana & Web3

Solana wallet adaptersYellowstone gRPCMetaplexWASM

Testing & Observability

PlaywrightLiteSVMScalar OpenAPIPrometheus

Challenges & Solutions

Untrusted Browser-to-Indexer Access

Problem

A trading SPA talking directly to the indexer from the browser opens cross-origin fetch and token-leak risks, and the boundary erodes the moment any component reaches for a raw fetch.

Solution

Routed all browser-to-indexer traffic through a single API proxy as the only ingress, and enforced it with a custom ESLint rule that bans raw cross-origin fetch in the app, removing whole classes of CSRF and token-leak bugs.

Slow, Flaky Full-Stack Tests

Problem

On-chain integration tests against a live validator were slow and non-deterministic, and env drift between frontend, RPC, indexer, and on-chain program made failures hard to trust.

Solution

Built a two-lane Playwright setup — a deterministic test-wallet lane and a LiteSVM in-memory RPC lane — and added a deployment-coherence pre-check asserting frontend env, RPC, indexer URL, program ID, and token mints all match before any product assertion runs.

Indexing High-Volume On-Chain State

Problem

Deserializing and serving 10+ Solana account types and on-chain events at trading-app latency needs more than a single database can offer.

Solution

Built a Rust indexer on Tokio over a four-backend storage layer — PostgreSQL for analytics, RocksDB for raw account state, Redis for hot cache, and Tantivy for token search — with discriminator-routed Borsh deserialization and a Cargo feature flag switching between mock Geyser and Yellowstone gRPC streaming.

Key Achievements

30+ Components
Full trading UX from market catalog to vault redemption
4 Backends
PostgreSQL + RocksDB + Redis + Tantivy storage layer
~40 Endpoints
Documented REST surface with OpenAPI + Prometheus
2-Lane E2E
Deterministic Playwright tests on LiteSVM in-memory RPC