Skip to main content
POST
Python (SDK)

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Request to execute multiple earn actions in a single atomic transaction.

Supported Action Types

  • V2_TRANSFER_FROM_EOA: Transfer tokens from the owner's EOA to the product account using Permit2. Requires a signed Permit2 message.
  • V2_TRANSFER_TO_EOA: Transfer tokens from the product account back to the owner's EOA. No signature required (product account owns the tokens).
  • V2_TRANSFER_TO_ADDRESS: Transfer ERC20 tokens from the product account to any specified recipient address. No signature required (product account owns the tokens).
  • V2_SWAP: Swap tokens within the product account using 1inch aggregator.
  • V2_MANAGE: Deposit or withdraw from DeFi venues (Aave, Morpho, Vaults, etc.)

Using V2_TRANSFER_FROM_EOA (Deposit to Product Account)

To include a transfer from EOA in your bundle, follow these steps:

  1. One-time setup: Approve Permit2 to spend the token by calling POST /v2/gas_sponsorship/approve_transfer and executing the returned transaction.

  2. Get Permit2 signature: Call POST /v2/earn/transfer with:

    • action: "DEPOSIT"
    • gas_sponsorship: true
    • spender: omit this field (defaults to product account address for bundle use)

    This returns EIP-712 typed data. Sign it with the owner's wallet.

  3. Include in bundle: Add a V2_TRANSFER_FROM_EOA action with the signature and nonce/deadline from the typed data.

The bundle will atomically: pull tokens from EOA → execute subsequent actions.

Using V2_TRANSFER_TO_EOA (Withdraw to EOA)

To transfer tokens from the product account back to the owner's EOA, simply add a V2_TRANSFER_TO_EOA action to your bundle. No signature is required since the product account already owns the tokens.

Specify the exact token amount to transfer.

owner
string
default:0x06A9aF046187895AcFc7258450B15397CAc67400
required

The owner's wallet address that controls the Earn Account.

Example:

"0x06A9aF046187895AcFc7258450B15397CAc67400"

chain
enum<string>
default:ethereum
required

Target blockchain network where the bundled actions will execute.

Available options:
arbitrum,
base,
bsc,
ethereum,
hyperevm,
tempo
Example:

"ethereum"

actions
V2UserOperation · object[]
required

List of actions to bundle. Actions are executed in order.

Minimum array length: 1
Example:
gas_sponsorship
boolean
default:false

If true, returns EIP-712 typed data for gas sponsorship. The owner must sign this data and submit to /gas_sponsorship/prepare.

Example:

false

Response

Successful Response

actions_count
integer
required

Number of individual transactions bundled in this execution.

transaction
UnsignedTransaction · object | null

Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false.

Example:
eip_712
BatchedSafeOperationsResponse · object | null

EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true. Owner must sign and submit to /gas_sponsorship/prepare.

Example:
swap_provider
enum<string> | null

Which route priced the bundle's V2_SWAP action(s): 'market' (a DEX aggregator, slippage-bounded) or 'firm' (a zero-slippage quote that fills exactly or reverts; the only route on HyperEVM). Null when the bundle carries no swap.

Available options:
market,
firm
quote_expires_at
string<date-time> | null

Deadline of the firm swap quote inside the bundle. The transaction (or the sponsor's broadcast of the signed typed data) must be included before it or the bundle reverts on-chain; rebuild after it passes. Null unless a swap action was firm-priced.

settlement
enum<string>
default:instant

'async' when the bundle contains a MAPLE WITHDRAW: that action only requests the redemption from Maple's withdrawal queue, and the underlying asset arrives in the product account when Maple processes the queue (typically within minutes, at most 30 days). Its proceeds are not available to later actions in the same bundle. 'instant' otherwise.

Available options:
instant,
async
poll_endpoint
string | null

When settlement is 'async', the endpoint that shows the pending redemption until it settles. Null otherwise.