Skip to content

feat: AMM Bot load tests, exchange rate caching, E2E tests, and service refactor#1266

Open
pre-cious-Igwealor wants to merge 1 commit into
emdevelopa:mainfrom
pre-cious-Igwealor:feat/amm-load-testing-exchange-rate-1114-1115-1116-1117
Open

feat: AMM Bot load tests, exchange rate caching, E2E tests, and service refactor#1266
pre-cious-Igwealor wants to merge 1 commit into
emdevelopa:mainfrom
pre-cious-Igwealor:feat/amm-load-testing-exchange-rate-1114-1115-1116-1117

Conversation

@pre-cious-Igwealor

Copy link
Copy Markdown

Summary

Test plan

  • npx vitest backend/src/lib/exchange-rate-cache.test.js — all unit tests pass
  • npx vitest backend/src/services/exchangeRateService.test.js — cache hit/miss, NoPathFoundError, invalidation
  • npx vitest backend/tests/e2e/exchange-rate.e2e.test.js — full HTTP stack E2E
  • npx vitest backend/load-tests/amm-bot-load.test.js — load suite; verify 429 on burst, p99 < 500ms

closes #1114
closes #1115
closes #1116
closes #1117

…ce refactor

emdevelopa#1114 — backend/load-tests/amm-bot-load.test.js: autocannon-based load suite for
  the AMM Bot (path-payment-quote endpoint); covers 10/20-connection sustained
  polling, burst rate-limit enforcement (asserts 429), and p99 < 500ms threshold.

emdevelopa#1115 — backend/src/lib/exchange-rate-cache.js: TTL-based LRU cache for Stellar
  path-payment exchange rate quotes; stale-while-revalidate tolerance, Prometheus
  metrics hooks, singleton accessor. Tests in exchange-rate-cache.test.js.

emdevelopa#1116 — backend/tests/e2e/exchange-rate.e2e.test.js: end-to-end test suite driving
  the full HTTP stack with mocked Horizon; covers happy path, same-asset rejection,
  no-path 404, non-pending 409, invalid UUID, cache behaviour (Horizon called once
  for two identical requests), and rate limit 429.

emdevelopa#1117 — backend/src/services/exchangeRateService.js: refactors the inline
  path-payment-quote handler logic into a dedicated service with cache-first
  lookup, NoPathFoundError/ExchangeRateError types, and invalidateExchangeRateQuote
  for cache invalidation on payment status change. Tests in exchangeRateService.test.js.
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

@pre-cious-Igwealor is attempting to deploy a commit to the Emmanuel's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@pre-cious-Igwealor 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant