Real-time DeFi monitoring & whale tracking platform for the Stacks blockchain, powered by Chainhooks and Reown AppKit.
This project is built for the Stacks Builder Challenge and demonstrates:
- β WalletKit SDK / Reown AppKit integration
- β On-chain smart contracts with real users and fees
- β Active GitHub development with multiple contributions
- π Real-time Event Streaming - Uses Chainhooks to monitor blockchain events
- π± DEX Swap Tracking - Monitor swaps across Velar, Arkadiko, ALEX
- π§ Liquidity Pool Analytics - Track liquidity events and pool TVL
- π Whale Alerts - Large transaction notifications (10K+ STX)
- π Live Dashboard - Beautiful, responsive UI with real-time updates
- π Reown AppKit / WalletConnect - Connect with any Stacks wallet
- π± Multi-wallet Support - Xverse, Leather, Hiro Wallet, OKX
- β‘ Mobile Wallet Support - WalletConnect QR code for mobile
- π³ On-chain Subscriptions - Pay with STX for premium features
- ποΈ Basic Plan - 1 STX/month for standard alerts
- π Premium Plan - 2.5 STX/month for whale alerts + API access
- πͺ Governance Token - Vote on platform decisions
- π Staking Rewards - Earn SNTL by staking
- π Airdrops - Early adopter rewards
- π Team Vesting - 6-month cliff, 12-month vesting
- π¦ Lending Protocol - Collateralized borrowing with STX
- π Price Oracle - Real-time price feeds for STX, sBTC, SNTL
- π Multisig Treasury - N-of-M signature DAO treasury
- π° Token Sale (ICO) - 3-tier pricing with 50M SNTL supply
- β‘ Liquidation Engine - Automatic unhealthy loan liquidation
- π Builder Leaderboard - Track your rank in Stacks Builder Challenge
- πΌ Portfolio Tracker - Monitor your tokens and NFTs
- π³οΈ DAO Voting - On-chain governance proposals
- π Referral System - Earn rewards by inviting friends
| Contract | Address | Description |
|---|---|---|
defi-sentinel |
SP2PEBKJ2W1ZDDF2QQ6Y4FXKZEDPT9J9R2NKD9WJB |
Subscription & alerts |
sentinel-token |
SP2PEBKJ2W1ZDDF2QQ6Y4FXKZEDPT9J9R2NKD9WJB |
SNTL token (SIP-010) |
sentinel-staking-v2 |
SP2PEBKJ2W1ZDDF2QQ6Y4FXKZEDPT9J9R2NKD9WJB |
Staking with tiered APY |
sentinel-dao-v2 |
SP2PEBKJ2W1ZDDF2QQ6Y4FXKZEDPT9J9R2NKD9WJB |
DAO governance voting |
token-sale-v8 |
SP2PEBKJ2W1ZDDF2QQ6Y4FXKZEDPT9J9R2NKD9WJB |
ICO with 3-tier pricing |
sentinel-lending |
SP2PEBKJ2W1ZDDF2QQ6Y4FXKZEDPT9J9R2NKD9WJB |
Collateralized lending |
sentinel-oracle |
SP2PEBKJ2W1ZDDF2QQ6Y4FXKZEDPT9J9R2NKD9WJB |
Price feeds for STX/sBTC/SNTL |
sentinel-multisig-v2 |
SP2PEBKJ2W1ZDDF2QQ6Y4FXKZEDPT9J9R2NKD9WJB |
Multi-sig treasury |
defi-sentinel:
(define-public (subscribe)) ;; Subscribe for 1 STX/month
(define-public (subscribe-premium)) ;; Premium for 2.5 STX/month
(define-read-only (is-subscribed (user principal)))
(define-read-only (get-subscription (user principal)))sentinel-token:
(define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 34)))))
(define-public (mint (amount uint) (to principal))) ;; Owner only
(define-public (init-vesting)) ;; Start team vesting
(define-public (claim-vested)) ;; Claim vested tokenssentinel-staking:
(define-public (stake (amount uint) (lock-period uint) (referrer (optional principal))))
(define-public (claim-rewards)) ;; Claim staking rewards
(define-public (unstake)) ;; Withdraw staked tokens
(define-public (add-to-stake (additional-amount uint))) ;; Add more tokens
(define-read-only (get-stake (staker principal))) ;; Get stake info
(define-read-only (calculate-pending-rewards (staker principal))) ;; Calculate rewardssentinel-dao:
(define-public (create-proposal (title ...) (description ...) (proposal-type uint)))
(define-public (cast-vote (proposal-id uint) (vote-for bool)))
(define-public (execute-proposal (proposal-id uint)))
(define-public (delegate-voting-power (delegate principal)))sentinel-lending:
(define-public (borrow (collateral-stx uint) (borrow-amount uint))) ;; Deposit STX, borrow SNTL
(define-public (add-collateral (amount uint))) ;; Add more collateral
(define-public (record-repayment (repay-amount uint))) ;; Repay loan
(define-public (liquidate (borrower principal))) ;; Liquidate unhealthy position
(define-read-only (get-health-factor (user principal))) ;; Check loan health
(define-read-only (get-max-borrow (collateral-stx uint))) ;; Max borrowable amountsentinel-oracle:
(define-public (submit-prices (stx-price uint) (sbtc-price uint) (sntl-price uint)))
(define-read-only (get-stx-price)) ;; Get STX/USD price
(define-read-only (get-sbtc-price)) ;; Get sBTC/USD price
(define-read-only (get-all-prices)) ;; Get all prices
(define-read-only (is-price-fresh (asset-id uint))) ;; Check if price is freshsentinel-multisig:
(define-public (propose-stx-transfer (recipient principal) (amount uint) (memo ...)))
(define-public (sign-transaction (tx-id uint))) ;; Sign pending tx
(define-public (execute-transaction (tx-id uint))) ;; Execute when threshold met
(define-read-only (can-execute (tx-id uint))) ;; Check if ready to executeβββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Stacks Node ββββββΆβ Chainhooks ββββββΆβ DeFi Monitor β
β (Blockchain) β β (Event Stream) β β (Backend) β
βββββββββββββββββββ ββββββββββββββββββββ ββββββββββ¬βββββββββ
β
βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β REST API β β WebSocket β β Frontend β
β Endpoints β β Server β β Dashboard β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β
βΌ
ββββββββββββββββ
β Reown AppKit β
β WalletConnectβ
ββββββββββββββββ
- Frontend: React, Vite, TypeScript, Tailwind CSS
- Backend: Fastify, Node.js, TypeScript
- Blockchain: Stacks, Clarity Smart Contracts
- Wallet: @stacks/connect, Reown AppKit, WalletConnect
- Deployment: Vercel (frontend), Railway (backend)
- Monitoring: Hiro Chainhooks
git clone https://github.com/serayd61/stacks-defi-sentinel.git
cd stacks-defi-sentinel/defi-monitor
npm installCreate a .env file:
# Chainhooks API Configuration
CHAINHOOKS_API_KEY=your-api-key-here
# Server Configuration
PORT=4000
HOST=0.0.0.0
# Network
STACKS_NETWORK=mainnet
# Webhook URL
WEBHOOK_BASE_URL=https://your-server.com
# Alert Thresholds
WHALE_ALERT_THRESHOLD_STX=100000
LARGE_SWAP_THRESHOLD_USD=50000npm run devcd frontend
npm install
npm run devOpen http://localhost:3000 to view the dashboard!
| Hook Name | Status | Description |
|---|---|---|
| USDA Stablecoin Tracker | β Active | Track USDA transfers |
| VELAR Token Tracker | β Active | Monitor VELAR activity |
| DeFi Sentinel Subscriptions | β Active | Track subscription events |
| Arkadiko Swaps | β Active | Monitor Arkadiko DEX |
| ALEX DEX Swaps | β Active | Monitor ALEX DEX |
| NFT Transfer Monitor | β Active | Track NFT transfers |
| Liquidity Pool Events | β Active | Monitor liquidity |
| DEX Swap Monitor | β Active | General DEX tracking |
| Endpoint | Description |
|---|---|
GET /api/dashboard |
Aggregated statistics |
GET /api/volume |
Trading volume by period |
| Endpoint | Description |
|---|---|
GET /api/swaps |
Recent swap transactions |
GET /api/liquidity |
Liquidity events |
GET /api/pools |
Top pools by TVL |
| Endpoint | Description |
|---|---|
GET /api/tokens |
Top tokens by volume |
GET /api/transfers |
Token transfers |
GET /api/alerts |
Whale activity alerts |
Connect to /ws for real-time updates:
const ws = new WebSocket('wss://stacks-defi-sentinel-production.up.railway.app/ws');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Event:', data);
};- API Key Protection - Never expose Chainhooks API key
- Webhook Verification - Validate webhook payloads
- Rate Limiting - Implemented for public endpoints
- Smart Contract Auditing - Clarity best practices
- Real-time dashboard
- Chainhooks integration
- Multi-wallet support
- Subscription system
- SENTINEL token
- Reown AppKit integration
- Builder Challenge Leaderboard
- Portfolio Tracker with NFT support
- Gas/Fee Tracker
- DAO Governance Voting
- Referral Reward System
- Advanced Staking Contract
- DEX Aggregator
- Telegram/Discord bot notifications
- DEX listing (ALEX, Velar)
- Mobile app (React Native)
- Cross-chain analytics
- AI-powered alerts
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details.
- Live Dashboard
- GitHub Repository
- Chainhooks Documentation
- Stacks Blockchain
- Hiro Platform
- Reown AppKit
Built with β€οΈ for the Stacks ecosystem | Stacks Builder Challenge 2024
- airdrop, referral, token-burn, whitelist
- reputation, achievement-badge, token-vesting, treasury
Real-time blockchain event monitoring using Hiro Chainhooks:
- Token Transfer Monitoring - Track SENTINEL token movements
- Staking Events - Real-time staking deposits/withdrawals
- Whale Alerts - Large transaction detection
- WebSocket Streaming - Live data to connected clients
Full WalletConnect integration for seamless wallet connections:
- β Xverse Wallet
- β Leather Wallet
- β OKX Wallet
- β Asigna Multisig
Located in /chainhooks/predicates/:
{
"scope": "contract_call",
"contract_identifier": "SP2PEBKJ2W1ZDDF2QQ6Y4FXKZEDPT9J9R2NKD9WJB.sentinel-token",
"method": "transfer"
}- Live transaction feed
- Instant balance updates
- Whale alert notifications
- Block explorer integration
Built with β€οΈ for Stacks Builder Challenge 2024