A time-locked vault protocol built on the Stacks blockchain, using Clarity 4 smart contract features.
timefi-protocol/ βββ contracts/ # Clarity smart contracts βββ frontend/ # React-based web dashboard βββ sdk/ # JavaScript/TypeScript SDK βββ scripts/ # Deployment and maintenance scripts βββ settings/ # Network configuration βββ tests/ # Contract testing suite βββ docs/ # Additional documentation
- Create Vaults - Deposit STX with a time-lock
- Withdraw Requests - Queue withdrawals once the lock matures
- Custodian Processing - Let the deployer process mature withdrawal payouts
- Bot Approval - Approve automated bot principals directly
- Fee Collection - 0.5% protocol fee on deposits
tenure-height- For block-based lock timingstx-transfer?- For deposit and withdrawal settlement
- Clarinet installed
- Node.js 18+ (LTS recommended)
- npm package manager (
npm cipreferred for clean installs) - Access to a Stacks node API for the target network (mainnet by default)
- Ensure wallet network matches the configured API target before running write flows
For detailed contribution guidelines, please see CONTRIBUTING.md.
# Install dependencies
npm ci
# Check contracts
npm run contracts:check
# Validate with project script
npm run check
# Open Clarinet console
npm run contracts:console
# Run tests
npm run test
# Run tests with coverage + costs
npm run test:report
# Start devnet
clarinet devnet start
# Run frontend (Vite)
npm run frontend:dev
# Build SDK package
npm run sdk:buildThe @timefi/sdk provides a clean interface for interacting with the protocol:
import { TimeFiClient } from './sdk/src/client.js';
const client = new TimeFiClient('testnet');
const vault = await client.getVault(1);- Smart Contracts: Clarity 4 (Stacks Blockchain)
- Frontend: React + Vite + Vanilla CSS
- SDK: JavaScript /
@stacks/transactions - Tooling: Clarinet, Vitest
Before opening a PR or pushing to main, run the checks that match the area you touched.
Ensure frontend dependencies are installed first with npm --prefix frontend ci.
npm run check
npm run frontend:build
npm run sdk:buildFor a single production-facing gate, run:
npm run verify:productionnpm --prefix frontend ci
npm run frontend:devnpm --prefix sdk ci
npm run sdk:buildThe timefi-sdk package provides a clean interface for interacting with the protocol:
import { TimeFiClient } from 'timefi-sdk';
const client = new TimeFiClient('testnet');
const vault = await client.getVault(1);
const tvl = await client.getTVL();- Smart Contracts: Clarity 4 (Stacks Blockchain)
- Frontend: React + Vite + Vanilla CSS
- SDK: JavaScript /
@stacks/transactions - Tooling: Clarinet, Vitest
| Function | Parameters | Description |
|---|---|---|
create-vault |
(amount uint) (lock-blocks uint) |
Create a new time-locked vault |
request-withdraw |
(id uint) |
Queue a withdrawal after maturity |
process-withdraw |
(id uint) |
Settle a mature withdrawal as deployer |
approve-bot |
(bot principal) |
Approve a bot principal |
revoke-bot |
(bot principal) |
Remove an approved bot principal |
| Function | Parameters | Description |
|---|---|---|
get-vault |
(id uint) |
Get vault details |
is-active |
(id uint) |
Check if vault is active |
get-time-remaining |
(id uint) |
Get blocks remaining to unlock |
can-withdraw |
(id uint) |
Check withdrawal readiness |
is-bot |
(sender principal) |
Check if sender is approved bot |
get-tvl |
β | Get total value locked in microSTX |
get-vault-count |
β | Get total number of vaults created |
get-total-fees |
β | Get accumulated protocol fees |
MIN_DEPOSIT: 10,000 microSTX (0.01 STX)
MIN_LOCK: 6 blocks (~1 hour)
MAX_LOCK: 52,560 blocks (~1 year)
FEE_BPS: 50 (0.5%)- Audit Status: Internal audit v1.0 complete (external review pending).
- Security Bounty: Bug bounty program coming Q2 2026.
- Emergency Pause: The protocol can be paused by multisig in the event of a critical vulnerability.
- Formal Verification: Clarity contracts are being verified using TLA+.
- Mainnet:
https://api.mainnet.hiro.so - Testnet:
https://api.testnet.hiro.so
- Clarinet Settings: Clarinet.toml
TimeFi Protocol is governed by its community. Future governance proposals will be handled via the on-chain governance module (currently under active development).
- Twitter: @TimeFiProtocol
- GitHub: AdekunleBamz
- Mainnet Explorer: View on Stacks Explorer
- Testnet Explorer: View on Stacks Explorer
- Console.xyz: Community discussions and governance
Q: What is microSTX? A: microSTX is the smallest unit of STX. 1 STX = 1,000,000 microSTX.
Q: What is the minimum lock period? A: The minimum lock period is 6 Stacks blocks, which is approximately 1 hour on mainnet.
- Q1 2026: Mobile Wallet Support & SDK v2
- Q2 2026: Multi-sig Vaults & Fee Sharing
- Q3 2026: Cross-chain integrations and L3 experimentation
- Q4 2026: Decentralized Frontend & DAO Governance
- Contribution guide: CONTRIBUTING.md
- Mainnet testing and funding flows: MAINNET_TESTING.md
- API reference: API.md
- Security policy: SECURITY.md
- Code of conduct: CODE_OF_CONDUCT.md
- Name:
timefi-sdk - Version:
0.1.0 - Architecture: ES Modules
- License: MIT
- Stacks Foundation: For the Clarity 4 development tools and ecosystem support.
- Hiro Systems: For the Stacks/Transactions library and API infrastructure.
- AdekunleBamz: Lead Developer & Maintainer
MIT License - Copyright (c) 2026 TimeFi Protocol Team
Made with care by the TimeFi Team