### Setup Gateway Dependencies Source: https://github.com/hummingbot/gateway/blob/main/README.md Installs JavaScript libraries and compiles native dependencies using pnpm. Includes commands to force installation if USB HID errors occur on macOS/Linux or Windows. ```bash pnpm install ``` ```bash pnpm install --force ``` -------------------------------- ### Jest Configuration Example Source: https://github.com/hummingbot/gateway/blob/main/test/README.md Illustrates the basic Jest configuration for the Gateway project, specifying the test environment, setup files, and ignore patterns. ```javascript module.exports = { preset: 'ts-jest', testEnvironment: 'node', setupFilesAfterEnv: ['/test/jest-setup.js'], coveragePathIgnorePatterns: [ '/node_modules/', '/test/', '/dist/' ], modulePathIgnorePatterns: [ '/dist/' ] }; ``` -------------------------------- ### Build and Setup Gateway Source: https://github.com/hummingbot/gateway/blob/main/README.md Compiles TypeScript code into JavaScript and runs the Gateway setup script. Offers interactive setup or setup with all default configurations. ```bash pnpm build ``` ```bash pnpm run setup ``` ```bash pnpm run setup:with-defaults ``` -------------------------------- ### Scenario 1: Fresh Setup Validation Source: https://github.com/hummingbot/gateway/blob/main/scripts/README-testing.md Validates a fresh setup of the Gateway by cleaning configurations, running the setup script, and testing provider switching. This ensures the initial configuration and provider functionality are working correctly. ```bash # 1. Clean install rm -rf conf/ pnpm run setup # 2. Verify RPC provider options are presented # 3. Test both providers node scripts/test-provider-switching.js ``` -------------------------------- ### Install windows-build-tools on Windows Source: https://github.com/hummingbot/gateway/blob/main/README.md Install the necessary build tools for Windows using npm. This command should be run in PowerShell as an Administrator. ```powershell npm install --global windows-build-tools ``` -------------------------------- ### Install Node.js on Ubuntu/Debian Source: https://github.com/hummingbot/gateway/blob/main/README.md Install Node.js after adding the NodeSource repository. This ensures you have the required version for Hummingbot Gateway. ```bash sudo apt install -y nodejs ``` -------------------------------- ### Default Network Gas Configuration Example Source: https://github.com/hummingbot/gateway/blob/main/src/chains/ethereum/GAS_CONFIGURATION_GUIDE.md An example of minimal gas configuration for a network, setting only the minimum gas price. ```yaml minGasPrice: 0.01 ``` -------------------------------- ### Start Gateway Locally Source: https://github.com/hummingbot/gateway/blob/main/test/README.md Starts the Hummingbot Gateway in development mode with a provided passphrase. Use this to begin local development and testing. ```bash pnpm start --passphrase=test --dev ``` -------------------------------- ### Start Gateway Server (HTTP) Source: https://github.com/hummingbot/gateway/blob/main/README.md Starts the Gateway server in unencrypted HTTP mode using the `--dev` flag. A passphrase is still required for wallet encryption/decryption. ```bash pnpm start --passphrase= --dev ``` -------------------------------- ### Build and Run Commands for Hummingbot Gateway Source: https://github.com/hummingbot/gateway/blob/main/CLAUDE.md Commonly used pnpm commands for building, starting, testing, and managing the Hummingbot Gateway project. Use `--passphrase` when starting the server. ```bash pnpm build ``` ```bash pnpm start --passphrase= ``` ```bash pnpm start --passphrase= --dev ``` ```bash pnpm test ``` ```bash GATEWAY_TEST_MODE=dev jest --runInBand path/to/file.test.ts ``` ```bash pnpm test:cov ``` ```bash pnpm lint ``` ```bash pnpm format ``` ```bash pnpm typecheck ``` ```bash pnpm run setup ``` ```bash pnpm run setup:with-defaults ``` ```bash pnpm clean ``` -------------------------------- ### Install Node.js and Libraries on macOS Source: https://github.com/hummingbot/gateway/blob/main/README.md Install Node.js version 20 or later, along with libusb and python@3, using Homebrew. These are system requirements for building Hummingbot Gateway. ```bash brew install node@20 libusb python@3 ``` -------------------------------- ### Start Gateway Server Source: https://github.com/hummingbot/gateway/blob/main/scripts/README-testing.md Starts the Gateway server in development mode with a specified passphrase. Ensure you have a valid Helius API key configured in `conf/rpc/helius.yml`. ```bash pnpm start --passphrase=test123 --dev ``` -------------------------------- ### Install Homebrew on macOS Source: https://github.com/hummingbot/gateway/blob/main/README.md Install Homebrew, a package manager for macOS, if it is not already installed. This is a prerequisite for installing other development tools. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Legacy Transaction Log Example Source: https://github.com/hummingbot/gateway/blob/main/src/chains/ethereum/GAS_CONFIGURATION_GUIDE.md Example log output for legacy transactions, showing network legacy gas price and configured minimum gas price. BSC uses legacy gas pricing. ```log 2025-10-15 10:45:49 | info | Network legacy gas price: 1.5000 GWEI 2025-10-15 10:45:49 | info | Using configured minimum gas price: 3.0 GWEI (network: 1.5000 GWEI) 2025-10-15 10:45:49 | info | Estimated: 3.0 GWEI for network bsc ``` -------------------------------- ### List Supported Chains and Networks Source: https://context7.com/hummingbot/gateway/llms.txt Get a list of all supported blockchain chains and their available networks, like 'mainnet' or 'arbitrum' for Ethereum, and 'mainnet-beta' or 'devnet' for Solana. ```bash curl "http://localhost:15888/config/chains" # Expected response: # {"chains":{"ethereum":["mainnet","arbitrum","base","polygon","optimism","avalanche","bsc","celo","sepolia"],"solana":["mainnet-beta","devnet"]}} ``` -------------------------------- ### Running a Single Test File Source: https://github.com/hummingbot/gateway/blob/main/test/README.md Execute a specific test file, for example, `ethereum.test.js` within the chains directory. Use `GATEWAY_TEST_MODE=dev` for mocked connections. ```bash GATEWAY_TEST_MODE=dev jest --runInBand test/chains/ethereum.test.js ``` -------------------------------- ### List Configured Pools Source: https://context7.com/hummingbot/gateway/llms.txt Retrieve a list of all configured liquidity pools for a given connector and network. Example shown for Raydium and Uniswap. ```bash curl "http://localhost:15888/pools?connector=raydium&network=mainnet-beta" curl "http://localhost:15888/pools?connector=uniswap&network=mainnet" ``` -------------------------------- ### Install Xcode Command Line Tools on macOS Source: https://github.com/hummingbot/gateway/blob/main/README.md Use this command to install the Xcode Command Line Tools, which are required for the C++ compiler needed for native dependencies. ```bash xcode-select --install ``` -------------------------------- ### Install pnpm Package Manager Source: https://github.com/hummingbot/gateway/blob/main/README.md Installs the pnpm package manager globally and checks its version. pnpm is a faster and more space-efficient alternative to npm. ```bash sudo npm install -g pnpm ``` ```bash pnpm --version ``` -------------------------------- ### EIP-1559 Gas Price Example Source: https://github.com/hummingbot/gateway/blob/main/src/chains/ethereum/GAS_CONFIGURATION_GUIDE.md A concrete example demonstrating the calculation of the actual gas price paid for an EIP-1559 transaction given specific parameters. ```plaintext # Example: # maxFeePerGas = 0.1 GWEI # maxPriorityFeePerGas = 0.01 GWEI # baseFee = 0.004 GWEI (from network) # **Actual price paid** = 0.004 + 0.01 = 0.014 GWEI ✓ ``` -------------------------------- ### Create Connector Class - MyDex Source: https://github.com/hummingbot/gateway/blob/main/README.md Example of creating a connector class for a new DEX, demonstrating the singleton pattern for instance management. ```typescript export class MyDex { private static instances: Record = {}; public static getInstance(chain: string, network: string): MyDex { const key = `${chain}:${network}`; if (!MyDex.instances[key]) { MyDex.instances[key] = new MyDex(chain, network); } return MyDex.instances[key]; } } ``` -------------------------------- ### Update Package List and Install Dependencies on Ubuntu/Debian Source: https://github.com/hummingbot/gateway/blob/main/README.md Update your system's package list and install essential build tools, USB libraries, and Python 3. These are prerequisites for building Hummingbot Gateway. ```bash sudo apt update sudo apt install -y curl build-essential libusb-1.0-0-dev libudev-dev python3 ``` -------------------------------- ### API Keys Configuration Example Source: https://github.com/hummingbot/gateway/blob/main/README.md Centralized configuration for external service API keys. Add your keys for services like Helius, Infura, CoinGecko, Etherscan, and Jupiter. ```yaml helius: 'your_helius_api_key' infura: 'your_infura_api_key' coingecko: 'your_coingecko_api_key' etherscan: 'your_etherscan_api_key' jupiter: 'your_jupiter_api_key' ``` -------------------------------- ### GET /config/chains Source: https://context7.com/hummingbot/gateway/llms.txt Lists all supported chains and their available networks. ```APIDOC ## GET /config/chains ### Description Retrieves information about all supported blockchain chains and their respective networks. ### Method GET ### Endpoint /config/chains ### Response #### Success Response (200) - **chains** (object) - An object where keys are chain names (e.g., "ethereum", "solana") and values are arrays of supported network names for that chain. ``` -------------------------------- ### GET /config/connectors Source: https://context7.com/hummingbot/gateway/llms.txt Lists all available DEX connectors and their supported trading types. ```APIDOC ## GET /config/connectors ### Description Retrieves a list of all available decentralized exchange (DEX) connectors and the trading types they support. ### Method GET ### Endpoint /config/connectors ### Response #### Success Response (200) - **connectors** (object) - An object where keys are connector names (e.g., "uniswap", "jupiter") and values are arrays of supported trading types (e.g., "router", "amm", "clmm"). ``` -------------------------------- ### Create New Chain Implementation Source: https://github.com/hummingbot/gateway/blob/main/README.md Example of creating a new chain implementation by extending ChainBase and implementing the singleton pattern. ```typescript // src/chains/mychain/mychain.ts export class MyChain extends ChainBase { private static instances: Record = {}; public static getInstance(network: string): MyChain { if (!MyChain.instances[network]) { MyChain.instances[network] = new MyChain(network); } return MyChain.instances[network]; } } ``` -------------------------------- ### List Tokens by Chain and Network Source: https://context7.com/hummingbot/gateway/llms.txt Retrieve a list of tokens registered for a specific chain and network. Examples provided for Solana and Ethereum mainnets. ```bash curl "http://localhost:15888/tokens?chain=solana&network=mainnet-beta" curl "http://localhost:15888/tokens?chain=ethereum&network=mainnet" ``` -------------------------------- ### Get Configuration Values Source: https://context7.com/hummingbot/gateway/llms.txt Retrieve current configuration settings for a specified namespace. Changes made via PUT /config persist to disk. ```bash curl "http://localhost:15888/config?namespace=server" # Expected response: # {"port":15888,"logLevel":"info","logToStdOut":false,"fastifyLogs":false,"unsafeDevModeWithHTTP":false} curl "http://localhost:15888/config?namespace=jupiter" # {"allowedSlippage":"1","onlyDirectRoutes":false,"restrictIntermediateTokens":false,"priorityLevel":"medium","maxLamports":1000000} ``` -------------------------------- ### Install Testing Dependencies Source: https://github.com/hummingbot/gateway/blob/main/scripts/README-testing.md Installs necessary npm packages for testing the Helius RPC provider integration. This includes libraries for network requests, YAML parsing, and Solana web3 functionalities. ```bash npm install axios ws js-yaml chalk @solana/web3.js ``` -------------------------------- ### Check Node.js Version Source: https://github.com/hummingbot/gateway/blob/main/README.md Verify that Node.js is installed and check its version. This command should output the version number, confirming it meets the minimum requirement of 20+. ```bash node --version ``` -------------------------------- ### EIP-1559 Transaction Log Example Source: https://github.com/hummingbot/gateway/blob/main/src/chains/ethereum/GAS_CONFIGURATION_GUIDE.md Example log output for EIP-1559 transactions, showing base fee, max fee, and priority fee. This is used for unsupported networks that fall back to RPC. ```log 2025-10-15 10:34:01 | info | Network RPC EIP-1559 fees: baseFee=0.0004 GWEI, maxFee=0.0104 GWEI, priority=0.0100 GWEI 2025-10-15 10:34:01 | info | Using network EIP-1559 fees: maxFee=0.0104 GWEI, priority=0.0100 GWEI 2025-10-15 10:34:01 | info | Estimated: 0.01 GWEI for network base ``` -------------------------------- ### GET /config Source: https://context7.com/hummingbot/gateway/llms.txt Retrieves the current configuration values for a given namespace. ```APIDOC ## GET /config ### Description Fetches the current configuration settings for a specified namespace. ### Method GET ### Endpoint /config ### Parameters #### Query Parameters - **namespace** (string) - Required - The name of the configuration namespace to retrieve (e.g., "server", "jupiter"). ### Response #### Success Response (200) - Returns an object containing the configuration key-value pairs for the requested namespace. ``` -------------------------------- ### GET /config/namespaces Source: https://context7.com/hummingbot/gateway/llms.txt Returns all registered configuration namespace names. ```APIDOC ## GET /config/namespaces ### Description Retrieves a list of all available configuration namespaces within the Hummingbot Gateway. ### Method GET ### Endpoint /config/namespaces ### Response #### Success Response (200) - **namespaces** (array of strings) - A list of namespace names (e.g., "server", "ethereum", "solana"). ``` -------------------------------- ### Add NodeSource Repository for Node.js 20.x on Ubuntu/Debian Source: https://github.com/hummingbot/gateway/blob/main/README.md Add the NodeSource repository to your system to enable installation of Node.js version 20.x. ```bash curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - ``` -------------------------------- ### Get Ethereum Token Balances Source: https://context7.com/hummingbot/gateway/llms.txt Retrieves token balances for a given Ethereum address and network. Can fetch all non-zero balances or specific token balances. ```bash # Get all non-zero balances curl -X POST http://localhost:15888/chains/ethereum/balances \ -H "Content-Type: application/json" \ -d '{"network": "mainnet", "address": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B"}' ``` ```bash # Get specific token balances curl -X POST http://localhost:15888/chains/ethereum/balances \ -H "Content-Type: application/json" \ -d '{"network": "mainnet", "address": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B", "tokens": ["ETH", "USDC", "WBTC"]}' ``` -------------------------------- ### Get Pool Info using cURL Source: https://github.com/hummingbot/gateway/blob/main/src/connectors/pancakeswap-sol/README.md Example of how to retrieve information about a specific liquidity pool on PancakeSwap Solana CLMM. Requires the network and the pool's address. ```bash curl "http://localhost:15888/connectors/pancakeswap-sol/clmm/pool-info?network=mainnet-beta&poolAddress=DJNtGuBGEQiUCWE8F981M2C3ZghZt2XLD8f2sQdZ6rsZ" ``` -------------------------------- ### List Configuration Namespaces Source: https://context7.com/hummingbot/gateway/llms.txt Retrieve a list of all registered configuration namespace names, such as 'server', 'ethereum', 'solana', and various DEX connectors. ```bash curl "http://localhost:15888/config/namespaces" # Expected response: # {"namespaces":["server","ethereum","solana","jupiter","uniswap","raydium","meteora","0x","pancakeswap","helius","infura"]} ``` -------------------------------- ### Get 0x DEX Aggregator Swap Quote Source: https://context7.com/hummingbot/gateway/llms.txt Gets a swap quote from the 0x DEX aggregator API on Ethereum/EVM chains. ```APIDOC ## GET /connectors/0x/router/quote-swap ### Description Gets a swap quote from the 0x DEX aggregator API on Ethereum/EVM chains. ### Method GET ### Endpoint /connectors/0x/router/quote-swap ### Parameters #### Query Parameters - **network** (string) - Required - The blockchain network (e.g., "mainnet"). - **baseToken** (string) - Required - The symbol or address of the base token. - **quoteToken** (string) - Required - The symbol or address of the quote token. - **amount** (number) - Required - The amount of the base token to swap. - **side** (string) - Required - The side of the swap (e.g., "SELL" or "BUY"). - **slippagePct** (number) - Required - The maximum slippage percentage allowed. ### Response #### Success Response (200) - **quoteId** (string) - The ID of the swap quote. - **tokenIn** (string) - The input token address. - **tokenOut** (string) - The output token address. - **amountIn** (number) - The amount of input token. - **amountOut** (number) - The amount of output token. - **price** (number) - The price of the swap. - **priceImpactPct** (number) - The percentage price impact of the swap. ``` -------------------------------- ### GET /connectors/jupiter/router/quote-swap Source: https://context7.com/hummingbot/gateway/llms.txt Gets an executable swap quote from Jupiter DEX aggregator on Solana. Returns a `quoteId` that can be used with `execute-quote` for deferred execution. ```APIDOC ## GET /connectors/jupiter/router/quote-swap ### Description Gets an executable swap quote from Jupiter DEX aggregator on Solana. Returns a `quoteId` that can be used with `execute-quote` for deferred execution. ### Endpoint `/connectors/jupiter/router/quote-swap` ### Parameters #### Query Parameters - **network** (string) - Required - The Solana network (e.g., "mainnet-beta"). - **baseToken** (string) - Required - The token to trade FROM. - **quoteToken** (string) - Required - The token to trade TO. - **amount** (number) - Required - The amount of `baseToken` to trade. - **side** (string) - Required - The direction of the trade ("SELL" or "BUY"). - **slippagePct** (number) - Optional - The maximum slippage percentage allowed (e.g., 0.5 for 0.5%). ### Request Example (Sell SOL for USDC) ```bash http://localhost:15888/connectors/jupiter/router/quote-swap?network=mainnet-beta&baseToken=SOL"eToken=USDC&amount=1&side=SELL&slippagePct=0.5 ``` ### Request Example (Buy SOL with USDC) ```bash http://localhost:15888/connectors/jupiter/router/quote-swap?network=mainnet-beta&baseToken=SOL"eToken=USDC&amount=100&side=BUY&slippagePct=1 ``` ### Response #### Success Response (200) - **quoteId** (string) - A unique identifier for the swap quote. - **tokenIn** (string) - The mint address of the input token. - **tokenOut** (string) - The mint address of the output token. - **amountIn** (number) - The amount of input token. - **amountOut** (number) - The estimated amount of output token. - **price** (number) - The estimated price of the swap. - **priceImpactPct** (number) - The percentage price impact of the swap. - **minAmountOut** (number) - The minimum amount of output token expected after slippage. - **maxAmountIn** (number) - The maximum amount of input token that will be used. - **quoteResponse** (object) - The raw response from the Jupiter API containing detailed route information. ### Response Example ```json { "quoteId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "tokenIn": "So11111111111111111111111111111111111111112", "tokenOut": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "amountIn": 1, "amountOut": 162.45, "price": 162.45, "priceImpactPct": 0.01, "minAmountOut": 161.63, "maxAmountIn": 1, "quoteResponse": { "inputMint": "...", "inAmount": "1000000000", "outputMint": "...", "outAmount": "162450000", "routePlan": [...] } } ``` ``` -------------------------------- ### Launch Gateway with Docker Compose Source: https://github.com/hummingbot/gateway/blob/main/README.md Starts the Gateway server using Docker Compose in detached mode and displays logs. Use `--build` to rebuild the image and restart after code changes. ```bash docker compose up -d ``` ```bash docker compose logs -f gateway ``` ```bash docker compose up -d --build ``` -------------------------------- ### POST /wallet/create Source: https://context7.com/hummingbot/gateway/llms.txt Generates a brand-new keypair and stores it in the encrypted wallet store. ```APIDOC ## POST /wallet/create ### Description Generates a new cryptographic keypair (public and private keys) and securely stores it within the Gateway's encrypted wallet. ### Method POST ### Endpoint /wallet/create ### Parameters #### Request Body - **chain** (string) - Required - The blockchain network for which to create the wallet (e.g., "solana"). ### Request Example ```json { "chain": "solana" } ``` ### Response #### Success Response (200) - **address** (string) - The public address of the newly created wallet. - **chain** (string) - The blockchain network for which the wallet was created. - **mnemonic** (string) - The mnemonic phrase for recovering the wallet (should be stored securely). ``` -------------------------------- ### POST /wallet/add Source: https://context7.com/hummingbot/gateway/llms.txt Imports an existing wallet from a private key and optionally sets it as the default for its chain. ```APIDOC ## POST /wallet/add ### Description Imports an existing wallet using its private key and optionally designates it as the default wallet for its associated blockchain. ### Method POST ### Endpoint /wallet/add ### Parameters #### Request Body - **chain** (string) - Required - The blockchain network for which the wallet is being added (e.g., "solana", "ethereum"). - **privateKey** (string) - Required - The private key of the wallet to import. - **setDefault** (boolean) - Optional - If true, this wallet will be set as the default for the specified chain. ### Request Example ```json { "chain": "solana", "privateKey": "", "setDefault": true } ``` ### Response #### Success Response (200) - **address** (string) - The public address of the imported wallet. - **chain** (string) - The blockchain network of the imported wallet. ``` -------------------------------- ### Uniswap AMM Route Test Example Source: https://github.com/hummingbot/gateway/blob/main/test/README.md An example of a Jest test case for Uniswap AMM routes. It mocks the application and injects options to test the retrieval of pool information. ```javascript // test/connectors/uniswap/amm.test.js describe('Uniswap AMM Routes', () => { const mockApp = { inject: (options) => { // Mock implementation } }; beforeEach(() => { // Setup mocks }); it('should return pool information', async () => { const response = await mockApp.inject({ method: 'GET', url: '/connectors/uniswap/amm/pool-info', query: { chain: 'ethereum', network: 'mainnet', tokenA: 'USDC', tokenB: 'WETH' } }); expect(response.statusCode).toBe(200); expect(response.json()).toMatchObject({ poolAddress: expect.any(String), token0: expect.any(String), token1: expect.any(String) }); }); }); ``` -------------------------------- ### Configure Gateway Environment Variables (Docker Compose) Source: https://github.com/hummingbot/gateway/blob/main/README.md Example configuration for `docker-compose.yml` showing how to set the Gateway passphrase and development mode. `DEV=true` enables HTTP, `DEV=false` requires SSL certificates for HTTPS. ```yaml environment: - GATEWAY_PASSPHRASE=a # Replace with a strong passphrase - DEV=true # Set to false for HTTPS mode (requires certificates) ``` -------------------------------- ### Configure Network Gas Settings (EIP-1559) Source: https://github.com/hummingbot/gateway/blob/main/src/chains/ethereum/GAS_CONFIGURATION_GUIDE.md Example configuration for an EIP-1559 network, specifying chain ID, node URL, native currency, minimum gas price, and optional EIP-1559 gas parameters. ```yaml chainID: 8453 nodeURL: https://mainnet.base.org nativeCurrencySymbol: ETH minGasPrice: 0.01 # EIP-1559 gas parameters (in GWEI) # If not set, will fetch from Etherscan API (if etherscanAPIKey is set in ethereum.yml) or network RPC # maxFeePerGas: 0.01 # maxPriorityFeePerGas: 0.01 ``` -------------------------------- ### Get Uniswap Universal Router Swap Quote Source: https://context7.com/hummingbot/gateway/llms.txt Use this endpoint to get a swap quote from Uniswap's Universal Router on EVM chains. Specify network, tokens, amount, and slippage. ```bash # Quote selling 1 ETH for USDC on Ethereum mainnet curl "http://localhost:15888/connectors/uniswap/router/quote-swap?network=mainnet&baseToken=ETH"eToken=USDC&amount=1&side=SELL&slippagePct=0.5" ``` ```bash # Quote on Base L2 curl "http://localhost:15888/connectors/uniswap/router/quote-swap?network=base&baseToken=WETH"eToken=USDC&amount=1&side=SELL&slippagePct=1" ``` -------------------------------- ### Import Wallet from Private Key Source: https://context7.com/hummingbot/gateway/llms.txt Add an existing wallet to the Gateway's encrypted store by providing its private key. Optionally set it as the default for its chain. Supports Solana and Ethereum. ```bash # Add a Solana wallet curl -X POST http://localhost:15888/wallet/add \ -H "Content-Type: application/json" \ -d '{"chain": "solana", "privateKey": "", "setDefault": true}' # Add an Ethereum wallet curl -X POST http://localhost:15888/wallet/add \ -H "Content-Type: application/json" \ -d '{"chain": "ethereum", "privateKey": "0xabc123...", "setDefault": true}' # Expected response: # {"address":"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU","chain":"solana"} ``` -------------------------------- ### Ethereum Mainnet Configuration (Recommended) Source: https://github.com/hummingbot/gateway/blob/main/src/chains/ethereum/GAS_CONFIGURATION_GUIDE.md Example configuration for Ethereum Mainnet using the Etherscan API. Set a higher `minGasPrice` to ensure transaction confirmation, as Mainnet fees vary significantly. The same Etherscan API key works for multiple chains. ```yaml etherscanAPIKey: 'YOUR_ETHERSCAN_API_KEY' ``` ```yaml chainID: 1 nodeURL: https://eth.llamarpc.com nativeCurrencySymbol: ETH minGasPrice: 1.0 # maxFeePerGas: 10 # Commented out - fetch from Etherscan # maxPriorityFeePerGas: 2 # Commented out - fetch from Etherscan ``` -------------------------------- ### Get 0x DEX Aggregator Swap Quote Source: https://context7.com/hummingbot/gateway/llms.txt Gets a swap quote from the 0x DEX aggregator API on Ethereum/EVM chains. Requires network, base token, quote token, amount, side, and slippage percentage. ```bash curl "http://localhost:15888/connectors/0x/router/quote-swap?network=mainnet&baseToken=ETH"eToken=USDC&amount=1&side=SELL&slippagePct=0.5" # Expected response: # { # "quoteId": "b2c3d4e5- सहा", # "tokenIn": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", # "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", # "amountIn": 1, # "amountOut": 3242.10, # "price": 3242.10, # "priceImpactPct": 0.02 # } ``` -------------------------------- ### POST /chains/solana/wrap Source: https://context7.com/hummingbot/gateway/llms.txt Wraps SOL into Wrapped SOL (WSOL) on the Solana network. ```APIDOC ## POST /chains/solana/wrap ### Description Wraps SOL into Wrapped SOL (WSOL). ### Endpoint `/chains/solana/wrap` ### Parameters #### Request Body - **network** (string) - Required - The Solana network to use (e.g., "mainnet-beta"). - **address** (string) - Required - The wallet address for the wrap operation. - **amount** (string) - Required - The amount of SOL to wrap. ### Request Example ```json { "network": "mainnet-beta", "address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "amount": "1.0" } ``` ``` -------------------------------- ### GET /wallet Source: https://context7.com/hummingbot/gateway/llms.txt Returns all stored wallet addresses grouped by chain. ```APIDOC ## GET /wallet ### Description Retrieves a list of all wallet addresses currently stored and managed by the Hummingbot Gateway, organized by their respective blockchain networks. ### Method GET ### Endpoint /wallet ### Response #### Success Response (200) - **wallets** (object) - An object where keys are chain names (e.g., "solana", "ethereum") and values are arrays of wallet addresses associated with that chain. ``` -------------------------------- ### Test RPC Providers with Live API Keys Source: https://github.com/hummingbot/gateway/blob/main/AGENTS.md Run live integration tests for Infura and Helius RPC providers. Ensure API keys are configured in conf/rpc/*.yml before execution. ```bash node scripts/test-infura-live.js ``` ```bash node scripts/test-helius-live.js ``` -------------------------------- ### GET /chains/ethereum/estimate-gas Source: https://context7.com/hummingbot/gateway/llms.txt Estimates the current gas price in GWEI on an Ethereum network. ```APIDOC ## GET /chains/ethereum/estimate-gas ### Description Estimates the current gas price in GWEI on an Ethereum network. ### Endpoint `/chains/ethereum/estimate-gas` ### Parameters #### Query Parameters - **network** (string) - Required - The Ethereum network to query (e.g., "mainnet"). ### Response #### Success Response (200) - **gasPrice** (number) - The estimated gas price in GWEI. - **gasPriceToken** (string) - The token for the gas price (e.g., "ETH"). - **gasLimit** (number) - The estimated gas limit for a standard transaction. - **gasCost** (string) - The estimated cost of gas for a standard transaction. ### Response Example ```json { "gasPrice": 25.5, "gasPriceToken": "ETH", "gasLimit": 21000, "gasCost": "0.0005355" } ``` ``` -------------------------------- ### Test RPC Providers with Live API Keys Source: https://github.com/hummingbot/gateway/blob/main/GEMINI.md Execute integration tests for Infura and Helius RPC providers using configured API keys. Ensure API keys are set up in `conf/rpc/*.yml` before running. ```bash # Requires configured API keys in conf/rpc/*.json node scripts/test-infura-live.js ``` ```bash # Requires configured API keys in conf/rpc/*.json node scripts/test-helius-live.js ``` -------------------------------- ### Test RPC Providers with Live API Keys Source: https://github.com/hummingbot/gateway/blob/main/CLAUDE.md Execute live integration tests for Infura and Helius RPC providers. Ensure API keys are configured in conf/rpc/*.yml before running. ```bash # Requires configured API keys in conf/rpc/*.yml node scripts/test-infura-live.js ``` ```bash node scripts/test-helius-live.js ``` -------------------------------- ### GET /chains/solana/status Source: https://context7.com/hummingbot/gateway/llms.txt Returns the current Solana chain status including block height and RPC provider info. ```APIDOC ## GET /chains/solana/status ### Description Returns the current Solana chain status including block height and RPC provider info. ### Endpoint `/chains/solana/status` ### Parameters #### Query Parameters - **network** (string) - Required - The Solana network to query (e.g., "mainnet-beta"). ### Response #### Success Response (200) - **chain** (string) - The name of the blockchain. - **network** (string) - The specific network of the chain. - **rpcUrl** (string) - The URL of the RPC provider. - **rpcProvider** (string) - The name of the RPC provider. - **currentBlockNumber** (number) - The current block height of the chain. - **nativeCurrency** (string) - The native currency of the chain (e.g., "SOL"). - **swapProvider** (string) - The configured swap provider (e.g., "jupiter/router"). ### Response Example ```json { "chain": "solana", "network": "mainnet-beta", "rpcUrl": "https://mainnet.helius-rpc.com/?api-key=...", "rpcProvider": "helius", "currentBlockNumber": 298765432, "nativeCurrency": "SOL", "swapProvider": "jupiter/router" } ``` ``` -------------------------------- ### Migrate Pool Templates (CLI) Source: https://github.com/hummingbot/gateway/blob/main/AGENTS.md Execute this command to migrate existing pool templates to the new format. Ensure RPC endpoints are configured beforehand. ```bash # Ensure RPC endpoints are configured in conf/rpc/*.yml npx ts-node scripts/migrate-pool-templates.ts ``` -------------------------------- ### Get CLMM Positions Source: https://context7.com/hummingbot/gateway/llms.txt Retrieve information about a specific Concentrated Liquidity Market Making (CLMM) position using its address. ```APIDOC ## GET /trading/clmm/positions ### Description Retrieves information for a specific Concentrated Liquidity Market Making (CLMM) position, identified by its unique address. ### Method GET ### Endpoint /trading/clmm/positions ### Parameters #### Query Parameters - **connector** (string) - Required - The CLMM connector used for the position (e.g., "raydium"). - **chainNetwork** (string) - Required - The blockchain network where the position is located (e.g., "solana-mainnet-beta"). - **positionAddress** (string) - Required - The unique address of the CLMM position. ``` -------------------------------- ### Quote Swap Source: https://context7.com/hummingbot/gateway/llms.txt Get a quote for a token swap. Supports various chains and connectors, with options for specifying AMMs and slippage. ```APIDOC ## GET /trading/swap/quote ### Description Retrieves a quote for a token swap operation. This endpoint can be used to determine the expected output amount for a given swap. ### Method GET ### Endpoint /trading/swap/quote ### Parameters #### Query Parameters - **chainNetwork** (string) - Required - The blockchain network to perform the swap on (e.g., "solana-mainnet-beta", "ethereum-polygon"). - **baseToken** (string) - Required - The token to be sold. - **quoteToken** (string) - Required - The token to be bought. - **amount** (number) - Required - The amount of baseToken to swap. - **side** (string) - Required - The direction of the swap ('SELL' or 'BUY'). - **connector** (string) - Optional - The specific decentralized exchange or router to use (e.g., "raydium/amm", "pancakeswap/router"). If not specified, a default provider is used. - **slippagePct** (number) - Optional - The maximum acceptable slippage percentage. ``` -------------------------------- ### Quote Swap Source: https://github.com/hummingbot/gateway/blob/main/src/connectors/pancakeswap-sol/README.md Get a swap quote for a token pair on PancakeSwap Solana CLMM, using the current spot price. ```APIDOC ## GET /connectors/pancakeswap-sol/clmm/quote-swap ### Description Get swap quote for a token pair (simplified - uses spot price). ### Method GET ### Endpoint /connectors/pancakeswap-sol/clmm/quote-swap ### Parameters #### Query Parameters - **network** (string) - Required - Solana network - **baseToken** (string) - Required - Base token symbol or address - **quoteToken** (string) - Required - Quote token symbol or address - **amount** (number) - Required - Amount to swap - **side** (string) - Required - Trade direction (BUY or SELL) - **poolAddress** (string) - Optional - Pool address - **slippagePct** (number) - Optional - Slippage percentage (default: 1%) ### Response #### Success Response (200) - **Quote** (object) - Quote including price, amounts, and slippage protection. ### Limitations - Uses current pool spot price (no tick calculations) - Does not calculate price impact across ticks - Does not account for liquidity depth - Suitable for small trades where price impact is minimal ``` -------------------------------- ### Wrap SOL to WSOL on Solana Source: https://context7.com/hummingbot/gateway/llms.txt Converts native SOL into Wrapped SOL (WSOL) on the Solana network. Specify the network, wallet address, and the amount of SOL to wrap. ```bash curl -X POST http://localhost:15888/chains/solana/wrap \ -H "Content-Type: application/json" \ -d '{ "network": "mainnet-beta", "address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "amount": "1.0" }' ``` -------------------------------- ### Get Real API Responses Source: https://github.com/hummingbot/gateway/blob/main/test/README.md Fetches real API responses from the Gateway. Use these responses to update mock files. ```bash curl http://localhost:15888/chains/ethereum/status ``` -------------------------------- ### Run Infura Live RPC Provider Test Source: https://github.com/hummingbot/gateway/blob/main/README.md Execute live integration tests for the Infura RPC provider. Requires an API key configured in conf/rpc/infura.yml. ```bash node scripts/test-infura-live.js ``` -------------------------------- ### POST /restart Source: https://context7.com/hummingbot/gateway/llms.txt Gracefully restarts the Gateway process by spawning a new instance before exiting. ```APIDOC ## POST /restart ### Description Restarts the Hummingbot Gateway server. ### Method POST ### Endpoint /restart ### Response #### Success Response (200) - The server restarts immediately upon receiving this request. ``` -------------------------------- ### List Available DEX Connectors Source: https://context7.com/hummingbot/gateway/llms.txt View all available Decentralized Exchange (DEX) connectors and the trading types they support (e.g., 'router', 'amm', 'clmm'). ```bash curl "http://localhost:15888/config/connectors" # Expected response: # {"connectors":{"jupiter":["router"],"meteora":["clmm"],"raydium":["amm","clmm"],"uniswap":["router","amm","clmm"],"0x":["router"],"pancakeswap":["router","amm","clmm"],"pancakeswap-sol":["clmm"],"orca":["clmm"]}} ``` -------------------------------- ### Get CLMM Position Information Source: https://context7.com/hummingbot/gateway/llms.txt Retrieve information about a specific CLMM position using its address and the relevant connector and chain network. ```bash curl "http://localhost:15888/trading/clmm/positions?connector=raydium&chainNetwork=solana-mainnet-beta&positionAddress=AaBbCc..." ``` -------------------------------- ### Connector Operations - Router Source: https://github.com/hummingbot/gateway/blob/main/README.md Operations for interacting with DEX aggregators via the router, including getting swap quotes and executing swaps. ```APIDOC ## POST /connectors/{dex}/{type}/quote ### Description Get a swap quote from an aggregator. ### Method POST ### Endpoint /connectors/{dex}/{type}/quote ``` ```APIDOC ## POST /connectors/{dex}/{type}/swap ### Description Execute a swap through an aggregator. ### Method POST ### Endpoint /connectors/{dex}/{type}/swap ```