Skip to content

feat / gateway update pool API to use chain+network organization#155

Merged
rapcmia merged 5 commits into
mainfrom
feat/pools-network-api
May 12, 2026
Merged

feat / gateway update pool API to use chain+network organization#155
rapcmia merged 5 commits into
mainfrom
feat/pools-network-api

Conversation

@fengtality

@fengtality fengtality commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add gateway_base_url attribute to AccountsService
  • Simplify CLMMPoolListItem to match Gateway fetch-pools response format
  • Update CLMMPoolListResponse to use pageSize instead of limit
  • Remove Query aliases to match hummingbot-api-client parameter names
  • Add GET/POST /gateway/apiKeys endpoints for RPC provider API key management
  • Add get_api_keys() and update_api_keys() methods to gateway_client
  • Add UpdateApiKeysRequest model

New Endpoints

GET /gateway/apiKeys

Returns all configured API keys from Gateway:

{
  "helius": "46951ec2-16af-4fc0-a5df-970b0eb925b7",
  "infura": "920646320ec3463fa1b5235be9fa48d3",
  "coingecko": "CG-Rw786jTpNmV1MvRrqpDAHR6r",
  "etherscan": ""
}

POST /gateway/apiKeys

Update API keys in Gateway configuration:

{
  "api_keys": {
    "helius": "new-api-key",
    "infura": "another-key"
  }
}

Response:

{
  "success": true,
  "message": "Updated 2 API key(s). Restart Gateway for changes to take effect.",
  "restart_required": true,
  "restart_endpoint": "POST /gateway/restart",
  "updated_keys": ["helius", "infura"]
}

Related PRs

Test plan

  • Manual testing with pool listing endpoints
  • Test GET /gateway/apiKeys returns current keys
  • Test POST /gateway/apiKeys updates keys correctly

🤖 Generated with Claude Code

- Update gateway_client to use chain+network as primary keys for pool operations
- get_pools: add chain parameter, connector becomes optional filter
- add_pool: add chain parameter
- remove_pool: change from connector to chain parameter
- Add new network-based pool endpoints: GET/POST/DELETE /networks/{network_id}/pools
- Deprecate legacy /pools endpoints (still functional for backward compatibility)
- Update models to reflect new API structure

This aligns with Gateway API changes that organize pools by network
instead of by DEX connector.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Simplify CLMMPoolListItem to match Gateway response format
- Update CLMMPoolListResponse to use pageSize instead of limit
- Add gateway_base_url to AccountsService
- Remove Query aliases to match client parameter names
- Remove is_verified field (not available from Gateway)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fengtality and others added 3 commits May 2, 2026 09:16
Previously, portfolio state refresh=true did not actually fetch fresh
balances from exchanges - it only read cached connector data.

Changes:
- _get_connector_tokens_info now calls connector._update_balances()
- Added skip_balance_refresh param to avoid double fetch in background loop
- Errors during balance refresh log warning and use stale data gracefully
- Added tests for refresh behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…list

- Add POST /gateway/networks/{network_id}/tokens/save/{token_address} endpoint
- Update get_gateway_wallets to include default_address for each chain
- Fix gateway_client save_token to pass json={} for correct content-type

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add GET /gateway/apiKeys to retrieve all configured API keys
- Add POST /gateway/apiKeys to update API keys
- Add UpdateApiKeysRequest model
- Add get_api_keys() and update_api_keys() to gateway_client

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rapcmia rapcmia self-requested a review May 8, 2026 02:44
@rapcmia rapcmia changed the title feat(gateway): update pool API to use chain+network organization feat / gateway update pool API to use chain+network organization May 8, 2026

@rapcmia rapcmia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Build local hummingbot lib from hummingbot/hummingbot#8206
  • Build local docker images for this PR and hummingbot/gateway#630
  • Start hummingbot-api via make deploy ok
  • Tested GET and POST /gateway/apiKeys on port 8000 ok
    • GET returns current keys.
    • POST successfully updated helius and infura.
    • Values are consistent with ./gateway-files/conf/apiKey.yml.
  • Manual pool-listing tests on solana-mainnet-beta for meteora, orca, and raydium (CLMM context) ok
    • Meteora and Orca address lookup works via GET /gateway/clmm/pools.
    • Raydium CLMM lookup works via GET /gateway/networks/{network_id}/pools?connector=raydium&pool_type=clmm (Raydium is not supported by GET /gateway/clmm/pools).
  • Token save test: passed.
    • POST /gateway/networks/solana-mainnet-beta/tokens/save/2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo succeeded and added PYUSD.
    • Verification via GET /gateway/networks/solana-mainnet-beta/tokens confirms token is present.
  • Test lp executor using meteora ok
    • LP executor creation passed for Meteora SOL-USDC
    • Executor lifecycle was validated end to end
      • RUNNING (in range, position created
      • Stop request accepted (/executors/{executor_id}, keep_position=true)
      • TERMINATED (close_type=POSITION_HOLD)
  • Portfolio/Balances
    • portfolio/state with refresh:true was verified after a real SOL -> USDC swap and reflected updated balances.
    • Multi-exchange + Gateway balance queries were verified with Binance + Solana balances returned, and Gateway wallets confirmed (Solana + Ethereum).
      • For ethereum, add preferred network to default_networks of ethereum-mainnet

@rapcmia rapcmia merged commit 020ffa7 into main May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants