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

# HyperNative Integration

> Pre-transaction simulation, risk scoring, and compliance screening

## Overview

**HyperNative** is an advanced pre-transaction security and simulation layer integrated into the Yield.xyz security stack.

It provides real-time transaction simulation, risk scoring, and compliance screening before execution — allowing both Yield.xyz and its partners to detect threats and policy violations before users ever sign a transaction.

<Info>
  HyperNative complements Shield, which validates a transaction's structure and intent. Together, the two systems deliver complete pre-signing protection:

  * **Shield** confirms that the transaction matches expected patterns
  * **HyperNative** simulates the transaction to ensure it behaves safely and complies with policy
</Info>

***

## How It Works

<Tabs>
  <Tab title="Transaction Simulation">
    Every unsigned transaction built through the Yield API can be simulated via HyperNative.

    The simulation engine runs the transaction in a **sandboxed EVM environment**, returning:

    * Execution results
    * Gas estimates
    * Decoded call data
    * State changes preview
  </Tab>

  <Tab title="Risk Assessment">
    Each transaction receives a **risk score** based on behavioral heuristics, audit data, and runtime behavior.

    Common checks include:

    * Contract impersonation detection
    * Token transfer anomalies
    * Approval limit mismatches
    * Reentrancy patterns
    * Flash loan indicators
  </Tab>

  <Tab title="Compliance Screening">
    Built-in Screener module performs real-time checks:

    * **OFAC sanctions**: Flag sanctioned addresses
    * **Pool toxicity**: Track tainted assets in DeFi pools block-by-block
    * **Counterparty risk**: Evaluate transaction counterparties

    Enables rules like:

    * "Reject deposits into pools with >5% tainted assets"
    * "Alert if counterparty is OFAC-linked"
  </Tab>

  <Tab title="Policy Enforcement">
    HyperNative supports **custom policy creation** using its dashboard or Python SDK.

    Policies can:

    * Block transactions
    * Flag for review
    * Trigger alerts
    * Execute automated actions

    Based on predefined conditions (gas anomalies, sanctions, tainted funds, etc.)
  </Tab>
</Tabs>

***

## Integration with Shield

| Layer           | Function             | What It Checks                                              |
| --------------- | -------------------- | ----------------------------------------------------------- |
| **Shield**      | Structure validation | Transaction matches expected pattern, addresses are correct |
| **HyperNative** | Behavior simulation  | Transaction executes safely, complies with policy           |

Combined, they provide **end-to-end transaction protection** — structure + behavior.

***

## Flow Summary

<Steps>
  <Step title="Build transaction">
    Yield API builds unsigned transaction
  </Step>

  <Step title="Validate structure">
    Shield validates structure and intent
  </Step>

  <Step title="Simulate behavior">
    HyperNative simulates behavior and applies policy checks
  </Step>

  <Step title="Review results">
    Client reviews simulation output and proceeds with signing
  </Step>
</Steps>

***

## Policy Use Cases

| Policy Type       | Description                      | Example Rule                                      |
| ----------------- | -------------------------------- | ------------------------------------------------- |
| **Security**      | Detect gas or approval anomalies | Reject transactions with >5× typical gas usage    |
| **Pool Toxicity** | DeFi pool health monitoring      | Reject deposits if >5% of assets are tainted      |
| **Sanctions**     | OFAC compliance                  | Block transactions involving sanctioned addresses |
| **Monitoring**    | Continuous validation            | Alert if pool risk level changes after deposit    |
| **Automation**    | Protective actions               | Auto-pause affected yields during incidents       |

***

## Automation & Guardian Layer

Policies can trigger **automated actions** when thresholds are exceeded:

* Pause affected yields
* Initiate withdrawals
* Send alerts to security teams
* Log for compliance review

Supports **pre-signed transactions** and limited execution roles (e.g., HyperNative acts as "pauser only") for institutional setups.

***

## API-Level Simulation

All Yield.xyz API-built transactions can be automatically simulated through HyperNative.

<AccordionGroup>
  <Accordion title="Direct API access">
    Partners can call HyperNative directly for independent validation before signing. This enables a **zero-trust setup**, ensuring transactions are verified even if built externally.
  </Accordion>

  <Accordion title="Client-side deployment">
    HyperNative can be deployed on the client side. Policies and compliance configurations used by Yield.xyz can be **exported** and **imported** into client-owned instances to confirm and simulate transactions prior to signing.
  </Accordion>

  <Accordion title="Custom policy control">
    Enterprise clients can define their own policies, risk thresholds, and automated actions — independent of Yield.xyz defaults.
  </Accordion>
</AccordionGroup>

***

## Coverage

HyperNative protection covers:

* ✅ All EVM chains
* ✅ Major DeFi protocols
* ✅ Lending protocols
* ✅ Bridges and cross-chain
* ✅ Staking and restaking

***

## Benefits

<CardGroup cols={2}>
  <Card title="Detect threats" icon="triangle-exclamation">
    Detect malicious or anomalous transaction behavior before signing
  </Card>

  <Card title="Compliance checks" icon="scale-balanced">
    Real-time sanctions and pool toxicity screening
  </Card>

  <Card title="Continuous monitoring" icon="eye">
    Pre- and post-transaction monitoring
  </Card>

  <Card title="Automated protection" icon="shield-halved">
    Policy triggers for automated protective actions
  </Card>
</CardGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Shield" icon="shield-check" href="/documentation/shield-security/shield">
    Transaction validation library
  </Card>

  <Card title="Security Tiers" icon="layer-group" href="/documentation/shield-security/security-tiers">
    Deployment models
  </Card>

  <Card title="Security Overview" icon="shield" href="/documentation/shield-security/security-overview">
    Full security architecture
  </Card>

  <Card title="Security Notices" icon="bell" href="/documentation/shield-security/security-notices">
    Security announcements
  </Card>
</CardGroup>
