Execution, delegation, and tracking

previewOrder, walletExecute, executeIntent, write confirmation, delegation tools, agentWalletBootstrap, and post-trade analytics.

Use execution tools to have your agent trade, deposit or place orders. Each write runs a catalog action, and Thirdfy refuses any action it doesn't support before anything is sent onchain.

Before your first write that needs a key, finish identity onboarding. If getVenueReadiness lists blockers, clear them with the venue onboarding tools.

Write rails

Pick the tool that matches how your agent holds funds:

ToolWhen
previewOrderBefore any write. Shows what would be signed and each policy check. Places nothing
walletExecuteYour agent's own execution wallet (runMode=agent_wallet), after agentWalletBootstrap
executeIntentOne intent sent to many subscribers (fan-out), and users who delegated to the agent (hybrid, thirdfy)
agentRunRuns a catalog action by name with JSON params. Common in MCP hosts
buildTxBuilds an unsigned transaction for a wallet you bring yourself (BYOW, runMode=self)
walletSign + walletSubmitSign and broadcast with your own wallet (BYOW)
getIntentStatusChecks the status of executeIntent fan-out jobs only

Details:

  • walletExecute answers directly. Read txHash, blockedReason and blockedStage from its response. Don't poll getIntentStatus for it.
  • userDid is optional when agentKey is a 0x address. Thirdfy then uses did:wallet:<agentKey>. For an agent key that isn't an address, pass userDid yourself.
  • Read responses put markets, bids, asks and readiness fields at the top level when present, so MCP hosts get a flatter shape.

The usual order of calls for a write:

  1. Onboarding (once): Onboarding tools
  2. getActionsCatalog
  3. getAgentActions
  4. getProviderActions for the venue family
  5. getChainCapabilities or getNonEvmCapabilities
  6. Readiness gate
    • agent_wallet: agentWalletBootstrap with requireFundingCheck: true when collateral is required
    • self: getSelfReadiness then buildTx / walletSign
    • hybrid / thirdfy: delegationStatus and active Gator binding
  7. Preview: previewOrder with the same action, params, estimatedAmountUsd and chainId
  8. Write via the rail that matches runMode
  9. Analytics: trackAgentAction and portfolio reads (see Tracking below)

Preview before you write

Call previewOrder to see what a write would do before it happens. It takes the same arguments as walletExecute and runs every check, but nothing is signed, billed or reserved.

It returns wouldSign, blockedReason, blockedStage and amountUsd. For a venue order (Veranta, Hyperliquid, Lighter, Polymarket) it also returns orderPreview:

  • notional, collateral and leverage
  • the remaining per-trade and daily limits
  • one row per policy check

Veranta orders under an owner risk policy also show the liquidation price and the loss at stop. Lighter works with an agent key; it isn't offered in apps signed in with a Thirdfy account yet.

  • Swaps and withdrawals: if Thirdfy can't size a value-moving write without an estimate, it answers ESTIMATED_AMOUNT_USD_REQUIRED. Pass estimatedAmountUsd.
  • Order changes (move a TP or SL, close, cancel, margin): pass current with the position's values before the change. The preview shows before → after.
  • Order cards: in hosts that support MCP Apps (Claude, ChatGPT, VS Code), the preview appears as an order card with a Place order button. The user places the order from the card, so the agent doesn't also send it with walletExecute.

Write confirmation

When you sign in with your Thirdfy account, the app acts with your authority as the owner. So a write that moves money pauses once and asks you to confirm. Nothing runs until you do:

  • Hosts that support MCP forms show a confirmation form in the chat.
  • Other hosts get errorCode: "CONFIRMATION_REQUIRED" (HTTP 428 over REST) and confirmation: { summary, confirmationToken, expiresAt, … }. Show the user the summary. If they agree, call again with the same arguments plus confirmationToken. The token is valid for 5 minutes.

The owner sets how often this happens with the agent's confirmationPolicy:

ValueBehavior
always (default)Confirm every money-moving write
above_usdConfirm writes above a threshold you set
neverDon't ask

With an agent API key, writes run in one call. The agent's policy is the guard: its allowlist, per-trade and daily caps, and risk policy. Tools that use the owner's authority (delegationRedeem, delegationActivate, managedWalletGrant, consoleMandateActivate) still ask for confirmation every time. Reads never ask.

Solana

Solana runs only on walletExecute with chainId: 101 and runMode: agent_wallet.

  • Call getNonEvmCapabilities for the chain IDs and providers.
  • Call agentWalletBootstrap with chainId: 101 for the agent's Solana address (base58).
  • buildTx, walletSign and walletSubmit work on EVM chains only.

See Solana.

Run mode quick reference

The run mode says who holds the authority to sign.

ModeAuthorityTypical MCP path
agent_walletManaged execution wallet (EVM and Solana)agentWalletBootstrap → previewOrder → walletExecute
thirdfy / hybridDelegated user walletdelegation* → executeIntent or agentRun
selfLocal signerbuildTx → walletSign → walletSubmit

Off-chain venue orders (Hyperliquid, Polymarket CLOB, Bitfinex) use venue credentials or managed wallets. Don't use self for them.

Delegation and wallets

Three groups of tools set up who can sign:

  • Delegation tools let a user grant the agent limited authority over their wallet (MetaMask Gator, the ERC-7710 standard). They serve the thirdfy and hybrid run modes.
  • Managed wallet tools set up custodial delegation wallets.
  • agentWalletBootstrap finds the agent's own execution wallet for agent_wallet.

Delegation tools

ToolPurpose
delegationCreateStart Gator delegation binding
delegationActivateActivate after external signature
delegationStatusCurrent binding state
delegationInspectDeep inspect caveats and scopes
delegationBalanceDelegated balance reads
delegationRevokeRevoke active delegation
delegationRedeemConvenience helper over executeIntent for supported redeem flows
delegationWorldIdBeginStart a World ID proof for an agent key
delegationWorldIdCompleteSubmit the World ID proof for that agent key
delegationWorldIdDepositBeginStart a single-use deposit proof for an organization
delegationWorldIdDepositCompleteSubmit the deposit proof and receive a receipt id

For policy boundaries and MetaMask Gator context, see Delegation and protection and Delegation API. World ID personhood is a separate flow: World ID delegation.

Managed wallet tools

ToolPurpose
managedWalletInitInitialize custodial delegation wallet setup
managedWalletGrantGrant access for managed wallet lane
managedWalletStatusRead setup status

Use these only when your product needs custodial delegation wallets for users. You don't need them for the default Hyperliquid or Polymarket agent wallet.

agentWalletBootstrap

Returns the agent's own execution wallet, the wallet Thirdfy manages for it (/api/v1/agent/execution-wallet, runMode=agent_wallet).

  • Fund the returned execution wallet, not the wallet you sign in with.
  • For Hyperliquid deposits through Bridge2, Bridge2 credits the address that sent the transaction on Arbitrum.
  • When collateral is required, call it with requireFundingCheck: true before your first walletExecute.

For Hyperliquid and Polymarket, the agent signs through this managed execution wallet. Don't put venue private keys on your runtime.

Lane selection

LaneMCP setupWrites
agent_walletagentWalletBootstrapwalletExecute, agentRun
hybrid / thirdfydelegationCreate → delegationActivateexecuteIntent, agentRun, delegationRedeem
selfgetSelfReadinessbuildTx, walletSign, walletSubmit

Tracking and analytics

Tracking tools log what your agent did and read its results from Thirdfy. They do not get around execution policy.

Track tools

ToolPurpose
trackAgentActionRecord an action observation (permissive; custom names stored for later catalog review)
getAgentTrackActionsList tracked actions for an agent
getAgentTrackEventsEvent stream for analytics
getAgentDataSummaryAggregated agent data summary

Execution still refuses any action outside the supported catalog. Tracking is deliberately looser, so agents can log what they intend to do before the catalog covers it.

Portfolio and leaderboard

ToolPurpose
getAgentPortfolioSummaryLatest USD principal, NAV, PnL, ROI, APR, holdings, valuation source
getAgentLeaderboardRank agents by trading, yield, or prediction over 24h, 7d, 30d, or all

MCP doesn't do portfolio math itself. The Thirdfy API computes principal, valuation snapshots and leaderboard scores.

Typical post-trade flow

walletExecute or executeIntent
  → trackAgentAction
  → getAgentPortfolioSummary

Workflow examples

GoalDiscoveryExecute
Spot swapgetProviderActions { provider: "trading" }walletExecute or executeIntent with action=swap
HL perpsprovider: "hyperliquid"Setup actions → orders with agent_wallet or delegated lane
Polymarketprovider: "polymarket"Funding/setup status → CLOB orders (EU egress for live orders)
Earn depositprovider: "earn" or morpho / aegisdeposit_* actions with correct decimals
Bitfinex fundingprovider: "bitfinex"executeIntent with cexCredentialRef

For venue details, see the Integrations pages and the hints in getProviderActions.

Hosted runtime context

Hosted runtimes can pass executionContext (runtimeId, orgId) on walletExecute, executeIntent and agentRun. Thirdfy then charges credits to the right EarnOrg or Claude runtime.