fix(frontend): recalibrate router wrap and multi-hop gas (#353) #854

Merged
PlasticDigits merged 1 commit from local1/353-impl-router-gas into main 2026-06-10 05:31:49 +00:00
PlasticDigits commented 2026-06-10 03:37:23 +00:00 (Migrated from gitlab.com)

Fixes #353 — native wrap-swap and multi-hop router gas budgets.


Note

Medium Risk
Changes on-chain fee envelopes for router and wrap swaps; underestimation caused out-of-gas failures, but higher gas increases LUNC fees and must stay aligned with swarm + preflight estimates.

Overview
Fixes #353 by raising broadcast Fee.gas for paths that were under-budgeted vs measured LocalTerra usage.

Router vs direct pair: execute_swap_operations (native wrap, CW20→router) now uses new gasLimitForRouterExecuteSwapOperations: 1.4M single-hop, multi-hop floored at 900k/hop (+ buffer/padding/safety margin). Direct-to-pair swap and inner send→swap still use gasLimitForExecuteSwapOperations (840k one-hop).

Wrap: WRAP_GAS_LIMIT 300k → 400k (~301k measured).

Sync: Vitest expectations in transactions.test.ts / terraClassicFeeEstimate.test.ts, packages/localnet-trading-swarm/src/gas.ts, docs/frontend.md, and skills/AGENTS_TERRACLASSIC_GAS.md updated to match.

Reviewed by Cursor Bugbot for commit 4eaeba6d12. Bugbot is set up for automated code reviews on this repo. Configure here.

Fixes #353 — native wrap-swap and multi-hop router gas budgets. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes on-chain fee envelopes for router and wrap swaps; underestimation caused out-of-gas failures, but higher gas increases LUNC fees and must stay aligned with swarm + preflight estimates. > > **Overview** > Fixes **#353** by raising broadcast **`Fee.gas`** for paths that were under-budgeted vs measured LocalTerra usage. > > **Router vs direct pair:** `execute_swap_operations` (native wrap, CW20→router) now uses new **`gasLimitForRouterExecuteSwapOperations`**: **1.4M** single-hop, multi-hop floored at **900k/hop** (+ buffer/padding/safety margin). Direct-to-pair **`swap`** and inner **`send`→swap** still use **`gasLimitForExecuteSwapOperations`** (**840k** one-hop). > > **Wrap:** **`WRAP_GAS_LIMIT`** **300k → 400k** (~301k measured). > > **Sync:** Vitest expectations in **`transactions.test.ts`** / **`terraClassicFeeEstimate.test.ts`**, **`packages/localnet-trading-swarm/src/gas.ts`**, **`docs/frontend.md`**, and **`skills/AGENTS_TERRACLASSIC_GAS.md`** updated to match. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4eaeba6d1219bbf4ec62d936a837279d212cdeb4. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
PlasticDigits commented 2026-06-10 03:37:25 +00:00 (Migrated from gitlab.com)

mentioned in issue #353

mentioned in issue #353
ghost1 commented 2026-06-10 03:37:34 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
ghost1 commented 2026-06-10 03:37:44 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits (Migrated from gitlab.com) merged commit aa15ec1734 into main 2026-06-10 05:31:50 +00:00
PlasticDigits commented 2026-06-10 05:31:51 +00:00 (Migrated from gitlab.com)

mentioned in commit aa15ec1734

mentioned in commit aa15ec1734af7bfe59cac4ddc21279eb436c7637
Brouie commented 2026-06-11 04:58:09 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!854
No description provided.