Trading Tournament Platform • Solana

Pulse:
Gamified Trading Engine

A high-performance Solana-based trading tournament platform combining real-time market data, prediction markets, and social gamification.

Real-time WebSocket Stack|Custom Anchor Program|Full Technical Showcase (No NDA)
Pulse Logo

Platform Architecture

Pulse was a Solana-based cryptocurrency trading tournament platform that combined competitive trading with gamification elements. The platform allowed users to participate in time-limited trading tournaments, make predictions on token markets, and earn rewards through quest-based progression systems.

As the Solo Full-Stack Engineer, I architected the entire Web3 infrastructure, including a custom Solana program using the Anchor framework, a high-performance backend using the Bun runtime and Elysia.js, and a real-time synchronization layer via WebSockets and Redis.

The platform featured a complex tournament lifecycle: from on-chain PDA-based tournament creation to real-time leaderboard updates and automated prize distribution.

Technical Stack

Blockchain & Core

SolanaAnchorRustPDAsHelius RPC

Backend & Infrastructure

BunElysiaJSPrismaMongoDBRedisWebSockets

Frontend

React 18TypeScriptZustandRadix UITailwind

Core Systems

Tournament Engine

On-chain tournament lifecycle management with secure prize pool distribution.

Prediction Markets

Binary outcome betting with proportional reward distribution logic.

Real-time Sync

WebSocket-based live leaderboard and market data synchronization.

Quest Progression

Event-driven XP and level system tracking user engagement and streaks.

Technical Deep Dive

Exploring the Solana program and backend services that powered the Pulse ecosystem.

On-Chain Reward Distribution

The Challenge

Implementing fair, proportional reward distribution for tournament winners and prediction market participants while preventing rounding errors.

The Solution

Developed a sophisticated reward calculation system in Rust using fixed-point arithmetic. Winners receive proportional rewards based on their bet size relative to the winning pool, all enforced by on-chain PDAs.

Technical Highlights

Winner Reward = (User Bet / Winning Pool Total) × Total Pool

Automated distribution via cron-triggered program instructions

Admin-only authority checks for declaring winners

PDA-based vault security for prize pools

Real-time Synchronization Layer

The Challenge

Maintaining consistent state between Solana, MongoDB, and thousands of connected WebSocket clients.

The Solution

Built a robust sync layer using Redis Pub/Sub for cross-instance message broadcasting. Implemented transaction monitoring to detect on-chain events and trigger immediate state updates in the database and UI.

Technical Highlights

Sub-100ms API response times via Bun & ElysiaJS

Redis caching for frequently accessed tournament data

Automatic reconnection with exponential backoff

Batching mechanisms to reduce message overhead

Code Showcase

Production code implementations for on-chain and backend logic.

programs/pulse/src/instructions/vote.rs
pub fn vote_on_prediction(
    ctx: Context<VoteOnPrediction>,
    choice: u8,
    amount: u64,
) -> Result<()> {
    require!(choice == 0 || choice == 1, PulseError::InvalidChoice);
    require!(amount >= 10000, PulseError::BetAmountTooLow);

    let prediction_market = &mut ctx.accounts.prediction_market;
    let current_time = Clock::get()?.unix_timestamp;

    // Check if voting period is active
    require!(prediction_market.is_voting_active(current_time), PulseError::Ended);

    // Transfer SOL to prediction market PDA
    transfer_sol_from_pda(&ctx.accounts.user, &ctx.accounts.prediction_market, amount)?;

    // Update user state and prediction pools
    let user = &mut ctx.accounts.user;
    user.deposited_amount = user.deposited_amount.checked_sub(amount).ok_or(Overflow)?;

    if choice == 0 {
        prediction_market.add_vote_a(amount)?;
    } else {
        prediction_market.add_vote_b(amount)?;
    }

    // Initialize vote record PDA
    let prediction_vote = &mut ctx.accounts.prediction_vote;
    prediction_vote.user = ctx.accounts.signer.key();
    prediction_vote.amount = amount;
    prediction_vote.choice = choice;

    Ok(())
}

<100ms

API Latency

Secure

PDA Account Structure

Real-time

Data Synchronization