---
name: infinite-trading-protocol
description: Full context on the Infinite Trading protocol and its REST API for LLM agents and developers. Use it to integrate the Infinite Trading API (Swagger/OpenAPI), create or import gas wallets, trade and manage Chamber (dHEDGE) vaults, run bots and index rebalancing, use lending and liquidity endpoints, and to answer questions about ITP, the DAO, staking, auto-compounders, stSATO, cbEGGS, liquidity pools, loans, perpetuals and the app.
---

# Infinite Trading: skill for AI agents

Last updated: October 2026. Public information only. Verify anything that moves funds against the live app, the Swagger docs and the contracts before acting.

## 0. How to use this file

- You are helping a developer, trader or vault manager integrate with **Infinite Trading** or understand it.
- Prefer the live sources over this file when they disagree:
  - Interactive Swagger: `https://api.infinitetrading.io/__docs__/`
  - OpenAPI spec (JSON): `https://api.infinitetrading.io/openapi.json`
  - Human docs and API reference: `https://www.infinitetrading.io/api-docs`
  - Protocol field guide: `https://www.infinitetrading.io/docs`
- Never ask a user to paste a private key into a chat. If a flow needs a key, tell them to run the command themselves on a trusted machine, and never log or echo it.
- Never invent contract addresses, endpoints or parameters. If something is not in this file or the OpenAPI spec, say so.
- Nothing here is investment advice. Strategies carry risk, past performance does not guarantee future results, and vault values can fall.

## 1. What Infinite Trading is

Infinite Trading is a DeFi asset-management platform. It connects market intelligence, automated strategies and on-chain tools:

| Product            | What it is                                                                                        | Where                              |
| ------------------ | ------------------------------------------------------------------------------------------------- | ---------------------------------- |
| Strategy vaults    | Chamber (formerly dHEDGE) vaults: trading bots, AI/ML strategies, yield, indices, RWA             | `/app`, `/vault/<address>`         |
| Auto-compounders   | Vaults that harvest and reinvest LP rewards (Velodrome on Optimism, Uniswap V3 on Base)           | `/auto-compounder`                 |
| Boosted LP staking | Stake Velodrome ITP LP tokens for boosted ITP rewards on Optimism                                 | `/boosted-lp`                      |
| ITP staking        | Lock ITP for 1 to 4 years to earn ITP rewards (Staking V1, Optimism)                              | `/staking`                         |
| stSATO             | Bonding-curve liquid-staking token backed by SATO on Ethereum                                     | `stsato.org`, `/yield`             |
| cbEGGS             | EGGS-style bonding-curve token on Base backed by ETH                                              | `cbeggs.finance`                   |
| Loans              | Aave, Compound and Fluid positions with health factors, plus stSATO and cbEGGS token-native loans | `/loans`                           |
| Trading            | Swap and bridge (Li.Fi), including tokenized stocks and RWAs                                      | `/trade`                           |
| Perpetuals         | Perpetual futures built on Orderly                                                                | `https://perps.infinitetrading.io` |
| Market scanner     | Multi-timeframe signals, watchlists and charts                                                    | `/market-scanner`                  |
| Managers console   | Run gas wallets, vaults, bots and CEX accounts                                                    | `/managers`                        |
| API                | REST API to automate all of the above                                                             | `/api`, `/api-docs`                |
| Robinhood agent    | Proof-of-concept autonomous agent on Robinhood Chain (simulated data)                             | `/robinhood`                       |
| Dashboard          | ITP burns and incentives                                                                          | `/dashboard`                       |

Supported networks: Ethereum, Optimism, Base, Arbitrum, Polygon (the API also accepts `hyperliquid`). Official links: app `https://www.infinitetrading.io/app`, X `@InfiniteTradePR`, Discord `https://discord.gg/dX2dJqZZDr`, Telegram `https://t.me/infinitetradingprotocol`, GitHub `https://github.com/etherpilled/infinite-trading-protocol`.

## 2. The ITP token, DAO and governance

- **ITP** is the protocol token. Initial supply: 1,000,000,000 ITP. It is a burnable ERC-20 and is DAO governed.
- **Main ITP token (Optimism):** `0x0a7B751FcDBBAA8BB988B9217ad5Fb5cfe7bf7A0`. ITP also exists on Base (`0xBA8CD87120aCA631F59231f9fD6c5469BbEE3440`); the Base deployment is deprecated for buying in the app.
- **DAO multisig (Safe):** `0xb5dB6e5a301E595B76F40319896a8dbDc277CEfB`. It owns the upgradeable vault proxies and receives DAO fees. It is also the manager of the platform's Chamber vaults.
- **Burns:** ITP is burned over time, linked to ecosystem operations (revenue-linked allocations, automated flows, DAO burn actions). Burn transactions go to `0x000000000000000000000000000000000000dEaD` or the zero address and are tracked on `/dashboard`.
- **Vesting:** some supply is locked in the multisig, vesting streams (Sablier) and staking. Circulating supply on the site is total supply minus locked balances.

### ITP staking (Staking V1, Optimism)

- Staking vault: `0x23371aEEaF8718955C93aEC726b3CAFC772B9E37`. Price oracle used by the UI: `0x395942C2049604a314d39F370Dfb8D87AAC89e16`.
- Lock ITP with a 1, 2, 3 or 4 year multiplier; longer locks earn a higher reward rate. Rewards are projected from amount and lock length.
- Withdraw when unlocked, or `earlyWithdraw` with a penalty that falls linearly to 0% at unlock (for example halfway through a lock with a 20% maximum penalty costs 10%). Penalties accumulate and can be burned or converted into rewards.
- Main methods: `deposit(amount, lockMultiplier)`, `withdraw(tokenIds[])`, `earlyWithdraw(tokenId)`, `extendLock(tokenId, lockMultiplier)`, `getStakeInfo(account)`, `getVaultInfo()`. Operator methods include `depositRewards`, `withdrawRewards`, `withdrawPenalty`, `burnPenalty`, `convertPenaltyIntoRewards`.
- The contract is audited; the audit is linked from the staking page and the GitHub repo.

## 3. Vaults (Chamber, formerly dHEDGE)

- A **vault** is a smart contract holding investor funds. Investors deposit and receive shares priced by NAV. A designated **trader** can trade only whitelisted assets in the vault and cannot withdraw investor funds. A **manager** controls settings and fees.
- Infinite Trading runs vaults on Chamber (dHEDGE v2 SDK, `@dhedge/v2-sdk`). Brand note: "Chamber" is the current name; the API accepts `protocol=chamber` and `protocol=dhedge`.
- Categories in the app: **Tradebot / AI Bot / Classical Strategies** (bots), **Yield**, **Index**, **RWA**. Auto-compounders have their own section.
- **Risk factor** (1 to 5, Very low to Very high) comes from downside volatility; it is shown only once a vault has been active for at least 4 weeks.
- App cards show TVL, **return since launch** (all-time share-price performance), APY for yield vaults and risk. Charts show a 1-year share-price history.
- Fees depend on the vault: management fee, performance fee (on realised gains) and entry/exit mechanics. Always check the specific vault.
- Price history for any vault is available from the public Chamber GraphQL API: `https://api-v2.dhedge.org/graphql`, query `tokenPriceHistory(address, period)` returning `history { adjustedTokenPrice timestamp }`.
- **Agentic managed vaults:** vaults whose strategy side is updated by Infinite Trading Cloud signals through authenticated API calls (`setBot` style control), with a gas-wallet execution model.
- **TradingVault (in development):** a permissioned, NAV-based UUPS vault on Base intended to replace Chamber for DAO bot-managed funds. Roles: owner (DAO), manager, trader (bot, can never send funds to arbitrary addresses), user. Not the production path today.

## 4. Auto-compounders

Two families, both reinvest rewards so users do not harvest manually.

### Velodrome auto-compounders (Optimism)

Flow: claim gauge rewards, convert to pool components, add liquidity, restake. ITP pairs: ITP/VELO, ITP/DHT, ITP/wstETH, ITP/OP, ITP/WBTC, ITP/USDC. Harvester incentive can include an ITP-denominated reward.

| Pair       | Auto-compounder                              | LP token                                     | Gauge                                        |
| ---------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| ITP/VELO   | `0x569D92f0c94C04C74c2f3237983281875D9e2247` | `0xC04754F8027aBBFe9EeA492C9cC78b66946a07D1` | `0x865e21A07d0915b72488860c3f3961f25e2c9347` |
| ITP/DHT    | `0xFCEa66a3333a4A3d911ce86cEf8Bdbb8bC16aCA6` | `0x3d5cbc66c366a51975918a132b1809c34d5c6fa2` | `0x4d8C7763758211f875d91e004b8aB9A2A6ee3E01` |
| ITP/wstETH | `0x2811a577cf57A2Aa34e94B0Eb56157066717563f` | `0xdAD7B4C48b5B0BE1159c674226BE19038814eBf6` | `0x6f3E796C2AD9C5B3CB280d245C45cd034102058b` |
| ITP/OP     | `0x8A2e22BdA1fF16bdEf27b6072e087452fa874b69` | `0x79F1af622FE2C636a2d946F03A62D1DfC8cA6de4` | `0x70b092c2Caa9f11172fffB2C0A344CCb89759913` |
| ITP/WBTC   | `0x3092F8dE262F363398F15DDE5E609a752938Cc11` | `0x93e40C357C4Dc57b5d2B9198a94Da2bD1C2e89cA` | `0xB210B102BFB75D2516045858bFBd58e796fA16b0` |
| ITP/USDC   | `0xC4628802a42F83E5bce3caB05A4ac2F6E485F276` | `0xB84C932059A49e82C2c1bb96E29D59Ec921998Be` | `0x571E95563A6798C76144c8C5ed293406Ed81A437` |

A roadmap item covers migrating relayer, compounders and LPs from Velodrome to Aerodrome (AERO).

### Uniswap V3 auto-compounders (Base)

ERC-1967 UUPS proxy vaults over `UniV3AutoCompounder` implementations. Users deposit dual-token or via a **zap** (single token). Shares represent proportional ownership of the LP position.

| Vault       | Proxy                                        | Uniswap V3 pool (1% fee tier)                |
| ----------- | -------------------------------------------- | -------------------------------------------- |
| ITP/USDC    | `0xf0e3305e81744e4dfa2d01c0a145814357a89018` | `0x16A1E7F62b702d84AAa0D1f534121DE9d17B0E18` |
| ITP/AERO    | `0xd75d5d3ef0880ff25fd66d4fdf5b461ffb97674d` | `0x3819e346E6347d75ceF0CfFd3FF41489f543a9Cc` |
| ITP/cbEGGS  | `0xa1bca9f6d9618348e7c33284082e2959a3449aa8` | `0x750813fbFBD24310A31e9dcaE3b143C75F241344` |
| ITP/cbXRP   | `0x2fe57c7a0978d5ba39461572b87db41131b43646` | `0x33840Ce3817ef3F79DA49EC70e4653c4aE20eE3F` |
| WETH/cbEGGS | `0xd248b1e882c4444674d83ef912713113b719f7ce` | `0x95CB82D517A1Ce4e6ac4312BCf718cD0EE9f3884` |

- Fees (basis points, mirrored from the contract): zap fee **30 bps (0.3%)** to the DAO; of compounded fees **150 bps (1.5%)** to the DAO and **50 bps (0.5%)** to the executor.
- Implementations are upgradeable by the DAO Safe. Latest implementation `0x1c0D7650E200199395b1b5AB109f7914D13D724d`. A Uniswap V4 compounder is in progress and not yet deployed.
- Base token addresses: WETH `0x4200000000000000000000000000000000000006`, AERO `0x940181a94A35A4569E4529A3CDfB74e38FD98631`, cbEGGS `0xdDbAbe113c376f51E5817242871879353098c296`, cbXRP `0xcb585250f852C6c6bf90434AB21A00f02833a4af`, USDC `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`. Uniswap V3 position manager (Base) `0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1`.

## 5. Liquidity pools and Boosted LP

- ITP trades against VELO, DHT, wstETH, OP, WBTC and USDC on **Velodrome V2** (Optimism), and on **Uniswap V3** on Base. Gauges pay VELO emissions; the app converts rewards to ITP.
- **Boosted LP staking** (`/boosted-lp`): stake Velodrome ITP LP tokens in the booster contract `0x18054b261ca335f7ae65264d39f78538ea05451a` (version with TWAP protection, cooldown and emergency mode) to earn ITP at a higher rate than standard staking. VELO rewards are converted to ITP at a higher rate, and the protocol locks VELO in the relayer to boost yields further.
- Liquidity can also be provided from a vault through the API (`/addLiquidity`, `/removeLiquidity`, Uniswap V3).

## 6. stSATO (Ethereum)

- **stSATO** is a bonding-curve liquid-staking ERC-20 backed by **SATO** (`0x829f4B62EEBE12Af653b4dD4fFc480966F7d7f09`). Contract: `0xdeE7f7A032326148E65EC3068F1c9b29E26B75b3`. Launched 2026-05-22. Site: `https://stsato.org`.
- Price: `price = getBacking() / totalSupply()` (1e18 = 1.0 SATO per stSATO), set to 1 SATO at start. Buying and selling charge fees that accumulate in the backing, so the price only rises (a monotonic price invariant is enforced on-chain).
- Buy SATO to receive stSATO at the current price; sell stSATO to receive SATO minus a fee.
- **Loans:** borrow SATO against stSATO collateral, up to 99% LTV, for a chosen number of days (day-bucket liquidation). Functions include `borrow`, `borrowMore`, `repay`, `extendLoan`, `removeCollateral`, `closePosition`, `flashClosePosition`, `leverage`, `liquidate`.
- It is a fork of the EGGS Finance contract adapted for SATO: bootstrap stSATO is minted to `0xdead` (no deployer allocation), fee burn is a transfer to `0x…dEaD`, and **ownership is renounced** in `setStart()`. No admin keys and not upgradeable.
- Yield shown in the app: total yield is the exchange rate minus 1 since launch; APY annualises rate growth.

## 7. cbEGGS (Base)

- **cbEGGS** is the Base version of the EGGS bonding-curve design, backed by ETH and priced in ETH (initial price 0.001 ETH). Contract: `0xdDbAbe113c376f51E5817242871879353098c296`. Launched 2025-02-22. Site: `https://cbeggs.finance`.
- Same mechanics family as stSATO: fees accrue to backing, price rises monotonically, borrowing against the token with day-bucket liquidation.
- cbEGGS is also paired in Uniswap V3 compounders (ITP/cbEGGS, WETH/cbEGGS).

## 8. Loans page and lending integrations

- `/loans` reads Aave V3, Compound III and Fluid positions across Ethereum, Base, Optimism, Arbitrum and Polygon, shows health factor per position and lets users supply, withdraw, borrow and repay from their own wallet.
- Health factor is collateral weighted by liquidation threshold divided by debt. Below 1.00 a position can be liquidated.
- Vaults can use Aave, Compound V3 and Fluid through the API (`/aaveV3/*`, `/compoundV3/*`, `/fluid/*`).

## 9. Other products

- **Trade** (`/trade`): swap and bridge through Li.Fi, tokenized stocks and ETFs on Robinhood Chain and Base, tokenized gold, silver and Treasuries.
- **Perpetuals:** `https://perps.infinitetrading.io`, built on Orderly, the derivatives layer of the stack.
- **Market scanner** (`/market-scanner`): trends, momentum and mean-reversion signals, watchlists, notifications.
- **Bonds** (`/bonds`): preview of a fixed-price ITP bond with placeholder figures; not live.
- **Roadmap** (`/roadmap`): categorized, filterable roadmap since 2023.

## 10. The Infinite Trading API

### 10.1 What it does

A REST API that gives your code the **trader** role on Chamber vaults. You send a short HTTP request and the API builds, routes, signs and submits the on-chain transactions: approvals, slippage, DEX selection through a per-network fallback chain, RPC failover and gas. It also exposes bots, index rebalancing, lending, liquidity, fee collection, CEX sub-accounts and market data. It never takes custody of investor funds.

- Base URL: `https://api.infinitetrading.io`
- Swagger UI: `https://api.infinitetrading.io/__docs__/`. OpenAPI JSON: `https://api.infinitetrading.io/openapi.json` (43 documented paths).
- Most endpoints accept GET and POST. Parameters can be sent in the query string or JSON body; they are merged.
- `network`: `base`, `optimism`, `arbitrum`, `polygon`, `ethereum` (alias `mainnet`), `hyperliquid`.
- `protocol`: `dhedge` (default); `chamber` is accepted as an alias.
- `pool`: vault address (`0x` plus 40 hex characters).
- `platform`: execution venue, default `auto`. Retired values such as `odos` are accepted and silently routed to `auto`.
- `asset`: symbol (`USDC`) or contract address.
- `share`: 0 to 100 percent of available balance; it takes precedence over `amount`.

### 10.2 Core concepts

1. **Vault (pool):** the Chamber vault you operate.
2. **Gas wallet:** a dedicated hot wallet that pays gas and is set as the vault's **trader**. It holds only gas, never investor funds.
3. **API key:** a UUID tied to one gas wallet. It authenticates requests, selects the signer and is what usage is billed against.
4. **Platform:** DEX or market to use; `auto` walks a fallback chain.
5. **Bots:** `setBot` stores a threshold strategy the platform runs for you; index bots keep a basket at target weights.

### 10.3 Gas wallets: create a new one or import an existing one

There are two ways to get a gas wallet and its API key. In both cases the wallet must then be funded with native gas and set as the vault's trader.

**Option A: create a brand-new gas wallet (one call).** `GET /createGasWallet` generates a fresh keypair and issues its API key in one step. It needs no authentication. It is not listed in Swagger. The response uses one-element arrays:

```json
{
  "status": ["success"],
  "status_code": [200],
  "address": ["0x…"],
  "private_key": ["<64 hex characters, no 0x prefix>"],
  "apiKey": ["<uuid>"]
}
```

The private key is returned **once** and the API does not log it: back it up securely immediately. The Managers console (`/managers`) wraps this as "Create New Gas Wallet".

**Option B: import an existing gas wallet (hot wallet).** `POST /getNewApiKey` with body `{"privateKey": "0x…"}` issues the API key for a wallet you already control.

- One API key per wallet. Calling it again **replaces** the key: vaults linked to the wallet move to the new key and the previous key is **revoked immediately**, so any script, bot or integration still using the old key stops working.
- Send the private key only over HTTPS from a trusted server, never from a browser, and only for a dedicated gas wallet.
- You can also import with an existing API key in the Managers console ("API Key" tab).

**Then, for either option:**

1. Fund the wallet with a small amount of native gas token (ETH, POL, etc.) on each network you will trade on. Check with `GET /getGasBalance`.
2. Make the wallet the vault's trader (set the trader on the Chamber vault from the vault manager account; the Managers console has a "Set trader" flow). Verify with `GET /isPoolTrader`.
3. Never put meaningful funds in the gas wallet.

### 10.4 Authentication

- **Per-user API key** (`apiKey` parameter): almost every endpoint.
- **Shared frontend key:** a read-only token used by the Infinite Trading frontend for a few data endpoints. Not for third-party use.
- Some endpoints also require the caller to be the vault's trader. Permissionless on-chain operations (for example fee minting) are not gated.

### 10.5 Responses, errors and limits

- **Validation failures return HTTP 200** with every field as a one-element array. Always check `status`.

```json
{
  "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 failures return HTTP 400 with a flat object containing `status`, `status_code` and `error_type`.
- Rate limits: the gateway allows about 30 requests per minute with a burst of 20; beyond that you receive an HTML **503**, which is throttling, not an outage. The API also limits requests per minute per client. Back off and retry.
- Pricing: reads are free; execution actions (trade, approve, lend, borrow, repay) carry a small per-action USD fee tied to the API key. Check current pricing before high-volume use.

### 10.6 Endpoint catalog

`*` = required parameter. Effect: R read-only, C changes configuration, F moves funds.

**Wallet and keys**
| Endpoint | Purpose | Effect |
|---|---|---|
| `GET /createGasWallet` | Create a new gas wallet and API key (hidden from Swagger) | C |
| `POST /getNewApiKey` (`privateKey`) | Import a gas wallet: issue or replace its API key | C |
| `GET /getGasBalance` (`network*`, `apiKey*`, `USD`) | Native gas balance of the wallet behind a key | R |

**Vault trading**
| Endpoint | Purpose | Effect |
|---|---|---|
| `GET /vaultTrade` (`apiKey*`, `pool*`, `from*`, `to*`, `network`, `platform`, `slippage`, `share`, `amount`) | Swap one vault asset for another with DEX fallbacks. Live on-chain | F |
| `POST /approve` (`apiKey*`, `network*`, `pool*`, `asset*`, `platform`) | Approve an asset for a DEX or lending market | F |
| `POST /setBot` (`apiKey*`, `pool*`, `network*`, `pair*`, `side*`, `threshold`, `max_usd`, `slippage`, `share`, `platform`, `lending`) | Set a bot strategy and trigger a rebalance | F |
| `DELETE /deleteBot` (`apiKey*`, `network*`, `pool*`) | Remove a bot (turns it off) | C |
| `POST /mintManagerFee` (`apiKey*`, `network*`, `pool*`) | Realise accrued performance and management fees | F |

**Bot status**
| Endpoint | Purpose | Effect |
|---|---|---|
| `GET /isPoolTrader` (`apiKey*`, `network*`, `pool*`, `trader*`) | Is this address the vault's trader? | R |
| `GET /getBotStatus` (`apiKey*`, `network*`, `pool*`) | Bot and index configuration of a vault | R |

**Index and allocations**
| Endpoint | Purpose | Effect |
|---|---|---|
| `POST /setIndexBot` (JSON) | Configure a scheduled index bot: interval, USD cap per run, 2 to 20 targets summing to 100. Disabled by default | C |
| `GET /getIndexBot` | Read the index bot | R |
| `GET /getCurrentAllocations` (`apiKey*`, `network*`, `pool*`) | Targets vs live weights and drift | R |
| `GET /previewIndexBot` | Preview drift and a bounded sell-before-buy plan, no trades | R |
| `POST /rebalancePool` (`apiKey*`, `network*`, `pool*`, `execute`, `force`, `quote`) | Rebalance to targets. Dry-run by default; `execute=true` runs trades | F |
| `POST /disableIndexBot` | Stop scheduled checks, keep configuration | C |
| `POST /setAllocations` | Retired; validates syntax and never writes. Use `setIndexBot` | R |

**Lending**: all writes take `apiKey*`, `network*`, `pool*`, `asset*`, `share` or `amount`.
| Endpoint | Purpose | Effect |
|---|---|---|
| `POST /aaveV3/lend`, `/aaveV3/unlend`, `/aaveV3/borrow`, `/aaveV3/repay` | Aave v3 supply, withdraw, borrow, repay | F |
| `GET /aaveV3/getSupplied`, `/aaveV3/getBorrowed`, `/aaveV3/getHealthFactor`, `/aaveV3/getPoolData` | Aave v3 position reads | R |
| `POST /compoundV3/lend`, `/compoundV3/unlend` | Compound V3 (Comet) supply and withdraw | F |
| `POST /fluid/lend`, `/fluid/unlend` | Fluid fToken supply and withdraw | F |

**Liquidity (Uniswap V3)**
| Endpoint | Purpose | Effect |
|---|---|---|
| `POST /addLiquidity` (`apiKey*`, `pool*`, `network*`, `asset1*`, `asset2*`, `input_asset*`, `platform`, `fee_tier`, `lower_price`, `upper_price`, `share`, `amount`, `slippage`) | Add liquidity, optionally concentrated | F |
| `POST /removeLiquidity` (`apiKey*`, `pool*`, `network*`, `asset1*`, `asset2*`, `token_id*`, `platform`, `amount`, `output_asset`, `slippage`) | Remove liquidity by NFT id; default full exit | F |

**Pools, market data and tokens (read-only)**
| Endpoint | Purpose |
|---|---|
| `GET /poolComposition` (`apiKey*`, `pool*`, `network*`) | Vault holdings, symbol-resolved and decimal-adjusted |
| `GET /getCandles` (`apiKey*`, `exchange`, `timeframe`, `pair`, `bars_back`) | OHLCV candles |
| `GET /getTicks` (`apiKey*`, `exchange`, `pair`) | Latest tick price |
| `GET /getSymbol` (`apiKey*`, `contract*`, `network*`) | Symbol from address |
| `GET /getContract` (`apiKey*`, `symbol*`, `network*`) | Address from symbol |

**Fee operations**
| Endpoint | Purpose | Effect |
|---|---|---|
| `GET /mintManagerFeeBatch` (`apiKey*`, `pools*`, `network*`, `protocol`, `dryRun`, `allowFailure`) | Mint fees for many vaults in one Multicall3 transaction | F |
| `GET /mintAllFeesByManager` (`apiKey*`, `manager*`, `network`, `protocol`, `dryRun`, `allowFailure`) | Discover a manager's vaults and mint all non-zero fees in one transaction; reports `scanned` and `matched` | F |

**Centralized exchanges**
| Endpoint | Purpose | Effect |
|---|---|---|
| `POST /registerCEXSubaccount` | Connect an exchange sub-account to a gas wallet (credentials stored encrypted) | C |
| `POST /setCEXSide` (`gas_wallet_api_key*`, `subaccount_name*`, `pair*`, `side*`, `max_usd*`, `share*`, `strategy`) | Set a CEX bot side and parameters | F |
| `GET /getCEXSide` | Read CEX bot configuration | R |
| `POST /deactivateCEXBot`, `DELETE /deleteCEXBot`, `DELETE /deleteCEXSubaccount` | Pause or delete CEX bots and sub-accounts | C |

### 10.7 Quickstart (curl)

```bash
BASE=https://api.infinitetrading.io

# 1. Create a gas wallet and API key (save private_key now; it is shown once)
curl "$BASE/createGasWallet"
#    or import an existing hot wallet:
curl -X POST "$BASE/getNewApiKey" -H "Content-Type: application/json" -d '{"privateKey":"0x…"}'

# 2. Fund the wallet with native gas, set it as the vault trader, then verify
curl "$BASE/isPoolTrader?apiKey=KEY&network=base&pool=0xVAULT&trader=0xGASWALLET"

# 3. Read before you write (sends no transaction)
curl "$BASE/poolComposition?apiKey=KEY&network=base&pool=0xVAULT"

# 4. Approve once per asset, then trade a share of the balance
curl -X POST "$BASE/approve?apiKey=KEY&network=base&pool=0xVAULT&asset=USDC"
curl "$BASE/vaultTrade?apiKey=KEY&network=base&pool=0xVAULT&from=USDC&to=WETH&share=25"
```

TypeScript helper that handles the legacy array wire format:

```ts
const BASE = "https://api.infinitetrading.io";
const one = (v: unknown) => (Array.isArray(v) ? v[0] : v);

export async function call(path: string, params: Record<string, string>) {
  const res = await fetch(`${BASE}${path}?${new URLSearchParams(params)}`);
  if (res.status === 503) throw new Error("Throttled: back off and retry");
  const body = await res.json();
  const status = one(body.status);
  if (status === "fail")
    throw new Error(`${one(body.status_code)}: ${one(body.message)}`);
  return body;
}
```

### 10.8 Recipes

- **Signal to trade:** `isPoolTrader` then `approve` then `vaultTrade` from a webhook (TradingView, ML model, cron).
- **Hosted bot:** `setBot` once, watch with `getBotStatus`, switch off with `deleteBot`.
- **Keep a basket balanced:** `setIndexBot`, check `previewIndexBot`, then allow `rebalancePool` with `execute=true`. Runs are capped in USD.
- **Earn on idle collateral:** `approve`, `aaveV3/lend` (or Compound or Fluid), monitor `aaveV3/getHealthFactor`, `aaveV3/unlend`.
- **Sweep fees:** `mintAllFeesByManager` with `dryRun=true`, then without it.
- **Read-only dashboard:** `poolComposition`, `getCandles`, `getTicks`, `getGasBalance`.

### 10.9 Safety rules for agents writing integration code

1. Default to read endpoints and `dryRun` or `quote` options first. `vaultTrade` has no dry-run: it executes.
2. Prefer `share` over `amount` so strategies scale with the vault.
3. Keep API keys and private keys server-side. Never commit them or ship them to a browser.
4. Use a dedicated gas wallet with only gas in it.
5. Check the response body for `status` (HTTP 200 can still be a failure). Retry 503 with backoff. Make writes idempotent on your side.
6. Rotating a key (`getNewApiKey`) revokes the old one immediately. Coordinate before doing it in production.
7. Respect rate limits; do not loop on failures.

## 11. Frontend routes (for linking users)

`/app` vaults and tiles, `/vault/<address>` vault page, `/auto-compounder`, `/boosted-lp`, `/staking`, `/token`, `/yield`, `/loans`, `/holdings/my-wallet` (My Deposits), `/trade`, `/market-scanner`, `/managers`, `/robinhood`, `/dashboard`, `/roadmap`, `/docs`, `/api`, `/api-docs`.

## 12. Glossary

- **Chamber / dHEDGE:** the on-chain asset-management protocol that Infinite Trading vaults are built on.
- **Trader / manager:** vault roles. Trader executes trades; manager sets configuration and fees.
- **Gas wallet:** hot wallet that pays gas and acts as trader.
- **NAV:** net asset value per vault share.
- **Zap:** single-token deposit that is split into an LP position.
- **LTV:** loan-to-value; stSATO allows up to 99%.
- **Health factor:** collateral weighted by liquidation threshold divided by debt.
- **Multicall3:** contract at `0xcA11bde05977b3631167028862bE2a173976CA11` used to batch calls.

## 13. When you are unsure

Say what you know, point to the live Swagger or the contract on a block explorer, and ask the user to confirm before any action that moves funds.
