> ## Documentation Index
> Fetch the complete documentation index at: https://paralens.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# motifs — Structural Pattern Evidence in ParaLens TxReport

> motifs is an array of named structural patterns discovered inside the transaction — the evidence behind intent classification in ParaLens TxReport.

`motifs` contains the structural patterns that the ParaLens engine identified inside the transaction. Each motif is a named, evidence-backed pattern — a swap hop, a closed value loop, a transfer arc. Together, they compose into the top-level `classification.intent_kind`.

## Example

```json theme={null}
{
  "id": 7,
  "kind": "ProtocolSwap",
  "status": "Proven",
  "confidence": "High",
  "scope_id": 12,
  "actor": "0xbdb3ba9ffe392549e1f8658dd2630c141fdf47b6"
}
```

## Fields

<ResponseField name="id" type="number" required>
  Motif identifier within this report.
</ResponseField>

<ResponseField name="kind" type="string" required>
  Motif type. See the [Common motif kinds](#common-motif-kinds) table below for possible values.
</ResponseField>

<ResponseField name="status" type="string" required>
  Verification status of the motif. One of:

  * `Proven` — the pattern was confirmed with sufficient structural evidence.
  * `Suspected` — the pattern was inferred but not fully corroborated.
</ResponseField>

<ResponseField name="confidence" type="string" required>
  Engine confidence in the motif. One of `High`, `Medium`, or `Low`.
</ResponseField>

<ResponseField name="scope_id" type="number" required>
  Structural scope where the motif was found. Group by this value to visualize routes or isolate sub-transactions within a complex trace.
</ResponseField>

<ResponseField name="actor" type="string | null">
  Motif-level actor address when available. May be `null` if the engine could not resolve a specific actor for this pattern.
</ResponseField>

## Common motif kinds

| Kind                       | Description                                                  |
| -------------------------- | ------------------------------------------------------------ |
| `ProtocolSwap`             | Token swap through a DEX protocol                            |
| `ProtocolMultiHopExchange` | Multi-hop route through multiple DEX pools                   |
| `LinearTransfer`           | Simple token or native transfer                              |
| `ClosedValueFlow`          | Value that enters and exits the same address — profit signal |
| `IdentityWrap`             | Wrapping of native ETH to WETH or equivalent                 |
| `IdentityUnwrap`           | Unwrapping WETH to native ETH                                |
| `ContractDeployment`       | Deployment of a new contract                                 |
| `ProtocolLending`          | Interaction with a lending protocol                          |
| `ProtocolLiquidity`        | Liquidity provision or removal                               |

<Note>
  Treat unknown `kind` values as opaque — new motif types may be added as the ParaLens engine is updated.
</Note>

## Usage guidance

* **Route visualization** — Group motifs by `scope_id` to build route or scope visualizations. Each scope represents a coherent structural unit within the trace.
* **Intent explanation** — Show why a transaction was classified by listing the discovered `motifs[].kind` values. This gives users a human-readable evidence trail behind `classification.intent_kind`.
* **MEV analysis** — Look for `ClosedValueFlow` motifs. They indicate value that left and returned to the same actor, a reliable profit signal in sandwich attacks and arbitrage.
* **Display density** — Collapse duplicate `kind` values for display in dense transactions where the same pattern repeats across multiple scopes.
* **Forward compatibility** — Do not hard-code exhaustive checks against `kind`. New motif types may be introduced without a breaking change.
