fix: scale gas limit for multi-hop router swaps #725

Merged
Brouie merged 3 commits from fix/issue-22-multihop-gas into main 2026-03-16 07:27:54 +00:00
Brouie commented 2026-03-16 05:43:04 +00:00 (Migrated from gitlab.com)

Single-hop swaps use 600k gas. Multi-hop swaps via the router need more gas per hop. This adds a countSwapHops function that reads the operations array from execute_swap_operations and scales gas at 400k per hop. For example: 2-hop = 800k, 3-hop = 1200k. Fixes #22.

Single-hop swaps use 600k gas. Multi-hop swaps via the router need more gas per hop. This adds a countSwapHops function that reads the operations array from execute_swap_operations and scales gas at 400k per hop. For example: 2-hop = 800k, 3-hop = 1200k. Fixes #22.
PlasticDigits (Migrated from gitlab.com) approved these changes 2026-03-16 05:43:04 +00:00
Brouie commented 2026-03-16 05:50:08 +00:00 (Migrated from gitlab.com)

added 1 commit

Compare with previous version

added 1 commit <ul><li>7790a6d6 - 1 commit from branch <code>master</code></li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/7/diffs?diff_id=1706020947&start_sha=217d253ad324054340af57f09325f719eefc885e)
PlasticDigits (Migrated from gitlab.com) changed target branch from master to main 2026-03-16 07:24:08 +00:00
PlasticDigits commented 2026-03-16 07:26:51 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 64889fb1 - refactor: move SWAP_GAS_PER_HOP to constants.ts

Compare with previous version

added 1 commit <ul><li>64889fb1 - refactor: move SWAP_GAS_PER_HOP to constants.ts</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/7/diffs?diff_id=1706133298&start_sha=7790a6d69be19f58f3410e64e51d7614376692cc)
PlasticDigits commented 2026-03-16 07:27:51 +00:00 (Migrated from gitlab.com)

Avoid hardcoding constants in files, instead should be constants.ts. merged @Brouie

Avoid hardcoding constants in files, instead should be constants.ts. merged @Brouie
PlasticDigits commented 2026-03-16 07:27:52 +00:00 (Migrated from gitlab.com)

approved this merge request

approved this merge request
PlasticDigits (Migrated from gitlab.com) merged commit 46a71f04dd into main 2026-03-16 07:27:54 +00:00
PlasticDigits commented 2026-03-16 07:27:55 +00:00 (Migrated from gitlab.com)

mentioned in commit 46a71f04dd

mentioned in commit 46a71f04dd9046c8e0ac4e636d4c75bb74b125ac
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!725
No description provided.