← Back to resources
Agent architecture guide

How On-Chain AI Agents Work in Finance

See how on-chain AI agents monitor wallets, explain DeFi loans and prepare repayments. Follow a 50 USDC example through proposal, approval and confirmation.

A glass path passes through a metal gateway beside an isolated key, illustrating separate wallet authorization.

On-chain AI agents can watch a wallet, explain a change in a DeFi loan or prepare a transaction for approval. The difference matters if you ask an agent, “How much do I owe?” Reading the loan can answer that question. Moving money to repay it requires separate permission.

In a typical design, the model interprets data off-chain. The blockchain supplies the record of what happened. This guide follows a borrowing position from observation to a possible repayment and shows where Bluwhale can provide context about the user.

How on-chain agent architecture works

Alchemy's architecture guide describes patterns including wallet watchers, event-driven workflows and separation of detection from execution. These patterns help organize the components around the trigger and outcome of the task.

Financial agent components, interfaces and responsibilities
ComponentInput and outputResponsibility
Data adapterSource records to normalized observationsPreserve identity, provenance and time
Context layerRelevant observations to contextual inputSupply the information required for the task
Reasoning componentContext to an explanation or proposalProduce a structured result
Policy and signerProposed action to authorized requestEnforce the permitted operation and scope
Execution and reconciliationSubmitted request to recorded outcomeTrack confirmation, rejection or uncertainty

Give each request a reference that follows it through the system. When someone asks why the agent reported a particular debt balance, the team should be able to find the wallet, protocol and block used for that answer.

A hand fits a teal module into a metal assembly beside several separate components.

Three use cases for on-chain AI agents

  • Wallet activity alert. Notify the user when a transfer reaches a watched address. Include the network, amount and transaction reference so they can inspect the event.
  • DeFi loan review. Read the collateral and outstanding debt at an identified block. If you show a risk measure, name the protocol that defines it. For example, Aave explains how its health factor relates to liquidation risk.
  • Repayment proposal. Prepare the details of a payment the user wants to consider. Show the asset, amount, network and destination before anyone approves spending.

What a read-only agent can see and who can sign

Suppose a lending protocol reports that a wallet owes 200 USDC at the block the app just checked. The user asks for a summary. A read-only agent can show the 200 USDC debt, identify the protocol and give the time of the observation. The task ends there.

A glass lens magnifies stacks of coins while a robotic gripper holds a key above an open wallet.

Now suppose the user asks, “Prepare a 50 USDC repayment.” The agent can draft it and show which wallet, network and lending contract it would use. The app should label it Proposed. At this point the user has authorized preparation only, and the debt shown on screen still comes from the last protocol reading.

If the user chooses to proceed, the wallet must authorize the specific transaction under its spending rules. Changing the amount or destination requires checking the revised request. A simulation can preview a possible outcome, but network conditions may change before submission. Chainlink’s agent safety guide explains how permissions constrain what an agent can execute.

When can the agent say the repayment went through?

After submission, show the transaction reference and mark the repayment Pending. If the request times out, check its status on the intended network before attempting another payment. If it reverts, show the failure and keep the repayment out of the completed history.

Once the transaction succeeds under the network’s confirmation rules, refresh the lending position. Show the debt the protocol now reports, along with the block or time. Interest and intervening activity can make that amount different from simply subtracting 50 from the earlier 200.

Where Bluwhale fits in on-chain agent architecture

Bluwhale’s intelligence layer links identity and activity to give an agent personalized context. Use Bluwhale's documentation to map that context into the agent’s data path.

The crypto AI agent overview is a starting point for defining the financial workflow. Identify the actual contextual response and its access requirements separately from the wallet and transaction tooling selected for execution.

What Oceanum testnet can show

Bluwhale’s network documentation lists Oceanum as a testnet with chain ID 186. Its public RPC guide describes the endpoint used to query the network. An application that needs user insights should check the Bluwhale context interface separately.

What does an execution attestation tell you?

In Bluwhale’s node architecture, an attestation provides evidence about the environment where a computation ran. Verifier nodes check that evidence. Permission to spend the user’s funds is a separate decision for the wallet.

How to check the read-only workflow

Before a test, confirm that the connected network matches the intended chain. Give the agent a dated observation and ask it to explain the position with signing disabled. The expected result is an explanation linked to that observation and zero transactions submitted by the agent during the test.

A first test for on-chain AI agents

Build a case that reads a known observation and produces an explanation with its source time. Then add a simulated proposal and check the policy boundary. Only extend the workflow when the application can trace the request and reconcile its outcome.

Continue with the crypto agent developer checklist and financial agent failure tests to turn the component model into a review plan.

Explore Bluwhale crypto AI agents to define the context your task needs, and use the component model to assign clear ownership for reasoning, signing and execution.

Crypto AI agents

Build with Bluwhale

Explore crypto agents
Cookie Consent

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.