Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
00de0ee
Change version to dev-2.16.0 in package.json
rapcmia Jul 30, 2026
13f7a5d
Update GATEWAY_VERSION to dev-2.17.0
rapcmia Jul 30, 2026
1313196
Bump version from dev-2.16.0 to dev-2.17.0
rapcmia Jul 30, 2026
06f3d5e
feat(meteora): add DAMM v2 (cp-amm) AMM connector
fengtality Aug 4, 2026
222ba26
feat(meteora): seed DAMM v2 pools at market price by default
fengtality Aug 4, 2026
31c6849
feat(amm): add create-pool to Raydium (CPMM) and Uniswap (V2) + unifi…
fengtality Aug 5, 2026
a47cb34
feat(amm): standardize connector AMM ops and add unified /trading/amm…
fengtality Aug 5, 2026
ad4cc66
refactor(clmm): standardize quoteSwap/executeSwap to require poolAddr…
fengtality Aug 5, 2026
11623b1
feat(clmm): add create-pool for Meteora DLMM, Raydium CLMM, Uniswap V…
fengtality Aug 5, 2026
c1e2022
refactor(clmm): standardize orca/pancakeswap/pancakeswap-sol quoteSwa…
fengtality Aug 5, 2026
89c01de
feat: complete DEX standardization — pancakeswap AMM ops + create-poo…
fengtality Aug 5, 2026
0516aaf
feat(meteora): position-addressed DAMM v2 AMM (require positionAddres…
fengtality Aug 5, 2026
51046e5
fix(meteora): probe market price with 1% of seed to avoid baking pric…
fengtality Aug 6, 2026
bb44ffd
fix(uniswap): remove average-price sqrtPriceLimitX96 from CLMM execut…
fengtality Aug 8, 2026
469aca6
Merge pull request #671 from hummingbot/feat/meteora-damm-v2
cardosofede Aug 10, 2026
d591600
feat(orca): migrate connector to current whirlpools SDK
mlguys Aug 9, 2026
4ddacc9
test(orca): cover dynamic tick array decoding
mlguys Aug 9, 2026
d224fe6
fix(orca): migrate create-pool to current SDK
mlguys Aug 10, 2026
3fee273
test(orca): fix execute-swap suite after rebase
mlguys Aug 10, 2026
0d34b62
ci: build docker images on push to main/development instead of merged…
fengtality Aug 10, 2026
a7119bb
Merge pull request #676 from hummingbot/feat/orca-update
cardosofede Aug 11, 2026
2069904
Merge branch 'development' into fix/uniswap-clmm-sqrt-price-limit
fengtality Aug 11, 2026
19ed6f8
Merge pull request #675 from hummingbot/fix/uniswap-clmm-sqrt-price-l…
fengtality Aug 11, 2026
e42ad99
Merge branch 'development' into ci/docker-build-on-push
fengtality Aug 11, 2026
3b06c07
Merge pull request #677 from hummingbot/ci/docker-build-on-push
fengtality Aug 11, 2026
338c844
fix(solana): typed close-failure errors + pre-broadcast simulation gu…
fengtality Aug 13, 2026
8f423d4
feat(solana): distinguish NOT_FOUND from UNCONFIRMED in transaction poll
fengtality Aug 13, 2026
f9d4ed7
docs: rewrite retry-architecture as issues + final architecture
fengtality Aug 13, 2026
71537de
fix(poll): one txStatus contract for Solana and Ethereum; report EVM …
fengtality Aug 13, 2026
18d6e95
docs: single close-retry loop; unified poll contract
fengtality Aug 13, 2026
546c643
fix(poll): attribute failed-transaction errors to the failing program
fengtality Aug 13, 2026
2452a89
feat(clmm): binCount on unified pool-info; add bin support to Pancake…
fengtality Aug 13, 2026
4e7233b
fix(bsc): default nodeURL to bsc-dataseed.bnbchain.org
fengtality Aug 13, 2026
0a54fed
fix(ethereum): default mainnet nodeURL to Alchemy's public endpoint
fengtality Aug 13, 2026
6aeeb7e
docs: cover the poll and CLMM pool-info contracts
fengtality Aug 13, 2026
80c1445
fix(clmm): validate open amounts at the route, matching add
fengtality Aug 18, 2026
7eb4ffc
refactor(clmm): drop the never-populated reward fields from PositionInfo
fengtality Aug 18, 2026
f686579
feat(clmm): binCount bins for pancakeswap-sol; fix inverted out-of-ra…
fengtality Aug 18, 2026
227f22d
refactor(clmm): one fee-tier vocabulary for create-pool; canonical sc…
fengtality Aug 18, 2026
95e7ecd
refactor(amm): consistent unified params — no gas overrides, one conf…
fengtality Aug 19, 2026
7a36c6a
refactor(swap): uniform router contract — slippagePct + approximateIf…
fengtality Aug 19, 2026
a2b9779
refactor(amm): drop openTime from unified create-pool; optionals trai…
fengtality Aug 19, 2026
a67c572
fix(clmm): expose strategyType on unified add-liquidity, matching open
fengtality Aug 19, 2026
6b3383c
refactor(trading): standardize unified route surfaces
fengtality Aug 19, 2026
26c3bb3
fix(trading): uniform error passthrough on all unified routes
fengtality Aug 19, 2026
1559081
fix(trading): connector-config slippage defaults; percentageToRemove …
fengtality Aug 19, 2026
2eaee8b
docs: regenerate openapi.json from current routes
fengtality Aug 19, 2026
1fbbacf
test(jupiter): assert removed fields' absence independently
fengtality Aug 19, 2026
da3008b
refactor(trading): fold AMM pool-scoped swaps into the unified swap r…
fengtality Aug 19, 2026
828159e
fix(trading): fail loudly on landed-but-failed Solana txs; echo appli…
fengtality Aug 19, 2026
a6d82bb
feat(trading): let unified swaps pin a pool by address
fengtality Aug 19, 2026
1884ed7
test(trading): assert the live field names on unified CLMM and orca r…
fengtality Aug 19, 2026
40bb747
test(trading): send chainNetwork, not the pre-fold network field
fengtality Aug 19, 2026
198e0d8
docs: regenerate openapi.json from the current route table
fengtality Aug 19, 2026
b5f5e04
fix(raydium): collect fees without withdrawing liquidity
fengtality Aug 19, 2026
fdad604
fix(evm): route every EVM transaction through one confirmation gate
fengtality Aug 19, 2026
a3bb2d6
refactor(api): unify the route table around /trading/{router,clmm,amm…
fengtality Aug 19, 2026
5333a3f
refactor(api): give the AMM surface the same liquidity verbs as CLMM
fengtality Aug 19, 2026
60f25e1
feat(trading): rename clmm quote-position to quote-liquidity, add ope…
fengtality Aug 19, 2026
06a81c2
feat(amm): make open and close work on every AMM, and report position…
fengtality Aug 19, 2026
d62dcf6
fix(gateway): correct fee, rent and fee-percent accounting; return th…
fengtality Aug 19, 2026
45b8a11
feat(trading): name the pool and position every liquidity operation a…
fengtality Aug 19, 2026
d3f1315
refactor(clmm): report the pool from the connector instead of re-read…
fengtality Aug 19, 2026
982ed24
fix(gateway): audit fixes — missed return path, inconsistent decimal …
fengtality Aug 19, 2026
24795ff
chore(connectors): delete the schemas the per-connector routes left b…
fengtality Aug 19, 2026
d1ba898
test(orca): assert one outcome per case instead of accepting any of t…
fengtality Aug 19, 2026
78a2249
test(clmm): replace a hedged duplicate with the case it was standing …
fengtality Aug 19, 2026
2b69e52
feat(openapi): emit named schema components so a generated client has…
fengtality Aug 19, 2026
6a641d2
test: delete 157 tests that mocked the transport and asserted the fix…
fengtality Aug 19, 2026
d10e54d
test(clmm): assert routes are registered instead of accepting a crash
fengtality Aug 19, 2026
715323b
chore(scripts): drop the live RPC scripts that depended on a removed …
fengtality Aug 19, 2026
2935610
chore: stop prettier and the openapi generator from rewriting each other
fengtality Aug 19, 2026
e981472
feat(chains): make chain and network dropdowns in the docs
fengtality Aug 19, 2026
c19a032
test(wallet): make the two wallet suites run at all
fengtality Aug 19, 2026
3a89f18
feat(openapi): publish request bodies as components (GW-9)
fengtality Aug 20, 2026
c0bb102
feat(openapi): publish the reads as components too (GW-10)
fengtality Aug 20, 2026
3d9e7d8
fix(trading): act on the chain a liquidity route was given
fengtality Aug 20, 2026
f0d8097
feat(trading): learn tokens and pools from the chain as they are used
fengtality Aug 20, 2026
3182445
fix(ethereum): resolve a token by address from the chain, as Solana does
fengtality Aug 20, 2026
74a1ee5
feat(amm): fold close into remove at 100%, and drop the open and clos…
fengtality Aug 20, 2026
e3eb7b1
fix(amm): stop reporting position rent as deposited liquidity (GW-20)
fengtality Aug 20, 2026
d6e444f
fix(raydium): report a deposit as how much went in, not which way the…
fengtality Aug 20, 2026
db6da4d
fix(openapi): make the spec reproducible, and check that it is (GW-13…
fengtality Aug 20, 2026
414497c
fix(orca): deposit the quoted amount, not the slippage ceiling
fengtality Aug 20, 2026
a40e654
feat(openapi): name the operations, the errors and the responses (GW-…
fengtality Aug 20, 2026
e5b10e1
refactor(pools,tokens): address every route one way
fengtality Aug 20, 2026
368df48
fix(security): gate every route that signs, not the ones on a list
fengtality Aug 20, 2026
a29c5b5
fix(solana): report the money that moved, not the wallet's balance ch…
fengtality Aug 20, 2026
1261815
chore: delete the dead code, and the two live bugs hiding behind it
fengtality Aug 20, 2026
d4f0c81
fix(raydium): a close reports what the pool paid, not the rent beside it
fengtality Aug 20, 2026
47095b2
fix(routers): name the route that was attempted, and the impact in th…
fengtality Aug 20, 2026
e87bd50
feat(clmm): let a close say how much slippage it will accept
fengtality Aug 20, 2026
8711fde
fix(pancakeswap-sol): open reliably, and say what the fees were
fengtality Aug 20, 2026
77f53da
fix(trading): reject a request that was going to be misread
fengtality Aug 20, 2026
c2b214c
fix(schemas): send money as decimal strings so precision survives the…
fengtality Aug 20, 2026
1c285dd
test(orca): pin the wallet default instead of inheriting the machine's
fengtality Aug 21, 2026
2eb1a38
fix(trading): execute-quote learns its tokens, like execute-swap alre…
fengtality Aug 21, 2026
7e81321
refactor(trading): learn tokens and pools from fills, never from quotes
fengtality Aug 21, 2026
32f33c6
fix(tokens): save reads the chain, and checks for a duplicate by address
fengtality Aug 21, 2026
75db018
feat(pools): save a pool without GeckoTerminal when the caller knows …
fengtality Aug 21, 2026
52e0092
chore(openapi): regenerate spec for the pools connector/type params
claude Aug 23, 2026
022b052
fix(orca): read position state from consistent snapshot
mlguys Aug 25, 2026
4febada
feat(openapi): publish POST /restart, the one route no client could l…
fengtality Aug 25, 2026
7016811
refactor(orca): remove position snapshot retry
mlguys Aug 26, 2026
9dae11b
Merge branch 'feat/unified-trading-routes' into fix/orca-position-inf…
rapcmia Aug 26, 2026
54868a0
Merge pull request #687 from hummingbot/fix/orca-position-info-consis…
rapcmia Aug 26, 2026
72fa706
Merge pull request #683 from hummingbot/feat/unified-trading-routes
fengtality Aug 26, 2026
7752593
docs(schemas): say what pool-info `price` actually is
fengtality Aug 26, 2026
8917aca
test: make the wallet and RPC-provider config suites actually mocked
fengtality Aug 26, 2026
e46162f
fix(raydium): list CLMM positions by address, not by stored wallet
fengtality Aug 26, 2026
ae8c34d
feat(coingecko): use CoinGecko Pro onchain endpoints when a key is co…
fengtality Aug 27, 2026
47513a4
fix(uniswap): report the swap's executed amounts, not the quote's est…
fengtality Sep 8, 2026
25f245d
refactor(meteora): one constant for the position bin width
fengtality Sep 9, 2026
253b97b
feat(meteora): open a price range wider than one transaction can fund
fengtality Sep 9, 2026
733feab
fix(meteora): let add-liquidity fund a position wider than one transa…
fengtality Sep 9, 2026
57e715d
fix(meteora): quote the transaction count the open actually sends
fengtality Sep 9, 2026
e4bdb81
fix(meteora): the single-transaction width is 70 bins, confirmed on-c…
fengtality Sep 9, 2026
4032a3c
fix(clmm): report every position a wallet owns, or fail loudly
fengtality Sep 10, 2026
ed6247e
fix(raydium): derive position PDAs with the network's CLMM program
fengtality Sep 10, 2026
26ca84d
fix(coingecko): support Demo keys as well as Pro
fengtality Sep 10, 2026
33ffb42
fix(rpc): retry Ethereum 429s that ethers had stripped of their status
fengtality Sep 13, 2026
5b86852
fix(clmm): stop reporting a failed tick read as "no liquidity here"
fengtality Sep 13, 2026
0c3bb60
Merge pull request #696 from hummingbot/feat/meteora-wide-range-posit…
cardosofede Sep 16, 2026
39d619d
Merge pull request #695 from hummingbot/fix/raydium-positions-coingec…
cardosofede Sep 16, 2026
fc7e113
fix(trading): resolve the default wallet from the chain the request n…
fengtality Sep 18, 2026
8807971
chore(openapi): regenerate for the per-chain wallet default
fengtality Sep 18, 2026
9e475f8
Merge pull request #703 from hummingbot/fix/per-chain-default-wallet
fengtality Sep 18, 2026
94911bc
fix(meteora): open a position with the slippage that was asked for
fengtality Sep 19, 2026
092a14f
fix(raydium): list positions without pulling the wallet's whole token…
fengtality Sep 19, 2026
c6e9bd9
docs(clmm): say what the tick bitmap actually saves
fengtality Sep 19, 2026
fb5a626
fix(meteora): stop serving pool state frozen at the moment Gateway fi…
fengtality Sep 19, 2026
9724900
fix(clmm): report a concurrent position change instead of guessing at it
fengtality Sep 19, 2026
b66f4d9
Merge pull request #699 from hummingbot/fix/pre-staging-review-followups
rapcmia Sep 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ module.exports = {
rules: {
'no-console': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
// `ignoreRestSiblings` allows the idiomatic way to drop a key —
// `const { poolType, ...rest } = obj` — which is not dead code; the named sibling is
// how the rest is defined. `varsIgnorePattern` keeps a deliberately-unread binding
// legible as deliberate.
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', ignoreRestSiblings: true },
],
semi: [2, 'always'],
'prettier/prettier': 'error',
'@typescript-eslint/no-var-requires': 'off',
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/docker_buildx_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Gateway Docker Buildx Workflow

on:
pull_request:
types: [closed]
push:
branches:
- main
- development
Expand All @@ -11,45 +10,45 @@
types: [published, edited]

jobs:
build_pr:
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
build_push:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.1.0

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Development Image
if: github.base_ref == 'development'
if: github.ref == 'refs/heads/development'
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: hummingbot/gateway:development

- name: Build and push Latest Image
if: github.base_ref == 'main'
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: hummingbot/gateway:latest

build_release:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ jobs:
# Copy template configurations
cp -rf src/templates/* conf/

# The committed spec is what consumers generate their clients from, and the tests
# that check it read the committed copy — so a route change with no regeneration
# leaves them passing against a stale document. Only regenerating and comparing
# catches that. The generator writes the template port and placeholder wallets, so
# this produces the same bytes here as on any developer's machine.
- name: Check openapi.json is regenerated
shell: bash
run: |
pnpm generate:openapi
if ! git diff --quiet -- openapi.json; then
echo "::error::openapi.json does not match the routes. Run 'pnpm generate:openapi' and commit the result."
git --no-pager diff -- openapi.json
exit 1
fi

- name: Run unit test coverage
if: github.event_name == 'pull_request'
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ certs
*.yml
coverage
dist
vendor
vendor
openapi.json
16 changes: 1 addition & 15 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,28 +251,14 @@ Gateway implements RPC provider abstraction for optimized blockchain connectivit
- Regional optimization (slc, ewr, lon, fra, ams, sg, tyo)
- Connection warming for reduced latency

### Testing RPC Providers
Live integration tests in `scripts/`:
- `test-infura-live.js`: Test Infura integration with real API key
- `test-helius-live.js`: Test Helius integration with real API key
- `test-provider-switching.js`: Test provider switching functionality

Run tests:
```bash
# Requires configured API keys in conf/rpc/*.yml
node scripts/test-infura-live.js
node scripts/test-helius-live.js
```

### Adding New RPC Provider
1. Create config template: `src/templates/rpc/{provider}.yml`
2. Create JSON schema: `src/templates/namespace/{provider}-schema.json`
3. Register in `src/templates/root.yml`
4. Implement service class: `src/chains/{chain}/{provider}-service.ts`
5. Update chain connector to support provider selection
6. Add `rpcProvider` enum to network schema
7. Create live integration test script
8. Document configuration and usage
7. Document configuration and usage

## Hummingbot Gateway Endpoint Standardization
- This repo standardized DEX and chain endpoints that are used by Hummingbot strategies. See this branch for the matching code, especially the Gateway connector classes https://github.com/hummingbot/hummingbot/tree/development
Expand Down
186 changes: 70 additions & 116 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,37 @@ Gateway uses [Swagger](https://swagger.io/) for API documentation. When running
- `POST /chains/{chain}/approve` - Approve token spending
- `POST /chains/{chain}/wrap` - Wrap/unwrap native tokens

#### Connector Routes (`/connectors/{dex}/{type}/*`)

**Router Operations** (e.g., `/connectors/jupiter/router/*`):
- `POST /quote` - Get swap quote from aggregator
- `POST /swap` - Execute swap through aggregator

**AMM Operations** (e.g., `/connectors/raydium/amm/*`):
- `POST /poolInfo` - Get pool details
- `POST /positionInfo` - Get liquidity position info
- `POST /quoteSwap` - Get swap quote
- `POST /executeSwap` - Execute swap
- `POST /quoteLiquidity` - Quote add/remove liquidity
- `POST /addLiquidity` - Add liquidity to pool
- `POST /removeLiquidity` - Remove liquidity from pool

**CLMM Operations** (e.g., `/connectors/uniswap/clmm/*`):
- `POST /poolInfo` - Get concentrated liquidity pool info
- `POST /openPosition` - Open new position
- `POST /closePosition` - Close existing position
- `POST /addLiquidity` - Add liquidity to position
- `POST /removeLiquidity` - Remove liquidity from position
- `POST /collectFees` - Collect earned fees
- `POST /positionsOwned` - List owned positions
#### Trading Routes (`/trading/{type}/*`)

The trading type is a path segment and the connector is a `connector` parameter, so
one set of routes covers every DEX.

**Router** (`/trading/router/*`) — aggregators that route across pools (Jupiter, 0x, dflow, okx, titan, Uniswap, PancakeSwap):
- `GET /trading/router/quote-swap` - Quote a swap (returns a `quoteId`)
- `POST /trading/router/execute-quote` - Execute a previously fetched quote by id
- `POST /trading/router/execute-swap` - Quote and execute in one call

**AMM** (`/trading/amm/*`) — constant-product pools (Uniswap V2, PancakeSwap V2, Raydium CPMM, Meteora DAMM v2):
- `GET /trading/amm/quote-swap` / `POST /trading/amm/execute-swap` - Swap against a single pool
- `GET /trading/amm/pool-info` - Pool reserves, price, fee
- `GET /trading/amm/position-info` - Wallet's liquidity in a pool
- `GET /trading/amm/positions-owned` - All of a wallet's positions
- `GET /trading/amm/quote-liquidity` - Two-sided deposit quote
- `POST /trading/amm/open` / `close` - Open or close a position (fungible-LP AMMs deposit/withdraw in full)
- `POST /trading/amm/add` / `remove` - Change a position's liquidity
- `POST /trading/amm/create-pool`

**CLMM** (`/trading/clmm/*`) — concentrated liquidity (Uniswap V3, PancakeSwap V3, Raydium, Meteora DLMM, Orca):
- `GET /trading/clmm/quote-swap` / `POST /trading/clmm/execute-swap` - Swap against a single pool
- `GET /trading/clmm/pool-info` - Pool info (optionally with bin/tick liquidity)
- `GET /trading/clmm/position-info` - Position details
- `GET /trading/clmm/positions-owned` - All of a wallet's positions
- `GET /trading/clmm/quote-liquidity` - Deposit split for a candidate range
- `GET /trading/clmm/fetch-pools` - Pool discovery from the DEX's own listing API
- `POST /trading/clmm/open` / `close` - Open or close a position
- `POST /trading/clmm/add` / `remove` - Change a position's liquidity
- `POST /trading/clmm/collect-fees` - Collect earned fees
- `POST /trading/clmm/create-pool`

#### Wallet Routes (`/wallet/*`)
- `GET /wallet` - List all wallets
Expand Down Expand Up @@ -405,43 +413,25 @@ docker compose up -d --build
- `DELETE /wallet/remove` - Remove wallet
- `POST /wallet/sign` - Sign message

### Chain Operations
### Chain Operations (`/chains/{chain}/*`)

#### Ethereum/EVM (`/chains/ethereum`)
- `GET /status` - Chain connection status
- `GET /tokens` - Get token information
- `GET /balances` - Get wallet balances
- `GET /allowances` - Check token allowances
- `POST /approve` - Approve token spending
- `GET /poll` - Poll transaction status
One parameterized set of routes serves every chain, so a new chain needs no new paths:
- `GET /chains/{chain}/status` - Chain connection status and block height
- `GET /chains/{chain}/estimate-gas` - Current transaction fee estimate
- `POST /chains/{chain}/balances` - Wallet token balances
- `POST /chains/{chain}/poll` - Poll a transaction by signature/hash
- `POST /chains/{chain}/wrap` / `unwrap` - Wrap or unwrap the native token

#### Solana (`/chains/solana`)
- `GET /status` - Chain connection status
- `GET /tokens` - Get token information
- `GET /balances` - Get wallet balances
- `GET /poll` - Poll transaction status
EVM-only operations keep chain-specific paths, since they have no meaning elsewhere:
- `POST /chains/ethereum/allowances` - Check token allowances
- `POST /chains/ethereum/approve` - Approve token spending

### DEX Trading Endpoints

#### Router Operations (DEX Aggregators)
- `GET /connectors/{dex}/router/quote-swap` - Get swap quote
- `POST /connectors/{dex}/router/execute-swap` - Execute swap without quote
- `POST /connectors/{dex}/router/execute-quote` - Execute pre-fetched quote
- `GET /connectors/0x/router/get-price` - Get price estimate (0x only)

#### AMM Operations (Uniswap V2, PancakeSwap V2, Raydium)
- `GET /connectors/{dex}/amm/pool-info` - Pool information
- `GET /connectors/{dex}/amm/position-info` - LP position details
- `POST /connectors/{dex}/amm/add-liquidity` - Add liquidity
- `POST /connectors/{dex}/amm/remove-liquidity` - Remove liquidity

#### CLMM Operations (Uniswap V3, PancakeSwap V3, Raydium, Meteora)
- `GET /connectors/{dex}/clmm/pool-info` - Pool information
- `GET /connectors/{dex}/clmm/positions-owned` - List positions
- `POST /connectors/{dex}/clmm/open-position` - Open position
- `POST /connectors/{dex}/clmm/add-liquidity` - Add to position
- `POST /connectors/{dex}/clmm/remove-liquidity` - Remove from position
- `POST /connectors/{dex}/clmm/collect-fees` - Collect fees
See [Trading Routes](#trading-routes-tradingtype) above. Every trading route takes
`chainNetwork` (e.g. `solana-mainnet-beta`) and `connector` (e.g. `jupiter`), and the
full request/response schemas are in the OpenAPI document at `/docs` (or `openapi.json`,
regenerated with `pnpm generate:openapi`).

## Contribution

Expand Down Expand Up @@ -626,64 +616,22 @@ The test directory is organized as follows:

```
/test
/chains/ # Chain endpoint tests
chain.test.js # Chain routes test
ethereum.test.js # Ethereum chain tests
solana.test.js # Solana chain tests
/connectors/ # Connector endpoint tests by protocol
/jupiter/ # Jupiter connector tests
/uniswap/ # Uniswap connector tests
/raydium/ # Raydium connector tests
/meteora/ # Meteora connector tests
/pancakeswap/ # PancakeSwap (EVM) connector tests
/pancakeswap-sol/ # PancakeSwap Solana connector tests
/mocks/ # Mock response data
/chains/ # Chain mock responses
chains.json # Chain routes mock response
/ethereum/ # Ethereum mock responses
/solana/ # Solana mock responses
/connectors/ # Connector mock responses
/services/ # Service tests
/data/ # Test data files
/wallet/ # Wallet tests
/config/ # Configuration tests
/jest-setup.js # Test environment configuration

/scripts # Live testing and utility scripts
test-helius-live.js # Helius RPC provider integration tests
test-infura-live.js # Infura RPC provider integration tests
test-provider-switching.js # RPC provider switching tests
/chains/ # Chain route tests (ethereum, solana)
/connectors/ # Connector tests, one directory per connector
/trading/ # The unified /trading/* route tests
/mocks/ # Shared mock modules (TypeScript)
/helpers/ /utils/ # Test helpers and fastifyWithTypeProvider
/services/ /wallet/ /config/ /pools/ /tokens/ /rpc/
jest-setup.js # Test environment configuration

/scripts # Utility scripts
generate-openapi.ts # Write openapi.json from the live route table
create-wallet.ts # Wallet creation helper
add-bsc-tokens.ts # Token list maintenance
add-pancakeswap-pools.ts # Pool list maintenance
migrate-pool-templates.ts # Pool template migration
```

#### RPC Provider Testing

Gateway includes comprehensive testing for RPC provider integrations:

**Live Integration Tests** (`scripts/test-*-live.js`):
- Test real API connectivity with configured keys
- Verify WebSocket connections and features
- Measure performance improvements vs standard RPC
- Validate network-specific endpoint mappings

**Running RPC Provider Tests**:
```bash
# Test Infura integration (requires API key in conf/rpc/infura.yml)
node scripts/test-infura-live.js

# Test Helius integration (requires API key in conf/rpc/helius.yml)
node scripts/test-helius-live.js

# Test provider switching functionality
node scripts/test-provider-switching.js
```

**Test Coverage Areas**:
- Provider initialization and configuration loading
- Automatic fallback to standard RPC on failures
- Network-specific endpoint resolution
- WebSocket connection establishment
- Performance benchmarking and health checks

For more details on the test setup and structure, see [Test README](./test/README.md).

## Development Guide
Expand Down Expand Up @@ -1010,12 +958,18 @@ testProviderIntegration();

3. **Implement trading methods** based on supported operations

4. **Create route files** following the pattern:
- Router routes in `router-routes/` (for DEX aggregators)
- AMM routes in `amm-routes/` (for V2-style pools)
- CLMM routes in `clmm-routes/` (for concentrated liquidity)
4. **Export plain operation functions** — not routes — following the pattern:
- Router operations in `router-routes/` (for DEX aggregators): `quoteSwap`, `executeSwap`, `executeQuote`
- AMM operations in `amm-routes/` (for V2-style pools)
- CLMM operations in `clmm-routes/` (for concentrated liquidity)

Each takes plain arguments and returns the shared response shape. Connectors no
longer register HTTP routes of their own; the unified `/trading/*` routes are the
only surface.

5. **Add configuration and register** in `src/connectors/connector.routes.ts`
5. **Add one entry per trading type** to `src/trading/connector-registry.ts`, which is
what wires the functions into the unified routes and into the `connector` enums the
schemas (and the OpenAPI document) advertise.

### Testing Requirements

Expand Down
Loading
Loading