Skip to content

wkalidev/base2stacks-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

287 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Base2Stacks Tracker

Mainnet Next.js License Builder Rewards

Live App

https://base2stacks-tracker.vercel.app

Full DeFi platform on Stacks mainnet — swap, stake, bridge, govern, and bet. Powered by real on-chain data.


MCP Server

Endpoint: https://base2stacks-tracker.vercel.app/api/mcp

Compatible with Claude, Cursor, and any MCP client.

Tool Description
get_b2s_stats Live $B2S token price, supply, holders, market data
get_staking_info APY tiers (12.5% / 25% / 37.5%), TVL, lock durations
get_bridge_routes Bridge routes Base → Stacks with fees and times
get_swap_quote Swap quote for STX/B2S/USDCx (0.25% AMM fee)
get_leaderboard Top stakers and earners on Base2Stacks
get_nft_badges 567-badge collection info across 3 series

MCP Discovery (GET): Returns tool list, contract addresses, server version.


A2A Agent Card

Endpoint: https://base2stacks-tracker.vercel.app/api/agent-card Well-known: https://base2stacks-tracker.vercel.app/.well-known/agent-card.json

Skill Description
swap AMM swap STX/B2S/USDCx with 0.25% fee
stake Stake $B2S for 12.5% to 37.5% APY
bridge Bridge tokens between Base and Stacks
governance Vote on proposals with staked $B2S
nft_badges Buy/sell 567 unique NFT badges
portfolio Real-time balances and positions on Stacks
prediction Bet on real-world outcomes

Smart Contracts

Owner: SP1V72500C63KN9E348QDK9X879MASSTN0J3KBQ5N

Contract Purpose
b2s-token-v4 SIP-010 $B2S token, 6 decimals, 10M max supply
b2s-staking-vault-v2 Staking, 12.5%–37.5% APY, lock multipliers
b2s-staking-vault-v3 Latest staking vault
b2s-liquidity-pool-v6 AMM, 0.25% fee, STX/B2S + USDCx pairs
b2s-governance DAO voting, 10K B2S to propose, 7-day periods
b2s-prediction-market AMM-style prediction markets, 5 categories, 2% fee
b2s-price-oracle On-chain price feeds
b2s-fee-router Bridge fee collection, 0.3% — 50% treasury/50% stakers
b2s-rewards-distributor-v3 Daily reward distribution
b2s-airdrop Token airdrop distribution
b2s-marketplace NFT badge marketplace, 2.5% fee

Features

Wallet & Rewards

  • Connect with Leather or Xverse
  • Claim 5 $B2S daily rewards on-chain
  • Real-time balance tracking from Stacks mainnet

Live Market Data

  • STX/USD price via CoinGecko, auto-refresh 60s
  • TradingView Advanced Chart — candlesticks, RSI, MACD
  • Market cap, volume, ATH, circulating supply

AMM & Swaps

  • STX ↔ B2S swaps via b2s-liquidity-pool-v6 — 0.25% fee, constant product (x*y=k)
  • Live pool reserve reads (get-reserves) on every page load, polled every 30s
  • Instant client-side quote as you type; on-chain execution via swap-stx-for-b2s / swap-b2s-for-stx
  • Configurable slippage (0.5% / 1% / 2%), price impact warning above 5%
  • Xverse or Leather signs via openContractCall + PostConditionMode.Allow
  • Empty pool detection: UI shows "No liquidity yet" when reserves are 0 instead of a broken swap
  • Note: b2s-liquidity-pool-v6 reserves are currently 0. To seed, call add-b2s-stx(b2s_amount, stx_amount) on the contract.

Staking

  • 12.5% base APY (flexible), 25% (70 days), 37.5% (365 days)
  • Real-time pending rewards from on-chain vault
  • Compound daily

Cross-Chain Bridge

  • Routes: Stargate, deBridge, Across, Celer, Orbiter, Rango, Jupiter
  • 0.3% on-chain fee recorded via b2s-fee-router

Governance DAO

  • On-chain proposals and voting
  • 1 staked B2S = 1 vote, 7-day periods, quorum enforcement

NFT Badges

  • 567 unique badges — Infosec (#1–170), Glitch Art (#201–500), Galactic (#501–600)
  • 5 rarity tiers: Common → Legendary
  • IPFS via Pinata, multi-gateway fallback

Prediction Market

  • 5 categories: Price / Stacks / Governance / Sport / Crisis Alert
  • AMM-style odds, 2% platform fee

Pool Liquidity Requests

  • Community members signal intent to provide STX/B2S liquidity via a public request form
  • Submissions stored in Railway PostgreSQL (pool_requests table)
  • Request list shows wallet (truncated), amounts, status badge, and date — visible to everyone
  • Status workflow: pendingapproved / rejected (managed via admin panel)
  • POST /api/pool/request — validates Stacks SP address, saves to DB, creates GitHub issue
  • GET /api/pool/requests — public, sorted newest-first
  • PATCH /api/pool/requests/:id — admin-only approve/reject, updates DB + GitHub issue
  • Run the following SQL in Railway to create the table (add github_issue_number column if upgrading):
    CREATE TABLE IF NOT EXISTS pool_requests (
      id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
      wallet_address text NOT NULL,
      stx_amount numeric NOT NULL,
      b2s_amount numeric NOT NULL,
      message text,
      status text DEFAULT 'pending' CHECK (status IN ('pending','approved','rejected')),
      github_issue_number integer,
      created_at timestamptz DEFAULT now()
    );
    -- If upgrading an existing table:
    ALTER TABLE pool_requests ADD COLUMN IF NOT EXISTS github_issue_number integer;
  • Requires DATABASE_URL env var (Railway PostgreSQL connection string)

Admin Panel

  • URL: /admin/requests
  • Access: wallet-gated — only SP1V72500C63KN9E348QDK9X879MASSTN0J3KBQ5N can see the panel
  • Lists all pool requests with Approve/Reject buttons per row
  • On decision: updates DB status + posts a comment and closes the linked GitHub issue
  • Non-admin wallets see an ACCESS_DENIED screen

GitHub Issues Integration

  • Each new pool request automatically creates a GitHub Issue in wkalidev/base2stacks-tracker
  • Issue title: Pool Request — {wallet_short} wants {stx} STX + {b2s} $B2S
  • Issue body: formatted table with wallet, amounts, message, timestamp, DB id
  • Labels applied: pool-request + pending (create these labels in the repo first)
  • When admin approves/rejects: a decision comment is added, the decision label (approved/rejected) is added, and the issue is closed
  • Requires GITHUB_TOKEN env var — fine-grained PAT with Issues read+write on this repo

AI DeFi Assistant

  • Powered by Claude Haiku (Anthropic)
  • Natural language DeFi queries, market analysis
  • Streaming responses

Builder Rewards Checklist

  • Deployed on Stacks mainnet
  • SIP-010 fungible token ($B2S)
  • Multiple Clarity smart contracts (11 total)
  • Live app with wallet connection (Leather + Xverse)
  • AI agent with MCP server (6 tools)
  • A2A agent card with 7 skills
  • On-chain governance (DAO voting)
  • Cross-chain bridge integration
  • NFT marketplace (567 assets on IPFS)
  • npm package: @wkalidev/b2s-contracts
  • Social sharing (Twitter + Farcaster)

Tech Stack

Layer Technology
Frontend Next.js 16, React 19, TypeScript
Styling Tailwind CSS
Blockchain Stacks, Clarity 2
Wallet @stacks/connect v8
Blockchain API Hiro Mainnet API
Market Data CoinGecko API
Charts TradingView Advanced Chart
NFT Storage Pinata IPFS
AI Agent Claude Haiku (Anthropic)
Deployment Vercel

Environment Variables

Variable Description
NEXT_PUBLIC_CONTRACT_ADDRESS Contract owner address
NEXT_PUBLIC_CONTRACT_NAME Primary contract name
NEXT_PUBLIC_NETWORK mainnet
NEXT_PUBLIC_STACKS_API_URL Hiro API base URL
NEXT_PUBLIC_BASE_RPC_URL Base network RPC
COINGECKO_API_KEY CoinGecko API key (server-side)
ANTHROPIC_API_KEY Anthropic API key for B2S Agent (server-side)

Quick Start

git clone https://github.com/wkalidev/base2stacks-tracker.git
cd base2stacks-tracker
npm install
cp .env.example .env.local  # fill in your keys
npm run dev

Related Projects


Built by wkalidev (zcodebase) for Stacks Builder Rewards 2026

About

DeFi platform on Stacks mainnet — SIP-010 token, AMM, staking vault, governance, prediction market, NFT badges, bridge tracking

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors