← Back to resources
Agent architecture guide

Onchain Financial Agent Architecture: From Data to Authorized Actions

Map data, context, reasoning, authorization and execution in an onchain financial agent, with conceptual pseudocode and a separate Oceanum testnet reference.

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

An onchain financial agent combines data, reasoning and blockchain tools around a defined task. Its language model can run offchain while the application reads or changes onchain state. The architecture needs to show which component observes, which proposes an action and which is allowed to sign and submit it.

Begin with a read-only task, such as explaining a borrowing position or detecting a relevant wallet event. Add transaction authority only as a separate, explicitly defined capability.

Map the components and their interfaces

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

Keep a request or correlation ID across these interfaces. It should be possible to trace a final explanation or transaction back to the observation that triggered it.

Choose a trigger and preserve the observation

A scheduled review, a wallet event and a protocol change have different timing requirements. Use the event or polling mechanism documented by the selected source and define the freshness required by the user task.

Preserve the chain, address, block reference where available, observation time and relevant record. The agent should be able to explain which state it used, especially when the source changes before the user reads the response.

For a borrowing-position explanation, the source might include collateral, debt and a protocol-defined risk indicator. Aave's documentation provides one example of a protocol-specific health factor; it is not a universal field across all DeFi positions.

Separate reasoning from signing authority

A proposed action is an output to evaluate. The signer or policy component should enforce the allowed network, destination, operation and limits independently of the model's explanation. Chainlink's agent safety guide discusses the boundary between offchain reasoning, permissions and onchain execution.

Use a structured proposal so the policy component can inspect the intended action. For a consequential operation, preserve the approval and the exact request it authorizes. A new proposal should not silently inherit approval given to a different action.

The following is an illustrative architecture sequence, not a deployed Bluwhale workflow.

context = read_context(subject)
proposal = reason(context)
authorized = policy_check(proposal)
simulated = simulate(authorized)
tx = submit_if_approved(simulated)
reconcile_until_terminal(tx)

Simulation can reveal issues with a proposed operation, but the state can change before execution. The application still needs to evaluate the actual submitted request and subsequent outcome.

Track transaction states without inventing success

Use distinct proposed, authorized, simulated, submitted and confirmed states. Retain rejected, reverted and uncertain outcomes. A tool returning a transaction identifier establishes submission, not necessarily a completed state change.

When a submission times out, check the result before repeating the operation. The earlier request may have reached the network even if the application did not receive its response. Reconciliation should resolve that uncertainty through the relevant network and provider interfaces.

Keep the agent's user-facing explanation aligned with those states. A pending operation should remain pending in both the interface and the event log.

Place Bluwhale context in the data path

Bluwhale's documentation describes an intelligence layer built around identity, graphs, embeddings and inference. Evaluate that context interface as a component of 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.

Treat Oceanum as a separate network integration

The Oceanum network documentation identifies chain 186 as testnet and states that mainnet has not launched. Its public RPC documentation describes HTTP JSON-RPC at https://rpc.bout.network, with rate limiting and no published testnet uptime SLA.

Keep that RPC configuration separate from the Bluwhale intelligence interface. An endpoint used to query or submit blockchain state is a different integration responsibility from retrieving user context. Record environment, chain ID and dependencies for any network example before turning it into a runnable guide.

What can an execution attestation establish in a test run?

In the Bluwhale node architecture, Oceanum provides evidence about the execution environment and verifiers check attestations. For a testnet integration, keep the chain ID, observation block, attestation reference when available and the signer’s authorization decision as separate fields. Start with a read-only proposal and no grant to submit. The expected result is a traceable proposal with zero submitted transactions. Check the network status before choosing an environment.

Start with one observable result

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

Define the context behind your financial agent

Explore Bluwhale crypto AI 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.