feat: integrate TrebleSwap (Algebra v1.2.2) on Base network - #1139
Open
Shimodos wants to merge 1 commit into
Open
feat: integrate TrebleSwap (Algebra v1.2.2) on Base network#1139Shimodos wants to merge 1 commit into
Shimodos wants to merge 1 commit into
Conversation
Shimodos
force-pushed
the
feat/treble-integration
branch
from
February 9, 2026 17:22
5a1c55c to
561c4b5
Compare
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.
Summary
Integrate TrebleSwap DEX on Base network (chain 8453). TrebleSwap is built on Algebra Protocol v1.2.2 with custom pool support.
Changes
Add Treble fork class extending AlgebraIntegral
Add TrebleSwap configuration for Base network (factory, quoter, router, subgraph)
Add Quoter ABI supporting deployer field for custom pools
Add integration tests for WETH/USDC and USDC/TREB pairs (SELL & BUY)
Add TREB token to e2e test constants
Register TrebleSwap in DEX index
Contract addresses (Base)
Factory: 0x6e606Cf94A4DDc01aEed2Fce16d1b4f5B33e0A31
Quoter: 0x4b25da09909A2CAF6ec8584B09BA0e24519A46fa
SwapRouter: 0x309959994fc3fC6F789796923408f27748879b01
Subgraph: TrebleSwap Subgraph
Test results
All 7 integration tests passing:
Pool initialization and config verification
SELL/BUY pricing for WETH/USDC (graceful skip when TVL < $50K threshold)
SELL/BUY pricing for USDC/TREB (full on-chain price verification, TVL > $100K)
Top pools discovery for WETH and TREB tokens
How it works
TrebleSwap uses Algebra's Quoter with individual parameters (tokenIn, tokenOut, deployer, amount, limitSqrtPrice). The base AlgebraIntegral class handles encoding/decoding, so the Treble fork only needs to provide its own ABI and config. Pools are auto-discovered from the subgraph — no hardcoded pool addresses needed.