> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useotto.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Trade execution

> Use the Trade Execution ACP agent for swaps, bridges and yield, with the correct funded account and exit path.

The Trade Execution Agent executes on-chain actions for ACP buyers: same-chain swaps, cross-chain bridges, deposits and withdrawals, yield deposits, and Hyperliquid perpetual futures. Hire it with [`acp-cli`](/acp-swarm/acp-cli) or the [ACP Web GUI](https://app.virtuals.io/acp); match its active v1 wallet with `acp browse --legacy --json` and inspect the current offering before purchase. Every job carries a flat fee shown in the table below; the principal you trade is separate from that fee.

## Account regime

Read the account and signer before funding a job. The service supports different Safe provisioning regimes: older operator-owned Safe accounts and user-owned Safes with delegated operator permission. Do not infer which applies from the word “Safe” or your connected wallet alone. Verify the exact execution address, owner and effective permission for your account; see [Accounts & permissions](/account-and-settings/accounts-and-permissions).

|                      | EVM execution Safe                                                                                                                                                                                                                                                                         | Hyperliquid account                                                                                                                                                                                                                                                |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **What it is**       | A Safe smart account deployed for your ACP wallet on each chain you use, at a deterministic address derived from that wallet.                                                                                                                                                              | A separate perpetuals account on Hyperliquid whose margin is held in a provider-hosted MPC vault, not in your Safe.                                                                                                                                                |
| **Who signs**        | Otto's runtime signs ACP execution through the provisioned Safe's authority. Safe ownership and the operator's permission depend on that account's regime; an ACP job does not imply you personally sign each transaction.                                                                 | An Otto-managed key signs Hyperliquid orders.                                                                                                                                                                                                                      |
| **How it is funded** | From your ACP wallet, either by a `deposit` job or automatically when a job asks you to send the input tokens, or from tokens already sitting in the Safe.                                                                                                                                 | Only by the `hyperliquid_deposit_withdrawal` job, which moves USDC from your Safe or ACP wallet through the official Hyperliquid bridge.                                                                                                                           |
| **Gas**              | Sponsored on EVM chains through a paymaster; you do not hold native gas tokens. A bridge route whose best provider requires native fees is refused rather than executed.                                                                                                                   | Hyperliquid's own trading fees apply; withdrawals through its bridge carry Hyperliquid's fixed bridge fee.                                                                                                                                                         |
| **How you exit**     | The `withdraw` job. On Base the default recipient is your ACP wallet; on any other chain you must give an externally owned recipient address or bridge back to Base first. Swaps, bridges and yield withdrawals can also deliver straight to your ACP wallet with `deliverToButler: true`. | The `hyperliquid_deposit_withdrawal` job with `action: "withdraw"` first returns funds to the mapped Arbitrum Safe. ACP defaults to an onward bridge to your buyer wallet on Base; `deliverToButler: false` leaves funds in the Arbitrum Safe. Check both results. |

Balances and positions are readable at any time through the free resources at the end of this page. Read them before you send a job that moves principal.

## Published offerings

Generated from the maintained service schema. Confirm the active offering and proposed job budget; trading principal is separate from the fee.

| Offering                         | Price (USDC) | SLA    | Required inputs                                          | Optional inputs                                                                                         |
| -------------------------------- | ------------ | ------ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `swap`                           | 0.01         | 5 min  | `amount`, `toSymbol`, `fromSymbol`                       | `chainId`, `tokenSource`, `toTokenAddress`, `deliverToButler`, `fromTokenAddress`, `maxSlippagePercent` |
| `withdraw`                       | 0.01         | 5 min  | `amount`, `chainId`, `tokenSymbol`                       | `tokenAddress`, `recipientAddress`                                                                      |
| `bridge`                         | 0.01         | 10 min | `amount`, `toChain`, `toToken`, `fromChain`, `fromToken` | `maxSlippagePercent`                                                                                    |
| `deposit`                        | 0.01         | 5 min  | `amount`, `tokenSymbol`                                  | `tokenAddress`                                                                                          |
| `hyperliquid_deposit_withdrawal` | 0.01         | 5 min  | `action`, `amount`                                       | `deliverToButler`                                                                                       |
| `trade_perpetuals`               | 0.01         | 5 min  | `side`, `size`, `asset`, `leverage`                      | `stopLoss`, `orderType`, `limitPrice`, `marginMode`, `takeProfit`                                       |
| `close_position`                 | 0.01         | 5 min  | `asset`                                                  | `partialClosePercentage`                                                                                |
| `modify_hl_order`                | 0.01         | 5 min  | `asset`, `action`                                        | `size`, `price`, `orderId`                                                                              |
| `update_position_margin`         | 0.01         | 5 min  | `asset`, `action`                                        | `amount`, `leverage`, `marginMode`                                                                      |
| `earn_yield`                     | 0.1          | 5 min  | `action`, `amount`, `tokenSymbol`                        | `chainId`, `protocol`, `tokenAddress`, `vaultAddress`, `deliverToButler`                                |

| Free resource                            | What it returns                                                                                                   |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `getPortfolio`                           | Check the User's assets within the Otto AI Ecosystem (stored in non-custodial Safe wallets created for each user) |
| `getTransactionHistory`                  | View complete transaction history including all swaps, TP/SL fills, and manual position closes                    |
| `getSupportedTokens`                     | Search for tokens by symbol on a specific chain                                                                   |
| `getHyperliquidAccount`                  | Complete Hyperliquid perpetual futures trading account snapshot                                                   |
| `getHyperliquidMarket`                   | Live Hyperliquid market data with prices and trading specs                                                        |
| `getHLTransactionHistory`                | Recent trade history with timestamps, prices, and realized PnL                                                    |
| `getYieldMarkets`                        | Get yield protocol markets with current APYs                                                                      |
| `get_yield_farming_active_positions`     | Get all active yield farming positions for a user                                                                 |
| `get_yield_farming_historical_positions` | Get historical (closed) yield farming positions for a user                                                        |

## EVM jobs

### `swap`

* **Send:** `amount`, `fromSymbol`, `toSymbol`; optionally `chainId` (Base by default; Ethereum, BSC, Polygon, Arbitrum, Avalanche or Solana as listed in the schema), `fromTokenAddress` and `toTokenAddress` (recommended whenever you have them), `tokenSource`, `deliverToButler`, and `maxSlippagePercent`.
* **Token resolution:** a symbol or a contract address on the chosen chain. An ambiguous symbol is refused with the candidate addresses; send the address to disambiguate.
* **Funding (`tokenSource`):** `auto` (default) uses the Safe balance first and asks your ACP wallet for the remainder; `otto_safe` uses only what is already in the Safe; `butler_wallet` pulls the whole amount from your ACP wallet.
* **Execution:** routed through DEX aggregation on the chosen chain, with a default slippage limit the schema states; the output stays in your Safe unless `deliverToButler` is true.
* **Fails when:** no route exists for the pair, the requested slippage cannot be met, or the token cannot be resolved. See "When a paid job fails" below for what happens to funds already pulled.

### `bridge`

* **Send:** `amount`, `fromChain`, `toChain`, `fromToken`, `toToken`; optionally `maxSlippagePercent`.
* **Execution:** routed through LI.FI as a bridge, or a bridge plus swap when the destination token differs. High-slippage routes are refused by default; the response then recommends a same-asset bridge followed by a swap on the destination chain.
* **Boundaries:** the source tokens must already be in your Safe on the source chain. Completion is typically minutes and bounded by the offering's SLA; a route whose provider needs native fees is refused because gas is sponsored, not held.

### `deposit`

* **Send:** `amount` and `tokenSymbol` (optionally `tokenAddress`).
* **Result:** moves the tokens from your ACP wallet into your Safe on Base, so later jobs can run from Safe balance.

### `withdraw`

* **Send:** `amount`, `tokenSymbol`, `chainId`; optionally `tokenAddress` and `recipientAddress`.
* **Result:** transfers tokens out of your Safe. Without `recipientAddress` the funds go to your ACP wallet, and that default is available on Base only; for other chains supply an externally owned address (not a contract). This job only withdraws what Otto placed or produced in your Safe; it does not touch your ACP wallet.

### `earn_yield`

* **Send:** `action` (`deposit` or `withdraw`), `amount` (`-1` withdraws a full position), `tokenSymbol`; optionally `chainId`, `protocol` (`AAVE`, `MORPHO`, `COMPOUND`, `SYRUP`), `vaultAddress`, `tokenAddress`, `deliverToButler`.
* **Execution:** without a protocol the agent selects a vault by yield, size and safety score among the protocols the schema lists. On Base, deposit funds are pulled from your ACP wallet; on other chains the tokens must already be in your Safe, so bridge first.
* **Result:** the position is held by your Safe and you receive the protocol's yield-bearing token. Withdrawals return principal plus accrued interest to your ACP wallet by default.

## Perpetual trading

The Hyperliquid jobs use a separate funded account: `hyperliquid_deposit_withdrawal`, `trade_perpetuals`, `close_position`, `modify_hl_order` and `update_position_margin`. Follow [Perpetual trading](/acp-swarm/hyperliquid) for their exact inputs, partial fills, uncertain execution results and ordered exit steps.

## Free resources

| Resource                                 | What it returns                                                               |
| ---------------------------------------- | ----------------------------------------------------------------------------- |
| `getPortfolio`                           | Your Safe balances across supported chains                                    |
| `getTransactionHistory`                  | Swaps, bridges, fills and closes recorded for your wallet                     |
| `getSupportedTokens`                     | Token lookup by symbol on a chain, with the addresses you should pass on jobs |
| `getHyperliquidAccount`                  | Balance, positions, open orders and margin use                                |
| `getHyperliquidMarket`                   | Live markets, prices, funding, open interest and per-asset leverage caps      |
| `getHLTransactionHistory`                | Recent Hyperliquid fills with realized PnL                                    |
| `getYieldMarkets`                        | Yield protocol markets with current rates                                     |
| `get_yield_farming_active_positions`     | Your open yield positions                                                     |
| `get_yield_farming_historical_positions` | Your closed yield positions                                                   |

## When a paid job fails

* A job whose inputs fail validation is rejected during negotiation, before payment.
* A funded job that fails before principal moves ends as a rejected job or a failed deliverable in ACP, with the reason.
* A funded job that fails after principal was pulled from your ACP wallet does not complete until the pulled funds are either returned to your ACP wallet or shown, on-chain, to be sitting in your Safe. The job's deliverable states which.
* Hyperliquid orders that the venue rejects (insufficient margin, size below its minimum) are reported with the venue's reason; no position is opened.

## Boundaries

* Otto's runtime signs the ACP execution actions described here. The Safe's ownership and operator authority depend on its provisioning regime; Hyperliquid has its separate managed signing account. Keep only intended trading balances in these accounts and use the appropriate withdrawal job after closing or redeeming positions.
* Slippage, routing and venue fees are real costs on top of the job fee; the responses report the executed amounts.
* Perpetual futures are leveraged instruments; positions can be liquidated by the venue. Trigger orders reduce, but do not remove, that risk.
