Conversation
Adds executionTimeout() route-level middleware that enforces a 15s hard deadline on prepare/quote handlers. If the handler doesn't respond within the timeout, a 504 EXECUTION_TIMEOUT is sent. Applied to 17 endpoints across 6 route files: - swap: /quote, /prepare - staking: /prepare-enter, /prepare-exit, /prepare-claim - avax-swap: /quote, /prepare - avax-lending: /prepare-supply, /prepare-redeem, /prepare-borrow, /prepare-repay - avax-liquid-staking: /prepare-stake, /prepare-request-unlock, /prepare-redeem - dca: /prepare-create, /prepare-cancel Prevents silent hangs when RPCs are congested and never respond.
…ross all Base chain modules Adds 8 new error codes to errorCodes.ts: - INSUFFICIENT_BALANCE (400), INSUFFICIENT_LP_BALANCE (400) - NO_LIQUIDITY (400), NO_LP_POSITION (400), NO_REWARDS (400) - EXECUTOR_NOT_CONFIGURED (500) - ORDER_UNAUTHORIZED (403), ORDER_INACTIVE (400) Converts ~20 raw throw new Error() to throw new AppError() in: - prepare-enter-strategy, prepare-exit-strategy, prepare-claim-rewards - get-quote, prepare-cancel-order, get-orders - aerodrome-swap, aerodrome.service, swap-provider, protocols Before: all Base chain errors returned generic 500 INTERNAL_ERROR. After: semantic HTTP status codes (400/403/404/502) with structured error bodies matching the Avalanche modules pattern.
Adds config/demo.ts with: - Pinned contract addresses (Executor, Adapter, DCAVault) - Pinned Aerodrome protocol addresses (Router, Factory, Voter) - Canonical demo flow: ETH swap → Add Liquidity → Stake → Claim → Exit - Demo tokens and pool references for WETH/USDC volatile - isDemoMode() helper (NODE_ENV=demo or DEMO_MODE=true) - Wider timeouts (20s exec, 5s RPC) and slippage (2%) for live demos Updates .env.example with: - BASE_RPC_URLS / AVAX_RPC_URLS multi-RPC documentation - AVAX_EXECUTOR_ADDRESS placeholder - NODE_ENV options (development/demo/production) - DEMO_MODE flag - ALLOWED_ORIGINS documentation
Adds hexagonal architecture ports for future bridge integration: types/cross-chain.ts — Shared types: - MessagingProtocol (wormhole | ccip | layerzero | lifi) - MessageStatus (pending → confirming → relayed → executed | failed) - CrossChainRoute, CrossChainFee, ExecuteRouteResult, etc. domain/ports/CrossChainMessagingPort.ts — Single protocol adapter: - getRoutes(): find routes for a source→dest transfer - estimateFee(): lightweight fee estimation - executeRoute(): prepare unsigned transactions - getMessageStatus(): track in-flight messages domain/ports/RoutingPort.ts — Multi-protocol aggregator: - getRoutes(): queries all messaging adapters, returns best route - executeRoute(): delegates to the correct adapter - getRouteStatus(): track status Interface only — no implementation. Future adapters (Wormhole, CCIP, LayerZero, LI.FI) will implement CrossChainMessagingPort.
H10 — config/wallet-roles.ts: - Documents 4 wallet roles: USER, USER_ADAPTER, DCA_EXECUTOR, TREASURY - Defines per-transaction limits for DCA executor (0.5 ETH max single, 5 ETH session) - ExecutionAuditEntry interface for DCA action logging H11 — DEPLOY_CHECKLIST.md: - Pre-deploy: contract addresses, RPC endpoints, schema alignment, rate limits - Deploy steps: tag, build, health check, smoke test - Post-deploy: verification steps and rollback procedure
Feat/sprint stability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.