Your on-chain safety net. Spending limits are what keep Miko's autonomous payments operating within the boundaries you define—enforced by smart contracts, not application code.
What Are Spending Limits?
Miko pays autonomously. Spending limits ensure that autonomy is bounded. Three time-based caps give you complete control:
Period
Timeframe
Purpose
Daily
24 hours
Prevents day-to-day overspending
Weekly
7 days
Caps weekly budget
Monthly
30 days
Long-term spending control
All limits are enforced on-chain. Before every payment. No exceptions.
How Limits Work
The Hierarchy Rule
Limits must be logically nested:
Monthly ≥ Weekly ≥ Daily
✅ Valid:
Daily: 0.01 SOL
Weekly: 0.05 SOL
Monthly: 0.2 SOL
❌ Invalid:
Daily: 0.1 SOL
Weekly: 0.05 SOL ← Less than daily
Monthly: 0.2 SOL
Automatic Resets
Daily: Resets every 24 hours from your first transaction of the day
Weekly: Resets every 7 days
Monthly: Resets every 30 days
Resets are automatic. No manual intervention needed.
Real-Time Enforcement
Before every payment, Miko checks:
If any check fails, the payment is blocked. No money leaves your wallet.
Setting Up Limits
Recommended Starter Limits
Tier
Daily
Weekly
Monthly
Use Case
Conservative
0.01 SOL (~$2.50)
0.05 SOL (~$12.50)
0.2 SOL (~$50)
Learning the system
Moderate
0.02 SOL (~$5)
0.1 SOL (~$25)
0.4 SOL (~$100)
Daily API access
Power User
0.1 SOL (~$25)
0.5 SOL (~$125)
2 SOL (~$500)
Heavy usage
Enterprise
1 SOL (~$250)
5 SOL (~$1,250)
20 SOL (~$5,000)
Production workloads
Start conservative. Scale based on actual usage.
Smart Contract Configuration
Limits are stored on-chain for maximum security:
On-chain enforcement means limits:
Cannot be bypassed by application bugs
Cannot be manipulated by external actors
Are transparent and auditable
Are trustless—enforced by mathematics
Web UI for limit management coming soon (no Solidity knowledge required).
Monitoring Your Spending
Current Usage
Check via Miko chat or the dashboard:
Spending Trends
Alerts (Coming Soon)
80% warning — "You've used 80% of your daily limit"
if (daily_spent + amount > daily_limit) → Reject
if (weekly_spent + amount > weekly_limit) → Reject
if (monthly_spent + amount > monthly_limit) → Reject
All pass → Process payment
function setLimits(
uint256 dailyLimit,
uint256 weeklyLimit,
uint256 monthlyLimit
) external
Daily Spending:
0.0035 / 0.01 SOL (35% used)
████████░░░░░░░░░░░░
Remaining today: 0.0065 SOL
Resets in: 14 hours 23 minutes
Weekly Spending:
0.015 / 0.05 SOL (30% used)
████████░░░░░░░░░░░░
Monthly Spending:
0.089 / 0.2 SOL (44.5% used)
████████████░░░░░░░░
This Week: 0.015 SOL / 0.05 SOL (30%)
Last Week: 0.022 SOL (44%)
Average/Day: 0.003 SOL
Trend: ↓ Spending decreased 32% week-over-week
Before: Daily limit 0.01 SOL, spent 0.008 SOL, remaining 0.002 SOL
After increasing to 0.02 SOL: spent 0.008 SOL, remaining 0.012 SOL
Before: Daily limit 0.1 SOL, spent 0.08 SOL
After decreasing to 0.05 SOL: No more payments today (0.08 > 0.05)
Tomorrow: Resets, can spend up to 0.05 SOL
Daily Limit: 0.01 SOL
Spent Today: 0.007 SOL
New Payment: 0.002 SOL
0.007 + 0.002 = 0.009 ≤ 0.01 ✓
Result: Payment approved
Daily Limit: 0.01 SOL
Spent Today: 0.009 SOL
New Payment: 0.003 SOL
0.009 + 0.003 = 0.012 > 0.01 ❌
Result: Payment rejected. Resets in 8 hours.
Daily Limit: 0.05 SOL — Spent today: 0.01 SOL
Weekly Limit: 0.2 SOL — Spent this week: 0.19 SOL
New Payment: 0.03 SOL
Daily: 0.01 + 0.03 = 0.04 ≤ 0.05 ✓
Weekly: 0.19 + 0.03 = 0.22 > 0.2 ❌
Result: Payment rejected due to weekly limit.
// Set limits (only wallet owner)
function setLimits(uint256 daily, uint256 weekly, uint256 monthly) external onlyOwner
// Check if spending is allowed
function canSpend(address user, uint256 amount) public view returns (bool, string memory)
// Record spending (called after successful payment)
function recordSpending(address user, uint256 amount) external onlyApprovedSpender
// Get remaining allowance
function getRemainingAllowance(address user) public view returns (uint256 daily, uint256 weekly, uint256 monthly)
approveSpender(miko402Address) // Grant access
revokeSpender(miko402Address) // Revoke access
Expected usage:
- Weather API: 0.001 SOL × 10/day = 0.01 SOL
- AI images: 0.005 SOL × 2/day = 0.01 SOL
- Storage: 0.0005 SOL × 5/day = 0.0025 SOL
Total daily need: 0.0225 SOL
Set daily limit: 0.025 SOL (with 10% buffer)
✓ Wallet balance: 1 SOL
✓ Daily limit: 0.008/0.01 SOL
❌ Weekly limit: 0.049/0.05 SOL ← Would exceed
✓ Monthly limit: 0.15/0.2 SOL
Result: Rejected due to weekly limit