> For the complete documentation index, see [llms.txt](https://rwapact.gitbook.io/whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rwapact.gitbook.io/whitepaper/system-architecture/execution-layer-agnosticism.md).

# Execution-Layer Agnosticism

## Execution-Layer Agnosticism

RWAPACT is not the execution venue. It places a consistent decision boundary before different execution interfaces.

```
Agent
  -> RWAPACT Decision Layer
  -> Execution Adapter / Integration
  -> Execution Environment
```

The decision layer remains before execution. Each integration adapts that boundary to the execution interface it serves.

### Why execution-layer agnosticism matters

Execution infrastructure can vary. An agent may trade through a DEX, an MCP server, or an API. RWAPACT does not need a different risk protocol for each environment.

The core questions remain the same:

* Is the trade sufficiently low-risk?
* Is the session valid?
* Does policy allow it?
* Are execution conditions acceptable?
* Has the decision been recorded?

Only the final execution interface changes. The Pact still evaluates the request before it can be forwarded.

### Uniswap v4 integration

The specified Uniswap v4 architecture uses a hook that intercepts agent swaps. The hook runs the Five-Layer Pact before allowing execution.

```
Agent calls pool.swap()
  -> Hook.beforeSwap()
  -> KRO Risk Oracle
  -> KSO Session Oracle
  -> KPV Policy Vault
  -> KGR Gas Router
  -> If all pass: allow swap
  -> Hook.afterSwap()
  -> KAR records attestation with execution txHash
```

Uniswap v4 remains the execution venue. RWAPACT adds a decision boundary around the swap path. This describes the integration architecture, not a claim that the hook is deployed.

### MCP integration

For agents trading through MCP, RWAPACT uses the specified middleware pattern:

```
Agent
  -> MCP Tool Call
  -> RWAPACT MCP Middleware
  -> Five-Layer Pact
  -> Execution MCP
```

The middleware intercepts the request and runs the Pact. It forwards the request to execution only when the required conditions pass.

```
MCP Tool Call
  -> RWAPACT Middleware
  -> Rejection
  -> No execution forwarding
```

This is an integration architecture defined by the specification. It does not establish a current production deployment.

### Robinhood API integration

For agents using the Robinhood native API, the specified integration uses a proxy:

```
Agent
  -> RWAPACT Proxy
  -> Five-Layer Pact
  -> Robinhood API
```

The proxy runs the Pact before forwarding the trade request. This is an architectural integration pattern, not a statement that the integration is currently deployed.

### Common decision boundary

| Execution environment | RWAPACT integration | What stays the same                     |
| --------------------- | ------------------- | --------------------------------------- |
| Uniswap v4            | Hook                | Five-Layer Pact decision boundary       |
| MCP                   | Middleware          | Risk, session, policy, gas, attestation |
| Robinhood API         | Proxy               | Risk, session, policy, gas, attestation |

The comparison shows one decision model preceding different execution interfaces. It does not treat the execution systems as interchangeable.

### What changes and what does not

What changes:

* Execution interface
* Integration mechanism
* Transaction forwarding method
* Execution-specific lifecycle details

What remains consistent:

* Trade intent enters the decision boundary
* The Five-Layer Pact evaluates the request
* Authorization is required before execution
* Rejection prevents forwarding
* KAR records decision context

### Important boundaries

RWAPACT does not become a DEX, wallet, exchange, custodian, autonomous agent, or the Robinhood API itself. It is the decision and risk middleware surrounding the execution layer.

RWAPACT does not guarantee the quality or profitability of execution. It determines whether the requested action satisfies the required conditions before forwarding.

### Architectural summary

```
                +---------------+
                | Autonomous    |
                | Agent         |
                +-------+-------+
                        |
                        v
                +---------------+
                |   RWAPACT     |
                | Decision Gate |
                +-------+-------+
                        |
                        v
            +-----------+-----------+
            |           |           |
            v           v           v
       Uniswap v4      MCP      Robinhood API
            |           |           |
            +-----------+-----------+
                        |
                        v
                Execution Layer
```

The execution interface can vary while the decision boundary remains conceptually consistent. The agent creates intent. RWAPACT evaluates and authorizes. The execution layer performs the trade. KAR preserves the decision context.

The next chapter examines [The Five-Layer Pact](/whitepaper/the-five-layer-pact/kro-risk-oracle.md) in detail.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://rwapact.gitbook.io/whitepaper/system-architecture/execution-layer-agnosticism.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
