Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Autopilot API

This document describes the basic auth flow and Autopilot endpoints (Stable model only).

Basics

  • All protected endpoints require the x-wallet-address header with the wallet address.

  • JWT is sent in Authorization: Bearer <token>.

  • chain_id is part of the path as a number (for example, 1).

Authorization flow

Request a challenge (nonce)

GET /auth/challenge

Response

{
  "nonce": "<uuid>"
}

Wallet builds and signs a SIWE message

  • Use the response nonce in the line Nonce: <uuid>.

  • The message must contain the wallet address on the 2nd line and a valid Chain ID.

Example format

Exchange signature for a JWT

Headers

HeaderValueDescription

x-wallet-address

<0xWalletAddress>

Wallet address for the signature

Body

Response

Check JWT validity

Options:

  • Call POST /auth/check with x-wallet-address and Authorization: Bearer <jwt> headers.

  • Any protected endpoint returns 401 if the JWT is invalid or the address does not match.

Environment (tokens, limits, allowances vault)

Headers

HeaderValueDescription

x-wallet-address

<0xWalletAddress>

Wallet address for auth

Authorization

Bearer <jwt>

JWT access token

Response

Notes

  • vault is the contract address to approve allowances for.

  • known_limits are per-token merged limits from the user's existing positions (useful for UI defaults).

  • strategies lists supported strategies and their allowed tokens.

Token approvals

After fetching env, the wallet should grant infinite approvals for each strategy token to the vault address. Those approved tokens are then used when creating a new position.

Create a Stable Autopilot

Headers

HeaderValueDescription

x-wallet-address

<0xWalletAddress>

Wallet address for auth

Authorization

Bearer <jwt>

JWT access token

Body

Response

Notes

  • tokens and limits must have the same length.

  • limits.min is the minimum token amount that must remain in the wallet (reserved amount).

  • deadline is optional (unix timestamp, u64).

  • Only Stable is described here, do not use Advanced.

  • rule accepts Barter. Other options will be added soon.

  • u256 fields are sent/returned as strings (hex).

List positions

Headers

HeaderValueDescription

x-wallet-address

<0xWalletAddress>

Wallet address for auth

Authorization

Bearer <jwt>

JWT access token

Response

type defaults to active.

Position details by id

Headers

HeaderValueDescription

x-wallet-address

<0xWalletAddress>

Wallet address for auth

Authorization

Bearer <jwt>

JWT access token

Response (includes transactions)

Statuses (status): Active, Paused, Completed, Deadline, ApprovalGone, LowBalance.

Last updated