Skip to content

giwaov/stacks-staking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stacks Staking

Stacks Clarity License: MIT

A STX staking protocol with compound rewards on Stacks blockchain.

Features

  • 💎 Stake STX and earn rewards
  • 📈 5% APY reward rate
  • 🔄 Flexible stake/unstake anytime
  • 💰 Claim rewards to wallet
  • 🔁 Auto-compound - Reinvest rewards automatically
  • 🚨 Emergency withdraw - Exit quickly if needed

Tech Stack

  • Frontend: Next.js 14, React 18, TypeScript
  • Blockchain: Stacks Mainnet
  • Smart Contract: Clarity
  • Libraries: @stacks/connect, @stacks/transactions, @stacks/network

Contract Functions

Write Functions

  • stake (amount) - Stake STX tokens
  • unstake (amount) - Withdraw staked tokens
  • claim-rewards - Claim accumulated rewards to wallet
  • compound-rewards - Reinvest rewards back into stake
  • emergency-withdraw - Withdraw all (forfeits pending rewards)

Read Functions

  • get-stake (staker) - Get user stake info
  • calculate-rewards (staker) - Calculate pending rewards
  • get-estimated-apy - Get current APY in basis points
  • get-stake-duration (staker) - Get blocks since stake started
  • is-staking (staker) - Check if user has active stake

Getting Started

npm install
npm run dev

Contract Address

Deployed on Stacks Mainnet: SP3E0DQAHTXJHH5YT9TZCSBW013YXZB25QFDVXXWY.staking

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors