API reference

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.

Infinite Trading skill for your AI agentOne markdown file with the protocol, contracts and the full API with Swagger links, so an LLM can integrate correctly.

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.

  1. Your clientA script, bot or app sends an HTTPS request with your API key.
  2. GatewayTLS, rate limiting and an allowlist of public endpoints.
  3. ValidationChecks the network, protocol, vault address and key, and resolves your gas wallet.
  4. ExecutorPicks a venue through a per-network fallback chain, builds and submits the transaction.
  5. 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.

  1. 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 walletCalling getNewApiKey again issues a new key and revokes the old one immediately. Anything still using the old key stops working.
  2. 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"
  3. Confirm the wiring

    curl "https://api.infinitetrading.io/isPoolTrader?apiKey=KEY&network=base&pool=0xVAULT&trader=0xGASWALLET"
  4. 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"
  5. 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.

ParameterNotes
apiKeyYour per-wallet key. Required by almost every endpoint.
networkbase, optimism, arbitrum, polygon, ethereum (alias mainnet), hyperliquid
protocoldhedge by default. chamber is the current brand name and is accepted as an alias.
poolVault contract address, 40 hex characters with a 0x prefix.
platformExecution venue. Default auto. Retired values such as odos are accepted and routed to auto, not rejected.
assetA symbol such as USDC or a contract address.
share / amountshare is 0 to 100 percent of the available balance and wins over amount.
dryRunAvailable on fee-minting endpoints: simulate and quote without submitting.

Errors & limits

Check the body, not just the HTTP status.

Validation failures return HTTP 200Each field is a one-element array, a legacy of the original wire format that live strategies already parse. Always inspect status.
{
  "status": ["fail"],
  "status_code": ["1000"],
  "message": ["Unrecognized network"]
}
CodeMeaning
1000Unrecognized network
1001Unrecognized protocol
1002Invalid API key
1004Invalid pool address
1010Missing 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
Use cases
  • 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.
GET/createGasWalletChanges config

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.

POST/getNewApiKeyChanges config

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)
GET/getGasBalanceRead-only

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*, USD
Vault tradingThe core of the API: trade inside a Chamber vault, approve assets, run a bot on it and collect fees.5
Use cases
  • 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.
GET/vaultTradeMoves funds

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, amount
POST/approveMoves funds

Approve an asset from the vault so a DEX or lending market can use it. Needed once per asset and venue.

apiKey*, network*, pool*, asset*, platform
POST/setBotMoves funds

Set 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, lending
DELETE/deleteBotChanges config

Remove a vault's bot configuration, which turns the bot off.

apiKey*, network*, pool*
POST/mintManagerFeeMoves funds

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
Use cases
  • Confirm your gas wallet is the vault trader before sending the first trade.
  • Show bot state in your own dashboard.
GET/isPoolTraderRead-only

Whether an address is the authorised on-chain trader for a vault.

apiKey*, network*, pool*, trader*
GET/getBotStatusRead-only

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
Use cases
  • Run a crypto index or a risk-parity basket with automatic rebalancing.
  • Preview drift and the sell-before-buy plan before allowing any trade.
POST/setIndexBotChanges config

Configure a scheduled index bot: interval, a USD cap per run and 2 to 20 targets that sum to 100. Disabled by default.

JSON body
GET/getIndexBotRead-only

Read the index bot owned by the authenticated vault wallet.

GET/getCurrentAllocationsRead-only

Targets next to live weights, with drift in percentage points and whether each asset left its tolerance.

apiKey*, network*, pool*
GET/previewIndexBotRead-only

Preview drift and a bounded sell-before-buy plan without submitting trades.

POST/rebalancePoolMoves funds

Rebalance back to the targets. Dry-run by default; set execute=true to run the trades through vaultTrade.

apiKey*, network*, pool*, execute, force, quote
POST/disableIndexBotChanges config

Stop scheduled checks without deleting the allocation configuration.

POST/setAllocationsRead-only

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
Use cases
  • 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.
POST/aaveV3/lendMoves funds

Supply an asset to Aave v3.

apiKey*, network*, pool*, asset*, share, amount
POST/aaveV3/unlendMoves funds

Withdraw a supplied asset from Aave v3.

apiKey*, network*, pool*, asset*, share, amount
POST/aaveV3/borrowMoves funds

Borrow from Aave v3 against the vault's collateral.

apiKey*, network*, pool*, asset*, share, amount
POST/aaveV3/repayMoves funds

Repay Aave v3 debt.

apiKey*, network*, pool*, asset*, share, amount
GET/aaveV3/getSuppliedRead-only

Total supplied on Aave v3.

GET/aaveV3/getBorrowedRead-only

Total borrowed on Aave v3.

GET/aaveV3/getHealthFactorRead-only

Current Aave v3 health factor.

GET/aaveV3/getPoolDataRead-only

Full Aave v3 position data for a vault.

POST/compoundV3/lendMoves funds

Supply an asset to Compound V3 (Comet).

apiKey*, network*, pool*, asset*, share, amount
POST/compoundV3/unlendMoves funds

Withdraw an asset from Compound V3.

apiKey*, network*, pool*, asset*, share, amount
POST/fluid/lendMoves funds

Supply an asset to a Fluid fToken vault.

apiKey*, network*, pool*, asset*, share, amount
POST/fluid/unlendMoves funds

Withdraw an asset from Fluid.

apiKey*, network*, pool*, asset*, share, amount
LiquidityProvide and remove Uniswap V3 liquidity from a vault.2
Use cases
  • Earn trading fees on a concentrated range.
  • Exit a position fully or by percentage.
POST/addLiquidityMoves funds

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, slippage
POST/removeLiquidityMoves funds

Remove liquidity from a position by NFT token id. Defaults to a full exit.

apiKey*, pool*, network*, asset1*, asset2*, token_id*, platform, amount, output_asset, slippage
Pools, market data & tokensRead-only data for dashboards, signals and symbol lookups.5
Use cases
  • 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.
GET/poolCompositionRead-only

The vault's holdings, symbol-resolved and decimal-adjusted.

apiKey*, pool*, network*
GET/getCandlesRead-only

OHLCV candles for a trading pair.

apiKey*, exchange, timeframe, pair, bars_back
GET/getTicksRead-only

Latest live tick price for a pair.

apiKey*, exchange, pair
GET/getSymbolRead-only

Token symbol from a contract address.

apiKey*, contract*, network*
GET/getContractRead-only

Token contract address from a symbol.

apiKey*, symbol*, network*
Fee operationsMint accrued manager fees for many vaults in a single transaction.2
Use cases
  • Sweep fees for every vault a manager runs in one transaction.
  • Quote the cost first with dryRun=true.
GET/mintManagerFeeBatchMoves funds

Mint fees for a list of vaults in one Multicall3 transaction, so N vaults cost one transaction.

apiKey*, pools*, network*, protocol, dryRun, allowFailure
GET/mintAllFeesByManagerMoves funds

Give 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, allowFailure
Centralized exchangesConnect an exchange sub-account and run a bot on it with the same model as on-chain vaults.6
Use cases
  • Run the same strategy on a CEX and on-chain.
  • Pause a CEX bot without losing its configuration.
POST/registerCEXSubaccountChanges config

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, settings
POST/setCEXSideMoves funds

Set the trading side and parameters of a CEX bot.

gas_wallet_api_key*, subaccount_name*, pair*, side*, max_usd*, share*, strategy
GET/getCEXSideRead-only

Read the side and parameters of one or all CEX bots.

gas_wallet_api_key*, subaccount_name*, pair
POST/deactivateCEXBotChanges config

Deactivate a CEX bot without deleting it.

gas_wallet_api_key*, subaccount_name*, pair*
DELETE/deleteCEXBotChanges config

Delete a CEX bot configuration.

gas_wallet_api_key*, subaccount_name*, pair*
DELETE/deleteCEXSubaccountChanges config

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, previewIndexBot and dryRun before anything that moves funds.
  • Prefer share over amount so a strategy scales with the vault instead of hard-coding sizes.
  • Watch gas. Poll getGasBalance and 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.