Skip to content

feat: strategy cooldown, withdrawal receipts, vault caching, gasless deposits - #1264

Merged
Junirezz merged 1 commit into
Junirezz:mainfrom
OtowoSamuel:feat/strategy-cooldown-receipts-caching-gasless
Aug 25, 2026
Merged

feat: strategy cooldown, withdrawal receipts, vault caching, gasless deposits#1264
Junirezz merged 1 commit into
Junirezz:mainfrom
OtowoSamuel:feat/strategy-cooldown-receipts-caching-gasless

Conversation

@OtowoSamuel

Copy link
Copy Markdown
Contributor

Summary

Implements 4 features across smart contracts, backend, and frontend:

#1237 — Strategy Switching Cooldown Period

  • Contract: Added StrategySwitchCooldown and LastStrategySwitchTime storage keys
  • Contract: Cooldown enforcement in set_strategy and execute_strategy_proposal
  • Contract: Admin-configurable via set_strategy_switch_cooldown(seconds)
  • Contract: Read-only strategy_switch_cooldown_remaining() view
  • Contract: Events: stratcd (cooldown check), stratset (strategy changed)
  • Backend: GET /vault/strategy/cooldown endpoint with remaining time
  • Backend: Cooldown enforcement on POST /vault/strategy (429 on cooldown)
  • Frontend: Cooldown indicator in VaultDashboard strategy section
  • Frontend: VaultContext tracks and polls cooldown state

#1236 — Detailed Withdrawal Receipt

  • Backend: Receipt data included in deposit/withdrawal response bodies
  • Backend: GET /vault/receipts endpoint with pagination and wallet filter
  • Backend: Explorer link generation (Stellar Expert + Horizon API)
  • Frontend: Enhanced TransactionReceipt page with:
    • Status polling for pending transactions
    • Confirmation count and ledger number display
    • Stellar Expert and Horizon API links
    • JSON export functionality
    • Retry logic for unconfirmed transactions

#1253 — Backend Caching Layer

  • Backend: New vaultDataCache.ts module with dedicated caching for:
    • Vault summaries (30s TTL)
    • Strategy performance (60s TTL)
    • User stats (15s TTL)
    • Share price (10s TTL)
  • Backend: Cache invalidation hooks registered for transaction events
  • Backend: Prometheus metrics for cache hit/miss tracking
  • Backend: Automatic fallthrough to database on cache miss

#1234 — Gasless Deposits (Soroban-Native)

Note: This is a Soroban/Stellar project, not EVM. ERC-20 permit doesn't apply.
Implemented the Soroban-native equivalent: off-chain signed intent + relayer submission.

  • Contract: gasless_deposit(relayer, user, amount) entrypoint
  • Contract: GaslessRelayer storage key and set_gasless_relayer admin function
  • Contract: glessdep event on successful gasless deposit
  • Backend: POST /vault/gasless-deposits endpoint
  • Frontend: useGaslessDeposit hook with signing → submitting → confirming flow

Closes

Closes #1237
Closes #1236
Closes #1253
Closes #1234

…deposits

- Junirezz#1237: Add on-chain strategy switch cooldown with admin-configurable duration,
  cooldown enforcement in set_strategy and execute_strategy_proposal, frontend
  cooldown indicator, and backend cooldown endpoint
- Junirezz#1236: Enhance withdrawal receipt with explorer links, status polling,
  confirmation count, ledger info, JSON export, and backend receipts endpoint
- Junirezz#1253: Add dedicated vault data caching layer with Redis integration,
  TTL-based caching for summaries/strategy/user stats, cache invalidation
  hooks on write operations, and hit/miss metrics
- Junirezz#1234: Implement gasless deposits via Soroban-native relayer pattern,
  gasless relayer whitelist on-chain, frontend useGaslessDeposit hook,
  and backend gasless-deposits endpoint
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@OtowoSamuel Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Junirezz
Junirezz merged commit a3f7ba6 into Junirezz:main Aug 25, 2026
8 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants