Automate vaults with plain HTTP.
One REST API to trade Chamber vaults, run bots, rebalance indices, use lending markets and read market data, without running your own Web3 infrastructure.
Overview
The Infinite Trading API lets software do what a vault manager does by hand: trade, approve, lend, provide liquidity and run strategies. You send a short HTTP request, and the API builds, routes, signs and submits the on-chain transactions.
It sits in front of Chamber vaults (formerly dHEDGE). A Chamber vault is a smart contract that holds investor funds. A designated tradercan trade the vault's whitelisted assets but cannot withdraw investor funds. The API gives your code that trader role, so a strategy can run around the clock while custody stays in the vault.
What it replaces
Writing and maintaining transaction code, gas estimation, token approvals, slippage handling, DEX integrations and RPC failover for every network you trade on.
Who it is for
Quant and algorithmic traders, asset managers running Chamber vaults, and developers building products on top of automated, non-custodial strategies.
What it covers
Vault trading, bots and index rebalancing, Aave, Compound and Fluid lending, Uniswap V3 liquidity, fee collection, exchange sub-accounts and market data.
What it is not
Not a custodian: it never holds investor funds. Not investment advice: it executes the instructions you send.
How it works
Every request follows the same path from your code to the chain.
- Your clientA script, bot or app sends an HTTPS request with your API key.
- GatewayTLS, rate limiting and an allowlist of public endpoints.
- ValidationChecks the network, protocol, vault address and key, and resolves your gas wallet.
- ExecutorPicks a venue through a per-network fallback chain, builds and submits the transaction.
- On-chainThe gas wallet acts as the vault's trader and the result is returned as JSON.
Reads, such as poolComposition or getCandles, stop before the executor and never send a transaction. Anything that moves funds is signed by the gas wallet linked to your key, never by a shared signer.
Core concepts
Five ideas explain almost every endpoint.
Vault (pool)
The Chamber vault you operate, identified by its pool address (0x…). Holdings, positions and fees all belong to it.
Gas wallet & trader
A dedicated hot wallet that pays gas and is set as the vault's trader. Create a new one with createGasWallet or import yours with getNewApiKey. Keep only a small gas balance in it; the vault holds the funds.
API key
A UUID tied to one gas wallet. It authenticates requests, selects which wallet signs and is what usage is billed against.
Platform (venue)
The DEX or market to use. The default auto walks a fallback chain per network and skips venues that are banned or not whitelisted for the vault.
Bots
setBot stores a threshold strategy the platform checks for you. Index bots keep a basket at target weights within a USD cap per run.
Share vs amount
share is a percentage (0 to 100) of the available balance and takes precedence over amount. Prefer it for repeatable strategies.
Quickstart
From nothing to a first trade. Start on a small vault.
Get a gas wallet and API key
A gas wallet is a dedicated hot wallet that pays gas and acts as the vault's trader. You have two options.
Option A: create a new one
One call generates a fresh wallet and its API key. The private key is returned once, so store it securely right away. This endpoint is not listed in Swagger.
curl https://api.infinitetrading.io/createGasWallet # { # "status": ["success"], # "address": ["0x…"], # "private_key": ["…64 hex characters, no 0x prefix"], # "apiKey": ["…uuid"] # }Option B: import an existing hot wallet
Send its private key once to receive an API key. Do it over HTTPS from a trusted server, never from a browser, and only for a wallet that holds gas and nothing else.
curl -X POST https://api.infinitetrading.io/getNewApiKey -H "Content-Type: application/json" -d '{"privateKey": "0x…"}'One key per walletCallinggetNewApiKeyagain issues a new key and revokes the old one immediately. Anything still using the old key stops working.Fund it and make it the trader
Send a small amount of native gas token (ETH, POL and so on) to the wallet on every network you will trade on. Then set it as the trader of your Chamber vault. The Managers console does both for you, including creating or importing the wallet. Check the balance any time with
getGasBalance.curl "https://api.infinitetrading.io/getGasBalance?apiKey=KEY&network=base"Confirm the wiring
curl "https://api.infinitetrading.io/isPoolTrader?apiKey=KEY&network=base&pool=0xVAULT&trader=0xGASWALLET"Read before you write
Look at what the vault holds. This sends no transaction.
curl "https://api.infinitetrading.io/poolComposition?apiKey=KEY&network=base&pool=0xVAULT"Approve, then trade
Approve the asset once, then swap a share of the balance.
curl -X POST "https://api.infinitetrading.io/approve?apiKey=KEY&network=base&pool=0xVAULT&asset=USDC" curl "https://api.infinitetrading.io/vaultTrade?apiKey=KEY&network=base&pool=0xVAULT&from=USDC&to=WETH&share=25"
Conventions
Most endpoints accept both GET and POST. Parameters can go in the query string or the JSON body, and are merged.
| Parameter | Notes |
|---|---|
apiKey | Your per-wallet key. Required by almost every endpoint. |
network | base, optimism, arbitrum, polygon, ethereum (alias mainnet), hyperliquid |
protocol | dhedge by default. chamber is the current brand name and is accepted as an alias. |
pool | Vault contract address, 40 hex characters with a 0x prefix. |
platform | Execution venue. Default auto. Retired values such as odos are accepted and routed to auto, not rejected. |
asset | A symbol such as USDC or a contract address. |
share / amount | share is 0 to 100 percent of the available balance and wins over amount. |
dryRun | Available on fee-minting endpoints: simulate and quote without submitting. |
Errors & limits
Check the body, not just the HTTP status.
status.{
"status": ["fail"],
"status_code": ["1000"],
"message": ["Unrecognized network"]
}| Code | Meaning |
|---|---|
| 1000 | Unrecognized network |
| 1001 | Unrecognized protocol |
| 1002 | Invalid API key |
| 1004 | Invalid pool address |
| 1010 | Missing required parameter |
Execution errors and rate limits
Failures while executing (as opposed to validating) return HTTP 400 with a flat object that carries status, status_code and error_type.
The gateway allows roughly 30 requests per minute with a burst of 20; beyond that you receive an HTML 503, which is throttling and not an outage. The API itself also limits requests per minute. Back off and retry.
Endpoints
44 endpoints in 9 groups. Each group lists what it is for and what you can build with it. Parameters marked * are required. Use the interactive Swagger for request builders and live responses.
Wallet & keysCreate a gas wallet or import one you already have, and get the API key that identifies it. Almost every other endpoint needs that key.3
- Onboard a new strategy: create a gas wallet in one call, then fund it.
- Bring an existing hot wallet by requesting its API key.
- Rotate a leaked key. The old key is revoked immediately.
Generate a brand-new wallet and its API key in one call. Returns the address, the private key (shown once, 64 hex characters without 0x) and the key. No authentication. Not listed in Swagger.
Import an existing gas wallet: issue or replace the API key of the wallet identified by its private key. One key per wallet: calling it again revokes the previous key and moves linked vaults to the new one.
privateKey (body)Native gas-token balance of the wallet behind an API key, optionally in USD. Use it to alert before a bot runs out of gas.
network*, apiKey*, USDVault tradingThe core of the API: trade inside a Chamber vault, approve assets, run a bot on it and collect fees.5
- Turn an external signal (TradingView alert, ML model, script) into a vault trade.
- Run a threshold-based bot on a vault without hosting your own executor.
- Realise accrued performance and management fees.
Swap one vault asset for another. Routes across supported DEXs with fallbacks. Live trading: it executes on-chain.
apiKey*, pool*, from*, to*, network, platform, slippage, share, amountApprove an asset from the vault so a DEX or lending market can use it. Needed once per asset and venue.
apiKey*, network*, pool*, asset*, platformSet the trading-bot strategy for a vault (pair, side, threshold, size) and trigger a rebalance.
apiKey*, pool*, network*, pair*, side*, threshold, max_usd, slippage, share, platform, lendingRemove a vault's bot configuration, which turns the bot off.
apiKey*, network*, pool*Realise the performance and management fees a vault has accrued. Permissionless on-chain; the API key only pays the gas.
apiKey*, network*, pool*Bot statusCheck that a vault is wired up correctly and what its bot is doing.2
- Confirm your gas wallet is the vault trader before sending the first trade.
- Show bot state in your own dashboard.
Whether an address is the authorised on-chain trader for a vault.
apiKey*, network*, pool*, trader*The bot and index configuration of one vault: pair, side, parameters and whether allocations are set.
apiKey*, network*, pool*Index & allocationsKeep a vault at target weights. Define targets, preview the plan, then let a bounded rebalance run.7
- Run a crypto index or a risk-parity basket with automatic rebalancing.
- Preview drift and the sell-before-buy plan before allowing any trade.
Configure a scheduled index bot: interval, a USD cap per run and 2 to 20 targets that sum to 100. Disabled by default.
JSON bodyRead the index bot owned by the authenticated vault wallet.
Targets next to live weights, with drift in percentage points and whether each asset left its tolerance.
apiKey*, network*, pool*Preview drift and a bounded sell-before-buy plan without submitting trades.
Rebalance back to the targets. Dry-run by default; set execute=true to run the trades through vaultTrade.
apiKey*, network*, pool*, execute, force, quoteStop scheduled checks without deleting the allocation configuration.
Retired. Validates the legacy syntax but never writes. Use setIndexBot.
LendingPut idle vault assets to work on Aave, Compound or Fluid, and borrow against them.12
- Earn yield on stablecoins while a strategy is flat.
- Open a leveraged or short position by borrowing against collateral.
- Monitor health factor and liquidate-proof a position.
Supply an asset to Aave v3.
apiKey*, network*, pool*, asset*, share, amountWithdraw a supplied asset from Aave v3.
apiKey*, network*, pool*, asset*, share, amountBorrow from Aave v3 against the vault's collateral.
apiKey*, network*, pool*, asset*, share, amountRepay Aave v3 debt.
apiKey*, network*, pool*, asset*, share, amountTotal supplied on Aave v3.
Total borrowed on Aave v3.
Current Aave v3 health factor.
Full Aave v3 position data for a vault.
Supply an asset to Compound V3 (Comet).
apiKey*, network*, pool*, asset*, share, amountWithdraw an asset from Compound V3.
apiKey*, network*, pool*, asset*, share, amountSupply an asset to a Fluid fToken vault.
apiKey*, network*, pool*, asset*, share, amountWithdraw an asset from Fluid.
apiKey*, network*, pool*, asset*, share, amountLiquidityProvide and remove Uniswap V3 liquidity from a vault.2
- Earn trading fees on a concentrated range.
- Exit a position fully or by percentage.
Add liquidity to a Uniswap V3 pool. Give the source token, the pair and an optional price range for a concentrated position.
apiKey*, pool*, network*, asset1*, asset2*, input_asset*, platform, fee_tier, lower_price, upper_price, share, amount, slippageRemove liquidity from a position by NFT token id. Defaults to a full exit.
apiKey*, pool*, network*, asset1*, asset2*, token_id*, platform, amount, output_asset, slippagePools, market data & tokensRead-only data for dashboards, signals and symbol lookups.5
- Show a vault's holdings with symbols and decimals already resolved.
- Feed a strategy with OHLCV candles and live prices.
- Translate between token symbols and contract addresses per network.
The vault's holdings, symbol-resolved and decimal-adjusted.
apiKey*, pool*, network*OHLCV candles for a trading pair.
apiKey*, exchange, timeframe, pair, bars_backLatest live tick price for a pair.
apiKey*, exchange, pairToken symbol from a contract address.
apiKey*, contract*, network*Token contract address from a symbol.
apiKey*, symbol*, network*Fee operationsMint accrued manager fees for many vaults in a single transaction.2
- Sweep fees for every vault a manager runs in one transaction.
- Quote the cost first with dryRun=true.
Mint fees for a list of vaults in one Multicall3 transaction, so N vaults cost one transaction.
apiKey*, pools*, network*, protocol, dryRun, allowFailureGive a manager address and it finds the vaults, skips zero-fee ones and mints the rest in one transaction. Reports scanned and matched counts.
apiKey*, manager*, network, protocol, dryRun, allowFailureCentralized exchangesConnect an exchange sub-account and run a bot on it with the same model as on-chain vaults.6
- Run the same strategy on a CEX and on-chain.
- Pause a CEX bot without losing its configuration.
Connect an exchange account to a gas wallet. Exchange credentials are stored encrypted.
manager, signature, gas_wallet_api_key, exchange, subaccount_name, cex_api_key, cex_secret, cex_passphrase, payment_network, settingsSet the trading side and parameters of a CEX bot.
gas_wallet_api_key*, subaccount_name*, pair*, side*, max_usd*, share*, strategyRead the side and parameters of one or all CEX bots.
gas_wallet_api_key*, subaccount_name*, pairDeactivate a CEX bot without deleting it.
gas_wallet_api_key*, subaccount_name*, pair*Delete a CEX bot configuration.
gas_wallet_api_key*, subaccount_name*, pair*Delete a sub-account and, with it, all of its bots.
manager*, subaccount_name*, signature*Recipes
Common ways to combine endpoints.
Turn a signal into a trade
A TradingView alert, an ML model or a cron job decides when to buy or sell. Your webhook calls one endpoint and the API handles approvals, routing and gas.
- isPoolTrader
- approve
- vaultTrade
Run a bot without hosting an executor
Describe the pair, side and threshold once. The platform keeps checking and trades for you; delete the bot to switch it off.
- setBot
- getBotStatus
- deleteBot
Keep a basket at target weights
Define a crypto index, look at the drift and the planned trades, then allow a bounded rebalance. Every run is capped in USD.
- setIndexBot
- previewIndexBot
- rebalancePool
Earn on idle collateral
Park stablecoins in Aave, Compound or Fluid while a strategy is flat, and watch the health factor if you also borrow.
- approve
- aaveV3/lend
- aaveV3/getHealthFactor
- aaveV3/unlend
Collect fees across every vault
Quote first with dryRun, then mint accrued fees for all of a manager's vaults in a single transaction.
- mintAllFeesByManager (dryRun)
- mintAllFeesByManager
Build a read-only dashboard
No funds move and nothing is signed. Show holdings, prices and gas balance for your own vaults.
- poolComposition
- getCandles
- getTicks
- getGasBalance
Best practices
Habits that keep automated trading safe.
- Use a dedicated gas wallet. Fund it with gas only. The vault holds the money.
- Keep keys server-side. Never ship an API key in browser code or a public repo.
- Start small and read first. Use
poolComposition,previewIndexBotanddryRunbefore anything that moves funds. - Prefer share over amount so a strategy scales with the vault instead of hard-coding sizes.
- Watch gas. Poll
getGasBalanceand alert before the wallet runs dry. - Handle failures. Check the body for
status, retry 503s with backoff and make writes idempotent on your side. - Rotate on suspicion. Request a new key; the old one is revoked at once.