💎Spending Limits

Your safety net. Your budget enforcer. Your financial guardrails. Spending limits are what keep Yuki402's autonomous payments from becoming autonomous bankruptcy. Set them once, sleep soundly forever.

🎯 What Are Spending Limits?

The problem: Yuki pays autonomously. What if she goes rogue? What if you accidentally request 1000 AI images? What if a bug causes runaway spending?

The solution: Smart contract-enforced spending limits that are mathematically impossible to exceed.

Three time periods. Three caps. Total 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 enforced on-chain. Before every payment. No exceptions. No overrides.

🔒 How Limits Work (The Math)

The Hierarchy Rule

Limits must be nested logically:

Monthly ≥ Weekly ≥ Daily

✅ Valid Example:
Daily:   0.01 SOL
Weekly:  0.05 SOL  (5x daily)
Monthly: 0.2 SOL   (20x daily, 4x weekly)

Why this matters: Prevents logical impossibilities. You can't spend more daily than weekly.

Automatic Resets

Limits reset automatically:

  • Daily: Resets every 24 hours from first transaction of the day

  • Weekly: Resets every 7 days from first weekly transaction

  • Monthly: Resets every 30 days from first monthly transaction

Example:

Resets are automatic. No manual intervention needed.

Real-Time Enforcement (The Checks)

Before EVERY payment, Yuki checks:

If ANY check fails: Payment rejected. No money leaves your wallet.

If ALL checks pass: Payment processes.

Simple. Effective. Secure.

⚙️ Setting Up Limits

Never used Yuki before? Start here:

Why conservative? Learn without risk. Scale up after you understand costs.

Limit Strategies by User Type

🟡 Moderate (Regular Users):

🟠 Aggressive (Power Users):

🔴 Enterprise (Business/Teams):

Start conservative. Scale based on actual usage.

How to Set Limits (Smart Contract)

Limits are stored ON-CHAIN for maximum security:

On-chain enforcement means:

  • ✅ Cannot be bypassed

  • ✅ Cannot be hacked

  • ✅ Cannot be manipulated

  • ✅ Transparent and auditable

Coming soon: Web UI for easy limit management (no Solidity required).

📊 Monitoring Your Spending

Current Usage Dashboard

Check anytime via Yuki chat or dashboard:

Real-time visibility. No surprises.

Historical analysis:

Track patterns. Optimize costs.

Alerts (Coming Soon)

Get notified when:

  • 🟡 80% of any limit reached - "You've used 80% of your daily limit"

  • 🔴 Limit exceeded - "Payment rejected: Daily limit exceeded"

  • 🟠 Unusual pattern - "Spending spike detected: 3x normal daily average"

Stay informed. Stay in control.

🔄 Adjusting Limits

Increasing Limits

Need more capacity? Increase anytime:

Example:

Instant effect. More runway immediately.

Decreasing Limits

Reduce your exposure:

Example:

Decreasing limits = immediate spending freeze if you've exceeded new limit.

Temporary Overrides (Coming Soon)

One-time limit increase:

  • Boost limit for 24 hours

  • Requires additional wallet confirmation

  • Automatically reverts after expiration

  • Audit trail logged on-chain

Use case: "I need to generate 20 images today only, not every day."

🎬 Limit Scenarios (Real Examples)

Scenario 1: Within All Limits ✅

Payment processes normally.

Scenario 2: Exceeds Daily Limit ❌

No money leaves your wallet. Wait for reset or increase limit.

Scenario 3: Daily OK, Weekly Exceeded ❌

ALL limits must pass. One failure = rejection.

🔐 Smart Contract Security

The SpendingLimits Contract

Core functions enforcing your limits:

Approved Spenders

Authorize Yuki402 to check/record your spending:

You control who can interact with your limits.

On-Chain Benefits

Why smart contracts > database:

Feature
Smart Contract
Traditional DB

Tamper-proof

✅ Immutable

❌ Can be edited

Transparent

✅ Public

❌ Opaque

Auditable

✅ On-chain

❌ Requires access

Decentralized

✅ No single point

❌ Centralized

Trustless

✅ Math enforced

❌ Trust required

Math > trust. Always.

✅ Best Practices

1. Start Small, Scale Gradually

Build confidence incrementally.

2. Review Weekly

Every Sunday (or pick your day):

✅ Check total spending ✅ Analyze per-service costs ✅ Look for unusual patterns ✅ Adjust limits if needed

5 minutes of review = complete peace of mind.

3. Use Separate Wallets

Consider multiple wallets for different purposes:

Testing Wallet:

  • Daily: 0.005 SOL

  • For experimental services

  • Low risk

Production Wallet:

  • Daily: 0.05 SOL

  • For vetted, trusted services

  • Medium risk

Cold Storage:

  • No Yuki402 access

  • Main holdings

  • Zero risk

Separate concerns = better security.

4. Set Realistic Limits

Base limits on:

Your budget - Can you afford to lose this? ✅ Expected usage - How much do you actually need? ✅ Service costs - What do services typically charge? ✅ Risk tolerance - How aggressive are you?

Example calculation:

Math first. Guessing never.

5. Enable Alerts (When Available)

Turn on notifications for:

  • 🟡 80% of limit reached

  • 🔴 Limit exceeded

  • 🟠 Unusual spending spike

  • 🔵 Limit reset occurred

Proactive monitoring > reactive scrambling.

🔧 Troubleshooting

"Can't Set Limits"

Possible causes:

  1. Wallet not connected

  2. Invalid hierarchy (monthly < weekly)

  3. Insufficient gas for transaction

  4. Smart contract not approved

Solutions:

"Payment Rejected Despite Having Funds"

Check ALL three limits:

All three must pass. One failure = no payment.

"Limits Not Updating"

Solution:

  1. Wait for transaction confirmation (check block explorer)

  2. Hard refresh page (Ctrl+Shift+R / Cmd+Shift+R)

  3. Clear browser cache

  4. Verify transaction succeeded on-chain

  5. Contact support if issue persists

Blockchain is slow sometimes. Be patient.

🚀 Advanced Features (Coming Soon)

Multi-Signature Limits

For organizations/DAOs:

  • Require 2-of-3 or 3-of-5 approvals for limit changes

  • Prevents single point of failure

  • Complete audit trail

  • Enterprise-grade controls

Perfect for teams managing shared wallets.

Dynamic Limits

Time-based adjustments:

Automatic adjustment based on time/day.

Spending Analysis Dashboard

AI-powered insights:

  • Service breakdown (which services cost most?)

  • Cost optimization suggestions

  • Spending predictions ("at this rate, you'll hit monthly limit in 12 days")

  • Anomaly detection

Data-driven spending optimization.

🛡️ Security Considerations

What Limits Protect Against

Even if someone gains unauthorized access, they CANNOT:

❌ Exceed your configured limits ❌ Modify your limits without wallet signature ❌ Bypass on-chain enforcement ❌ Drain your wallet

Limits are your last line of defense.

Smart Contract Audits

Our SpendingLimits contract is:

Open source - View on GitHubarrow-up-rightProfessionally audited - By top security firms ✅ Battle-tested - Used in production ✅ Upgradeable - With 48-hour timelock for security

Trust the math. Verify the code.


Questions about spending limits?

📧 Support: [email protected] 🐦 Updates: @yuki402xyzarrow-up-right

Spending limits = peace of mind. Set them. Trust them. Sleep well.

Last updated