Architecture
bwickchain is a proof-of-stake blockchain with a set of CosmWasm smart contracts and off-chain services that together form a token launch and trading ecosystem.System Overview
Technology Stack
| Component | Technology | Version |
|---|---|---|
| Consensus | BFT proof-of-stake | Latest |
| Application | bwickchain runtime | v0.53.4 |
| Smart Contracts | wasmd (CosmWasm) | v0.60.3 |
| IBC | ibc-go | v10.4.0 |
| Backend | Node.js / TypeScript / Express | - |
| Database | TimescaleDB (PostgreSQL) | - |
| Telegram Bot | grammY (TypeScript) | - |
| Relayer | TypeScript / CosmJS | - |
Launchpad (Bonding Curves)
The Launchpad is a CosmWasm contract that lets anyone create a new token with a built-in bonding curve. It works like pump.fun - tokens start cheap, price rises as people buy, and the token automatically graduates to the AMM when enough BWICK accumulates.How It Works
Token Supply Distribution
Each token launches with a fixed 100M supply, split between the bonding curve and AMM liquidity:| Allocation | Amount | Purpose |
|---|---|---|
| Tokens on curve | ~79.31M | Available for buyers during bonding phase |
| Tokens for LP | ~20.69M | Reserved for the AMM pool at graduation |
Bonding Curve Math
The launchpad uses a constant-product virtual curve (not a simple linear curve). Virtual reserves create a starting price without requiring seed liquidity:Fee Structure
| Fee | Rate | Details |
|---|---|---|
| Token creation | 80,000 BWICK | Fixed fee, becomes initial curve reserves |
| Buy fee | 0.5% (50 bps) | Deducted from BWICK input before curve math |
| Sell fee | 2.5% (250 bps) | Deducted from BWICK output after curve math |
Dynamic Graduation Threshold
The graduation threshold is computed from the current BWICK/USD oracle price:| Parameter | Default |
|---|---|
| Graduation raise | 10,000,000 BWICK (fixed, oracle-independent) |
| Target starting market cap (USD) | $1,000 |
| Target graduation market cap (USD) | $10,000 |
| Min graduation threshold | 100,000 BWICK |
| Max graduation threshold | 50,000,000 BWICK |
Graduation Flow
Whenbwick_reserves >= graduation_threshold (auto-triggered on any buy, or callable manually):
- Mark the curve as graduated (permanently closed)
- Transfer all remaining unsold tokens to the AMM contract
- Call AMM
CreatePoolwith all BWICK reserves + remaining tokens - The AMM pool starts with an augmented fee (see below)
AMM (Decentralized Exchange)
The AMM is a constant-product automated market maker (x * y = k) for tokens that have graduated from the Launchpad. Swap fees stay in the pool and auto-compound, benefiting liquidity providers.
Pool Creation
Pools are created only by authorized contracts - the Launchpad (at graduation) and thex/tokenlaunch module (for curated listings). Regular users cannot create pools.
When a token graduates:
| Asset | Amount |
|---|---|
| BWICK | All curve reserves (~graduation threshold) |
| Token | All unsold tokens from the curve (~20.69M) |
Swap Math
Standard constant-product formula:Fee Structure
| Fee | Rate | Details |
|---|---|---|
| Base swap fee | 1% (100 bps) | Applied to all swaps, stays in pool |
| Augmented fee | 1% (100 bps) | Extra fee on newly graduated pools |
Augmented Fee
Newly graduated pools start with a temporary extra 1% fee on top of the base 1%. This protects early liquidity and discourages manipulation right after graduation. The augmented fee auto-disables when the pool reaches 10x its initial value:Trade Routing
| Direction | How |
|---|---|
| BWICK to Token | Send native ubwick with Swap message to AMM |
| Token to BWICK | CW20 Send to AMM with SwapTokenForBwick inner message |
Launchpad + AMM Lifecycle
The full lifecycle of a token from creation through trading:Bridge (Solana ↔ bwickchain)
The bridge is a native chain module (x/bridge) with a trusted relayer architecture. BWICK tokens on Solana are locked/released, and corresponding tokens are minted/burned on bwickchain.
Solana to BWICK (Deposit)
BWICK to Solana (Withdraw)
Safety Parameters
| Parameter | Default |
|---|---|
| Max burn per tx | 1,000,000 BWICK |
| Max mint per tx | 1,000,000 BWICK |
| Max burns per block | 10 |
| Admin approval threshold | 100,000 BWICK |
Supply Tracking
An on-chain counter (BridgeMintedSupply) tracks total minted supply from bridging. Users cannot burn more than has been bridged in, preventing the bridge from creating inflation.
Telegram Bot
The Telegram Bot is a self-custodial trading interface built with grammY. Users get an encrypted wallet and can trade tokens without leaving Telegram.How It Works
Trade Routing
The bot automatically routes trades to the correct contract based on token status:| Token Status | Buy Route | Sell Route |
|---|---|---|
| On bonding curve | Launchpad Buy | CW20 Send to Launchpad |
| Graduated | AMM Swap | CW20 Send to AMM |
Limit Orders
The bot runs a limit order monitor that polls prices every 15 seconds:- Buy orders trigger when price drops to or below the target
- Sell orders trigger when price rises to or above the target
- Execution uses the same routing logic as manual trades
- Users are notified via Telegram message when orders fill
Wallet Security
Each user gets a 24-word HD mnemonic wallet, encrypted at rest:- AES-256-GCM encryption with per-user random salt
- Key derived via PBKDF2-SHA512 (600,000 iterations) from a server master key
- Mnemonics never stored in plaintext
- Export shows mnemonic briefly, then auto-deletes the message after 30 seconds
Backend (Indexer + API)
The backend is a Node.js service that indexes chain events and provides a REST API and real-time data feeds for frontends and the Telegram bot.Indexing Pipeline
API Endpoints
| Route | Description |
|---|---|
GET /api/tokens | All indexed tokens with metadata |
GET /api/tokens/:address | Single token details |
GET /api/trades | Recent trades (filterable by token) |
GET /api/candles/:address | OHLCV candles (1m, 5m, 1h, 1d timeframes) |
GET /api/sse | Server-Sent Events stream (trades, launches, graduations) |
GET /api/wallet/balance | Native BWICK balance |
GET /api/wallet/tokens | CW20 token balances |
POST /api/wallet/broadcast | Relay signed transactions to chain |
Oracle Price Feed
An oracle updater fetches the BWICK/USD price from pump.fun every 5 minutes and submits it to the Launchpad contract. This price is used for USD display values across the apps; graduation itself is denominated in BWICK and does not depend on the oracle.Custom Chain Modules
x/bridge
Handles Solana ↔ BWICK token bridging with mint/burn mechanics, relayer authorization, and admin approval for large transfers. See Bridge Architecture for details.x/tokenlaunch
Provides an on-chain governance path for listing tokens directly in the AMM, bypassing the bonding curve. Only bridge-verified wallets (users who have used the Solana bridge) can vote on proposals, providing Sybil resistance. Flow: Submit proposal → bridge-verified wallets vote → at threshold, admin seeds AMM pool with CW20 token + BWICK liquidity.Standard Chain Modules
| Module | Status | Notes |
|---|---|---|
x/auth | Active | Account management |
x/bank | Active | Native token transfers |
x/staking | Active | Validator operations |
x/gov | Active | On-chain governance |
x/distribution | Active | Fee reward distribution |
x/mint | Disabled | Zero inflation - all params set to 0 |
x/wasm | Active | CosmWasm smart contracts |
x/ibc | Active | Inter-Blockchain Communication |
Network Endpoints
| Service | Port | Protocol | Purpose |
|---|---|---|---|
| Chain RPC | 26657 | HTTP/WS | Block queries, tx broadcast |
| REST API | 1317 | HTTP | chain state queries |
| gRPC | 9090 | HTTP/2 | High-performance queries |
| Launchpad API | 3001 | HTTP | Token data, candles, SSE feeds |
| P2P | 26656 | TCP | Node communication |

