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:
| Tool | When |
|---|---|
previewOrder | Before any write. Shows what would be signed and each policy check. Places nothing |
walletExecute | Your agent's own execution wallet (runMode=agent_wallet), after agentWalletBootstrap |
executeIntent | One intent sent to many subscribers (fan-out), and users who delegated to the agent (hybrid, thirdfy) |
agentRun | Runs a catalog action by name with JSON params. Common in MCP hosts |
buildTx | Builds an unsigned transaction for a wallet you bring yourself (BYOW, runMode=self) |
walletSign + walletSubmit | Sign and broadcast with your own wallet (BYOW) |
getIntentStatus | Checks the status of executeIntent fan-out jobs only |
Details:
walletExecuteanswers directly. ReadtxHash,blockedReasonandblockedStagefrom its response. Don't pollgetIntentStatusfor it.userDidis optional whenagentKeyis a0xaddress. Thirdfy then usesdid:wallet:<agentKey>. For an agent key that isn't an address, passuserDidyourself.- Read responses put
markets,bids,asksand readiness fields at the top level when present, so MCP hosts get a flatter shape.
Recommended write sequence
The usual order of calls for a write:
- Onboarding (once): Onboarding tools
getActionsCataloggetAgentActionsgetProviderActionsfor the venue familygetChainCapabilitiesorgetNonEvmCapabilities- Readiness gate
agent_wallet:agentWalletBootstrapwithrequireFundingCheck: truewhen collateral is requiredself:getSelfReadinessthenbuildTx/walletSignhybrid/thirdfy:delegationStatusand active Gator binding
- Preview:
previewOrderwith the sameaction,params,estimatedAmountUsdandchainId - Write via the rail that matches
runMode - Analytics:
trackAgentActionand 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. PassestimatedAmountUsd. - Order changes (move a TP or SL, close, cancel, margin): pass
currentwith 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) andconfirmation: { summary, confirmationToken, expiresAt, … }. Show the user the summary. If they agree, call again with the same arguments plusconfirmationToken. The token is valid for 5 minutes.
The owner sets how often this happens with the agent's confirmationPolicy:
| Value | Behavior |
|---|---|
always (default) | Confirm every money-moving write |
above_usd | Confirm writes above a threshold you set |
never | Don'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
getNonEvmCapabilitiesfor the chain IDs and providers. - Call
agentWalletBootstrapwithchainId: 101for the agent's Solana address (base58). buildTx,walletSignandwalletSubmitwork on EVM chains only.
See Solana.
Run mode quick reference
The run mode says who holds the authority to sign.
| Mode | Authority | Typical MCP path |
|---|---|---|
agent_wallet | Managed execution wallet (EVM and Solana) | agentWalletBootstrap → previewOrder → walletExecute |
thirdfy / hybrid | Delegated user wallet | delegation* → executeIntent or agentRun |
self | Local signer | buildTx → 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
thirdfyandhybridrun modes. - Managed wallet tools set up custodial delegation wallets.
agentWalletBootstrapfinds the agent's own execution wallet foragent_wallet.
Delegation tools
| Tool | Purpose |
|---|---|
delegationCreate | Start Gator delegation binding |
delegationActivate | Activate after external signature |
delegationStatus | Current binding state |
delegationInspect | Deep inspect caveats and scopes |
delegationBalance | Delegated balance reads |
delegationRevoke | Revoke active delegation |
delegationRedeem | Convenience helper over executeIntent for supported redeem flows |
delegationWorldIdBegin | Start a World ID proof for an agent key |
delegationWorldIdComplete | Submit the World ID proof for that agent key |
delegationWorldIdDepositBegin | Start a single-use deposit proof for an organization |
delegationWorldIdDepositComplete | Submit 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
| Tool | Purpose |
|---|---|
managedWalletInit | Initialize custodial delegation wallet setup |
managedWalletGrant | Grant access for managed wallet lane |
managedWalletStatus | Read 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: truebefore your firstwalletExecute.
For Hyperliquid and Polymarket, the agent signs through this managed execution wallet. Don't put venue private keys on your runtime.
Lane selection
| Lane | MCP setup | Writes |
|---|---|---|
agent_wallet | agentWalletBootstrap | walletExecute, agentRun |
hybrid / thirdfy | delegationCreate → delegationActivate | executeIntent, agentRun, delegationRedeem |
self | getSelfReadiness | buildTx, 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
| Tool | Purpose |
|---|---|
trackAgentAction | Record an action observation (permissive; custom names stored for later catalog review) |
getAgentTrackActions | List tracked actions for an agent |
getAgentTrackEvents | Event stream for analytics |
getAgentDataSummary | Aggregated 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
| Tool | Purpose |
|---|---|
getAgentPortfolioSummary | Latest USD principal, NAV, PnL, ROI, APR, holdings, valuation source |
getAgentLeaderboard | Rank 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
Workflow examples
| Goal | Discovery | Execute |
|---|---|---|
| Spot swap | getProviderActions { provider: "trading" } | walletExecute or executeIntent with action=swap |
| HL perps | provider: "hyperliquid" | Setup actions → orders with agent_wallet or delegated lane |
| Polymarket | provider: "polymarket" | Funding/setup status → CLOB orders (EU egress for live orders) |
| Earn deposit | provider: "earn" or morpho / aegis | deposit_* actions with correct decimals |
| Bitfinex funding | provider: "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.