# Introduction

### *Everything Begins Here.*

The future of finance isn’t navigating yet another complex dashboard or juggling multiple protocols. While powerful, Decentralized Finance (DeFi) today often confronts users with **overwhelming complexity, fragmented experiences across different platforms, and the constant burden of manual strategy execution**. This friction creates a significant barrier, hindering both new users and seasoned veterans from efficiently participating and capitalizing on opportunities within powerful ecosystems like Hyperliquid.

## **Enter Neko: The Cognitive Gateway to Hyperliquid**

Neko is the first **DeFAI Swarm** (Decentralized Finance + AI) built natively for Hyperliquid.

Hyperliquid’s **HyperEVM** exists to make the core **L1 Orderbook** vastly more *programmable*. Neko builds directly upon this foundation, introducing the cognitive layer that makes the Orderbook profoundly more *intelligent*.

Neko is an intelligent, vertically integrated system engineered for seamless, optimal performance and execution across both environments. Neko acts as your intuitive interface to the full potential of Hyperliquid. Leveraging sophisticated **AI agents and context engineering** working tirelessly behind the scenes, Neko forms this cognitive layer that **automates complexity, optimizes performance, and transforms the user experience.**

Forget wrestling with intricate protocols; Neko translates your intent into intelligent, efficient action. This allows you to focus effortlessly on achieving your financial goals through three core pillars:

#### Swap

* Seamlessly execute spot orders on Hypercore via Neko’s builder code.
* EVM will be integrated soon.

#### Perps

* Engage with Hyperliquid’s powerful perpetual markets and all the HIP-3 exchanges through a single user-friendly interface.
* Vibe Trading: AI integrated interface enhanced by Neko’s insights for strategy creation and execution (coming soon).

#### Earn

* Access sophisticated, AI-optimized structured products and yield strategies.
* Strategies are deployed by specialized subagents that leverage the intelligent orderbook & EVM interaction.

{% hint style="info" %}
Neko isn’t just about adding AI; it leverages HyperEVM’s programmability to infuse the Hyperliquid orderbook with intelligence—fundamentally simplifying access and supercharging capability. It’s the beginning of effortless, intelligent interaction with the future of finance on Hyperliquid.
{% endhint %}


# Vision

### Neko is The Gateway to Hyperliquid

## Vision

We believe finance should be **ambient** — not something demanding constant active management, but an intelligent force working seamlessly in the background on behalf of the user. The ultimate potential of decentralization lies in enabling coordination and value creation at scale, fostering **autonomous on-chain economies** where participation doesn’t require deep technical expertise.

**Hyperliquid provides the essential foundation:** the high-performance infrastructure, deep liquidity, and growing user base necessary to house the future of finance. It delivers the raw **speed, precision, and depth**, including the critical **programmability** offered by HyperEVM.

**Neko provides the crucial intelligence layer** built upon this foundation. It’s the cognitive engine designed to **streamline user intent** and execute it optimally within the Hyperliquid ecosystem. Where Hyperliquid offers programmability, Neko delivers applied intelligence, transforming the orderbook and DeFi interactions into something truly intuitive.

{% columns %}
{% column %}

* **Hyperliquid is speed, precision, and depth.**
  {% endcolumn %}

{% column %}

* **Neko is understanding, accessibility, and intelligent execution.**
  {% endcolumn %}
  {% endcolumns %}

Today, most DeFi users grapple with tools that, while powerful, present unintuitive entry points. DeFi has scaled impressively in its underlying infrastructure (horizontally), but this has often led to a steep climb in user complexity (vertically). Neko is the first DeFAI Swarm designed to fundamentally address this gap. It acknowledges the complexity not by merely simplifying interfaces, but by embedding **deep intelligence** into the user experience itself.

Our mission extends beyond just facilitating transactions:

{% stepper %}
{% step %}

### Distribute Hyperliquid capabilities

Use an AI-driven cognitive layer that makes sophisticated actions effortless.
{% endstep %}

{% step %}

### Accelerate ecosystem growth

Accelerate the growth and maturity of the HyperEVM DeFi ecosystem by providing intelligent tools that optimize outcomes and lower barriers for users and developers.
{% endstep %}

{% step %}

### Compound intelligence into yield

The compounding of intelligence of data will result in higher performing structured products creating more real yield.
{% endstep %}
{% endstepper %}

Ultimately, Neko aims to establish a new **cognitive execution layer** for DeFi — an intelligent foundation built on AI Swarm intelligence and high-performance blockchains — **that serves as your seamless gateway** to Hyperliquid and the future of ambient finance.

We are shaping a future where interacting with complex financial systems is as simple as expressing a goal, setting the standard for accessible, intelligent DeFi.


# Tokenomics

Here is a breakdown of the Neko Token Distribution:

<table><thead><tr><th>Category</th><th width="118.862060546875">Allocation</th><th width="167.20703125">Vesting</th><th>Notes</th></tr></thead><tbody><tr><td>Team</td><td>10%</td><td>2 Month Cliff</td><td>~</td></tr><tr><td>Airdrop</td><td>33%</td><td>~</td><td>Already executed on <a href="https://x.com/neko_hl/status/1935054709620093149">June 18th 2025</a></td></tr><tr><td>Liquidity</td><td>14.43%</td><td>~</td><td>HIP-2, for orderbook spot liqudity</td></tr><tr><td>Burned</td><td>6.92%</td><td>~</td><td>~</td></tr><tr><td>Treasury</td><td>9.035%</td><td>~</td><td>Used for Growth, Operations, GTM, EVM Liquidity</td></tr><tr><td>Fair Launch</td><td>12.95%</td><td>~</td><td>Sold in the HFun Launch back in <a href="https://x.com/neko_hl/status/1880666510559256766">January 19th 2025</a></td></tr><tr><td>Fundraise</td><td>10.365%</td><td>1.5 Month Cliff</td><td>Sold to support operations and infrastructure costs.</td></tr><tr><td>Omo Pre-Seed</td><td>3.3%</td><td>3 Month Cliff 3 Month Linear Vest</td><td>Omo is the parent company of Neko<br><br>Omo funds were used to develop Neko<br><br>Allocation to the earliest believers in Neko</td></tr></tbody></table>

{% hint style="info" %}
We will add a graph of token unlocks soon
{% endhint %}


# Roadmap

| Phase | Feature                  | Public Feature       |
| ----- | ------------------------ | -------------------- |
| 1     | Custom PT Morpho Markets | :white\_check\_mark: |
| 1     | Leveraged LP Farming     | :octagonal\_sign:    |
| 2     | Vibe Trading             | :white\_check\_mark: |
| 2     | Social Agent             | :white\_check\_mark: |
| 2     | Neko Chat                | :white\_check\_mark: |
| 3     | Neko Agent Creator       | :octagonal\_sign:    |
| ?     | \[Only Neko Whales]      | :octagonal\_sign:    |

{% hint style="info" %}
Base Roadmap, will be updated
{% endhint %}


# vNEKO

## The vNEKO Vault

### What is vNEKO?

The vNEKO Vault represents a capital-efficient yield engine built on top of the NEKO token. When you stake NEKO into the vault, you receive vNEKO—a liquid share token redeemable 1:1 for NEKO after a 7-day cooldown period. This architecture unlocks multiple simultaneous yield streams while maintaining robust risk controls.

vNEKO isn't just a wrapper. It's an actively managed position that deploys your capital across high-efficiency strategies on both HyperEVM and HyperCore, generating real yield via arbitrage that autocompounds directly into your NEKO holdings.

{% hint style="info" %}
Currently the only sources of yield for the vNEKO vault are:

* Volatility Farming on the Orderbook
* Leveraged Volatility Farming between &#x20;
  {% endhint %}

#### The Goal of vNEKO?

The vNEKO vault increases the value of 1 vNEKO relative to 1 NEKO through diversified real yield generation.

**Multi-Strategy Approach:**

Our multi-agent system runs parallel yield strategies:

* **Volatility Farming** of Neko on the orderbook
* **Arbitrage** between vNEKO/HYPE and NEKO/HYPE pairs on the AMM

Future Implementations:

* **Lending rates** from Morpho markets
* **Liquidation profits** across DeFi protocols
* **PT-implied yields** from principal token discounts
* **LP fees & Token Emissions** from AMMs&#x20;
* **Treasury Yield** from stablecoins that redistribute the the t-bill yield

<figure><img src="/files/AIFZHS1u3dauSdS1e8ut" alt=""><figcaption></figcaption></figure>

**The Flywheel:**

As yield accumulates, vNEKO's price-per-share grows beyond 1:1 with NEKO. This widening spread makes arbitrage more profitable and consistent. More profitable arbitrage generates more yield, which further increases the spread. The cycle compounds.

{% hint style="info" %}
vNEKO and Neko are designed to be exchangeable 1:1, but vNEKO's multi-strategy yield generation naturally increases its value above peg\
\
If vNEKO falls below 1:1, reverse arbitrage brings it back
{% endhint %}

The result: diversified, resilient real yield that autocompounds into your position while maintaining 1:1 redeemability.

### Why Stake in the Vault?

**Real Yield, Autocompounded**

The vault generates yield from actual market activity—not token emissions. Profits from market making, volatility farming, and arbitrage are continuously reinvested into NEKO and added to your position. You earn more NEKO, not more dollars.

**Exclusive Alpha Access**

vNEKO holders gain early or exclusive access to Neko's premium products, gated by your vNEKO balance:

* **Vibe Trading**: AI-powered sentiment analysis and execution
* **Neko Chat**: Natural language DeFi interface
* **Leveraged LP Farming**: Enhanced yield strategies on AMMs
* **\[Classified]**: Reserved for whales

**Enhanced Liquidity & Reduced Slippage**

Vault strategies actively provide liquidity and tighten spreads on NEKO markets across HyperCore and HyperEVM. This benefits the entire ecosystem while generating returns for participants.

***

### How It Works

#### Phase 0: [RubFi](https://rubifi.gitbook.io/rubifi-docs) Market Making

In the initial phase, approximately 60-70% of staked NEKO is deployed to the RubFi HyperCore contract. RubFi executes sophisticated market-making strategies on the NEKO spot market:

* **Increases trading volume** through active quoting
* **Deepens orderbook liquidity** by maintaining tight spreads
* **Reduces bid-ask spread** for better execution

RubFi farms volatility on the orderbook and returns profits to vault participants as autocompounded NEKO. This creates a flywheel: better liquidity attracts more traders, generating more volume, which produces more yield.

{% hint style="info" %}
RubFi is leading the HyperCore integration portion of this strategy
{% endhint %}

#### Phase 1: Volatility Farming & Parity Arbitrage

Phase 1 introduces two additional yield engines built around proprietary Morpho markets.

**Leveraged Volatility Farming on PRJX AMMs**

The vault supplies liquidity to vNEKO/HYPE and NEKO/HYPE pools on PRJX, Hyperliquid's native AMM. Concentrated liquidity positions capture trading fees while the vault's rebalancing agents optimize range placement based on market conditions.

**Leveraged Parity Arbitrage**

Neko deploys two private Morpho V2 isolated markets:

1. **vNEKO collateral → borrow HYPE**
2. **NEKO collateral → borrow HYPE**

This structure enables capital-efficient arbitrage of the vNEKO/NEKO spread. The vault borrows HYPE using vNEKO as collateral, swaps HYPE for Neko on the open market when vNEKO trades at a premium, then returns the position. The spread gets captured and autocompounded into participants' balances.

If vNEKO trades at a discount below 1:1 redemption value, the strategy reverses: borrow HYPE against NEKO collateral, buy discounted vNEKO, and redeem for Neko at par. This mechanism keeps vNEKO anchored near intrinsic value while extracting yield from deviations.

#### Phase 2: Controlled Leverage

After Phase 1 stabilizes, the vault introduces moderate leverage (≤1.2× initially, potentially scaling to 1.5×+) to amplify returns on volatility farming positions. Leverage remains tightly controlled with health factor targets of 2.0 and hard minimums of 1.6.

***

### Yield Mechanics

**Autocompounding Flow**

1. Strategies generate profits in HYPE, USD, and Neko
2. Profits are routed to the vault's autocompound module
3. The module market-buys NEKO using accumulated profits
4. Purchased NEKO is distributed pro-rata to all vNEKO holders
5. Your vNEKO share becomes redeemable for more NEKO

This increases the vault's price-per-share (PPS) over time. You hold the same number of vNEKO shares, but each share is backed by more NEKO.

**Fee Structure**

* **Management fee**: 0.0% annual on AUM&#x20;
* **Performance fee**: 0.0% of distributed yield
* **Default routing**: 100% of net yield buys and locks NEKO

All profits are kept for users which the yield is then utilized to buyback Neko and autocompound back into the vault.

{% hint style="info" %}
Alternativly 50/50 allocation may seed vNEKO LP to reduce slippage
{% endhint %}


# Affiliate Program

More information soon... :shushing\_face:


# Core Features

Neko acts as your intelligent gateway, simplifying access to the best of Hyperliquid’s capabilities across both the high-speed L1 Orderbook (HyperCore) and the programmable HyperEVM. By being vertically integrated, Neko provides a single, streamlined interface designed for both new entrants and power users.

Behind the scenes, Neko leverages its **AI Swarm** — a network of intelligent agents — to automate complex backend processes, optimize execution, and deliver a superior user experience with enhanced product outputs. This allows you to interact powerfully with Hyperliquid through simple, intuitive actions focused on these core pillars:

{% hint style="info" %}
Neko’s AI Swarm: specialized subagents handle strategy execution, context engineering, and optimization across HyperCore & HyperEVM.
{% endhint %}

## Swap

{% hint style="warning" %}
NOTE: Swap is only applicable to HyperCore for now. HyperEVM integration is on the roadmap.
{% endhint %}

* What it is: Buying and selling assets efficiently on Hyperliquid.
* How Neko helps: Neko intelligently routes your spot orders across both the HyperEVM’s liquidity pools and the L1 Orderbook, automatically seeking the path for optimal execution and minimal slippage.
* User Benefit: Get the best possible price for your trades without needing to manually compare liquidity sources or navigate complex interfaces. Effortless, optimized execution.

## Perps

* What it is: Trading perpetual futures contracts on Hyperliquid with leverage.
* How Neko helps: Engage with Hyperliquid’s deep perpetuals markets through Neko’s clean, user-friendly interface. Future iterations will incorporate AI-driven insights or risk management assistance.
* User Benefit: Easily access and trade perpetuals on a leading platform, directly from your preferred social environment or a simplified interface.

## Earn

* What it is: Generating yield on your assets through various DeFi strategies.
* How Neko helps: Neko provides access to sophisticated structured products and yield strategies. Specialized AI subagents manage these strategies, employing advanced context engineering to optimize performance, manage risk, and potentially enhance returns by intelligently interacting with both HyperCore & HyperEVM.
* User Benefit: Access advanced, automated yield generation opportunities with simplified deposit and management. Let Neko’s intelligence work for you.

## Stake

* What it is: Staking vault that unlocks the utility of the Neko token.
* How Neko helps: Neko subagents manage the strategy execution so real yield is generated via volatility farming on both the order book and AMM.
* User Benefit: Earn real yield on Neko tokens while earning additional charms to access higher tiers of revenue share; unlock premium features depending on how much vNeko is held.


# Key Offerings

<table data-view="cards"><thead><tr><th data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="/pages/MJCkIv6qTL3Z7YrCGwjz">/pages/MJCkIv6qTL3Z7YrCGwjz</a></td></tr><tr><td><a href="/pages/a0e4bf589547297ed06f24d44f7e9ad617dd71b7">/pages/a0e4bf589547297ed06f24d44f7e9ad617dd71b7</a></td></tr><tr><td><a href="/pages/7a1f28aeec8cd29835a3fb9818f7fbc7773faa6c">/pages/7a1f28aeec8cd29835a3fb9818f7fbc7773faa6c</a></td></tr></tbody></table>


# Neko Builder Code

## What It Is

The Neko Builder Code is the foundational integration that connects the Neko interface to Hyperliquid's decentralized liquidity infrastructure. This enables Neko to offer seamless access to Hyperliquid's deep liquidity for both spot assets and perpetual contracts from Hyperliquid.

{% hint style="info" %}
Neko does not charge premium fees ontop of the Hyperliquid frontend for now.&#x20;
{% endhint %}

### Your Benefit

By building on Hyperliquid's core infrastructure, Neko provides a superior and consolidated trading experience.

* **Unified Trading Hub**: Trade the full spectrum of Hyperliquid's spot and perpetuals markets without leaving the Neko interface.
* **Deep Liquidity Access**: Directly tap into Hyperliquid's robust L1 orderbook and perpetuals liquidity for efficient trade execution.
* **Comprehensive Market Coverage**: Gain access to all **HyperCore** spot tokens and **HIP-3** perpetuals exchanges, including newly listed assets, from a single point of entry.

***

#### Future Development

The Neko Builder Code in tandem to the Neko HL SDK is architected for future expansion, with key upgrades planned to enhance trading efficiency and capital flexibility.

**Spot Execution Aggregator**

Neko plans on integgrating an execution aggregator for spot trades on HyperEVM. This system will intelligently route orders between Hyperliquid's L1 orderbook and various **HyperEVM** AMMs. The goal is to guarantee optimal trade execution by automatically sourcing the best price across all integrated liquidity venues.

**Multi-Margin Perpetuals**

In partnership with a \[*undisclosed parnter*], Neko will introduce multi-margin collateral for perpetuals trading. This will allow you to use a wider range of assets—such as BTC, ETH, and HYPE—as collateral for your perpetual positions, increasing capital efficiency and trading flexibility.


# Earn

### Earn Function of Neko

Neko Earn makes sophisticated yield generation effortless through AI-powered structured products built on HyperEVM. Participate in **ambient finance** – deposit your assets and let Neko’s intelligence handle the rest.

## What It Is

Neko provides access to sophisticated yield generation strategies through the Neko Vault architecture, leveraging secure industry-standard Morpho V2 Vaults. Vaults also leverage custom Universal Adapter logic to integrate with any whitelisted smart contracts defined in the strategy.

## The Neko Intelligence Edge

These aren’t static vaults. Each strategy is dynamic and actively coordinated by **Neko’s Multi-Agent Systems.** Behind the scenes, these agents employ:

{% hint style="info" %}

* **Advanced Context Engineering:** Continuously analyzing data from the data-pipelining system (subgraphs, APIs, and cadence mechanisms) to allow the multi-agent system to reason and execute strategy rebalancing based on current market conditions.
* **Automated Execution:** Intelligently interacting with HyperEVM protocols to manage assets, harvest rewards, and execute strategy adjustments.
* **Proactive Risk Management:** Monitoring conditions via Hypernative for real-time smart contract and oracle security to help ensure user funds are not being attacked.
  {% endhint %}

## Your Benefit

{% hint style="success" %}

* **Optimized Yield:** Leverage AI designed to enhance returns while managing risk.
* **Auto-Compounding:** Earnings are automatically reinvested to maximize growth — no manual claiming needed.
* **Set-and-Forget:** Deposit your chosen asset once and let Neko’s AI agents manage the complexities 24/7. These agents can capture and execute upon financial alpha more proficiently than human curators, generating more real yield.
  {% endhint %}

## Future Development

<details>

<summary>Future development plans</summary>

As Neko builds more proprietary data of active and successful DeFAI strategies, there can be fine-tuned SLMs optimized on a DeFi-protocol basis. These will continuously analyze data to refine strategies for potentially higher, risk-adjusted returns and improved performance.

</details>


# Stake

### Stake

Staking your Neko and receiving vNeko unlocks a suite of benefits: more yield, more revenue share, and early access to new products.

{% hint style="info" %}
Staking Neko has a 7 day unlock period.
{% endhint %}

## What It Is

Stake NEKO → receive vNEKO (your receipt/share). While your stake is in a 7-day unlock window, Neko’s agents manage two coordinated strategies. Accounting is handled via price-per-share (PPS); rewards roll into PPS through auto-compounding more Neko.

{% stepper %}
{% step %}

### Provisioning NEKO inventory to market-making

Neko provisions NEKO inventory to a HyperCore market-making program to capture spread and maker rebates.
{% endstep %}

{% step %}

### Managing NEKO↔vNEKO liquidity/arbitrage

Agents manage liquidity and arbitrage in the NEKO↔vNEKO pool on HyperEVM to earn swap fees and arbitrage edge on PRJX.
{% endstep %}
{% endstepper %}

## Your Benefit

* Stake Neko to earn more Neko through auto-compounding from multiple real-yield sources.
* Earn more charms to access higher levels of revenue share across offered products.
* Gain early access to new AI product features.
* Also earn PRJX and RubFi points.


# Core Architecture

{% stepper %}
{% step %}

### The Coordination Layer (Orchestrator Agent)

* Sitting at the heart of the swarm, the **Neko Orchestrator Agent** acts as the central brain. It receives parsed user intent from the Interaction Layer and formulates a strategic plan for execution.
* It coordinates tasks, manages state, and delegates specific actions to specialized agents within the Execution Layer. It also interfaces with external partner APIs like **Hypurr Bot** or **pvp.trade** where necessary.
  {% endstep %}

{% step %}

### The Intelligence Layer (AI Core)

This layer provides the cognitive power enabling Neko’s intelligent decision-making. It comprises:

* **Advanced Context Engineering:** the multi-agent system gets both historical and real-time market data from third-party protocols via a combination of proprietary subgraphs, APIs, and the cadence mechanism. This allows the agent to execute upon financial alpha as actionable signals populate into the context window of the multi-agent system.
* **AI Memory & Retrieval (RAG/CAG):** Neko utilizes **Retrieval-Augmented Generation (RAG)** to fetch real-time data, contextual information, and semantic knowledge from vector databases (Vector DB / Semantic Memory). **Cache-Augmented Generation (CAG)** leverages heuristics and frequently accessed data (like agent transaction history or optimized parameters) for efficient decision-making. This allows agents to recall past actions and learn effective strategies. *(Refer to Image 2 for AI Agent System detail).*
* **Proprietary Models:** Machine Learning models (e.g., **LSTM, ARIMA, Prophet, GNNs**) analyze market data, predict trends, assess risk, and optimize strategies.
  * Future Development
* **Reinforcement Learning (RL):** Models are continuously refined through feedback loops (potentially using techniques like DPO), allowing the system to adapt and improve its execution and risk management over time.
  * Future Development
    {% endstep %}

{% step %}

### The Execution Layer (DeFi Multiagent System & Contracts)

* This layer translates the Orchestrator’s plan into on-chain actions.
* **Specialized Agents (Architect Agents / RIG Agents / Neko Bots):** These agents possess specific capabilities, such as executing trades via optimal routing (Shogun architecture), managing assets within yield vaults (**Neko Vaults**), handling complex collateralization for perpetuals, or interacting directly with specific HyperEVM protocols (**LST, Lending, CDP, AMMs**) and the Hyperliquid L1 orderbook via their respective APIs. They employ multi-step workflows involving planning and tool-calling.
* **Smart Contracts:** Secure and audited smart contracts form the bedrock for holding user assets and executing specific, predefined DeFi logic on HyperEVM.
  * The `Vault` & `VaultFactory` contracts are derived from Morpho Vault V2 and are identical in the implementation
  * `UniversalAdapter` & `UniversalAdapterFactory` are custom contracts to enhance programability and flexibility of the vault contracts. Read (audits) to read the security reviews.
    {% endstep %}

{% step %}

### The Interaction Layer (Social Agents) — Future Development

* This is the primary user touchpoint. Users interact with Neko via simple commands or natural language mentions on familiar social platforms like **X, Discord, and Telegram**.
* This social agent is an Eliza Agent and will serve as an alpha distillation agent (think AIXBT for Hyperliquid) as well as an ad network.

Example social action:

* Compose this tweet: @neko\_hl gneko — this will send a link to the application for users to start trading
  {% endstep %}
  {% endstepper %}


# Agent System

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a href="/pages/407b7c1ba5b99523d4a491af0357824219bdb7ea">DeFAI Multi-Agent System</a></td></tr><tr><td><a href="/pages/pyd7NOvFSLUiTVEePuCV">Worker System</a></td></tr><tr><td><a href="/pages/fc9afdee9c15ee81500c0624752e26d355e485ae">Social Agent (FUTURE)</a></td></tr></tbody></table>


# DeFAI Multi Agent System

### What It Is

At the heart of Neko’s intelligent operation, particularly for managing sophisticated **Earn** strategies, lies the DeFAi Multiagent System. This system acts as the primary execution engine, taking high-level directives (often coordinated by the central Neko Orchestrator) and translating them into optimized, risk-managed on-chain actions within HyperEVM and Hyperliquid.

Instead of relying on static logic, each Neko strategy (e.g., Delta-Neutral, Looping Strategies, Supply-Side Optimizers, etc.) operates through our Manager Wallet API with dedicated teams of four specialized AI agents working in concert.

<figure><img src="/files/6Pcll30lgbMkvPYlzcw8" alt=""><figcaption></figcaption></figure>

### The Core Agent Workflow

When triggered by an event (such as a user deposit, a scheduled rebalance, or a significant market shift), the agents responsible for a specific strategy execute a collaborative workflow:

1. **Planner Agent**

   Initiates the process by analyzing the current state, the trigger event, and the strategy’s objectives. It drafts a preliminary plan of action (e.g., “deploy new capital,” “adjust allocation,” “harvest rewards”).
2. **Replanner Agent**

   Critically reviews the initial plan. It iterates on the strategy, considering potential risks, alternative approaches, and market data to refine the plan for optimal outcomes and safety.
3. **Executor Agent**

   Prepares for the execution phase. It identifies the necessary “tools”—specific smart contract interactions (like swaps via Shogun, lending via integrated protocols), API calls, or internal Neko functions required to implement the refined plan.
4. **Action-Planner Agent**

   Performs the final validation. Using the refined plan and the tool readiness information from the Executor, it constructs the precise sequence of on-chain transactions needed (e.g., exact swap amounts, lending parameters) and confirms the final execution steps, especially for complex multi-step actions.

***

### Data-Driven Decision Making

This entire workflow is deeply informed by a rich tapestry of on-chain and off-chain data, allowing the agents to make contextually relevant and timely decisions. Before planning and replanning, agents retrieve critical information using Neko’s core AI capabilities:

* RAG Database (Semantic Context): Agents query the Retrieval-Augmented Generation database for relevant knowledge, similar past scenarios, or contextual information based on semantic similarity.
* Time-Series Database (Market & Prediction Data): Agents access real-time and historical market data (prices, volume), protocol states, and potentially predictive analytics derived from models.
* Time-Series Database (Agent Transaction History): Agents review their own past actions and outcomes for the specific strategy (long-term memory), enabling learning and strategy refinement over time.
* Envio Subgraphs: This allows the agent to query and review the historical rates, fees, APRs, etc. of the respective protocols involved in the respective strategy.
* Cadence Mechanism: Offers a real-time heartbeat of all the protocols the strategies are involved with.

*(This data retrieval process is conceptually illustrated in the AI Agent System diagram within the Architecture Overview).*

***

### Underlying Technology

{% hint style="info" %}
The DeFAI Multiagent System leverages a high-performance, secure technology stack optimized for demanding DeFi operations
{% endhint %}

* RIG Agent Framework: A Rust-based agent framework provides the core structure, ensuring fast runtime and efficient execution critical for timely market interactions.
* Large Language Models (LLMs): Advanced models (like experimental Google Gemini versions) power the reasoning, planning, and decision-making capabilities of the specialized agents (Planner, Replanner, Action-Planner).
* RAG & CAG Databases: These form the core memory system. The Retrieval-Augmented Generation (RAG) database provides semantic context and relevant knowledge, while the Context-Augmented Generation (CAG) database stores heuristics, learned best practices, and long-term transaction history (agent memory).
* Time-Series Database: Provides essential real-time and historical market data, protocol states, and predictive analytics used throughout the decision-making process.
* Event-Driven Architecture & Scheduling: The system operates based on triggers (user actions, market events, scheduled routines like rebalancing), indicating an underlying mechanism for event handling and task scheduling.

This modular Rust-based architecture is designed for performance, security, and adaptability, allowing components like LLMs or data sources to be updated as technology progresses.

### Outcome

This sophisticated multi-agent approach allows Neko strategies to transcend static implementations. It enables dynamic, adaptive portfolio management aimed at optimizing yield and managing risk according to real-time market conditions and the unique parameters of each defined strategy, truly bringing the vision of ambient, intelligent finance to life.


# Worker System

### What It Is

The **Neko Worker System** is a deterministic, event-driven, **Celery-based** task processor that automatically manages a wide range of DeFi positions including: **PT Looping, Basis Trades, Supply Side Optimizers, ALM Orchestrator strategies, and more**.

While the [DeFAI Multi-agent System](/architecture/agent-system/defai-multi-agent-system) is responsible for high-level analysis and strategy selection, the Worker System carries out those strategies on-chain with precision and reliability. The system is designed for scalability, with each vault managed by a dedicated, autonomous Neko Worker in a `1 vault = 1 worker loop` architecture.

### Your Benefit: AI-Informed Strategy, Deterministic Execution

The Neko architecture is designed to give you the best of both worlds: the analytical power of advanced AI models and the predictable safety of deterministic execution.

* **AI-Powered Analysis**: **Pre-approved** AI and strategy engines analyze vast amounts of historical and real-time market data from Neko's data pipelines to select the optimal strategy for a given vault.
* **Deterministic Execution**: Once a strategy is assigned, the Neko Worker executes it according to a strict, predefined set of rules. This ensures the system will not hallucinate, call the wrong function, or interact with an unintended protocol, protecting the profitability of your position.
* **Traceable & Auditable**: Every action taken by a worker is logged and traceable on-chain, providing a clear audit trail of your position's management history.

***

### Core Architecture

The Worker System is composed of four key components that ensure reliable and persistent operation.

<figure><img src="/files/ePuu2ZUjOKo5ejT8PHxa" alt=""><figcaption></figcaption></figure>

#### Neko Workers

These are distributed, asynchronous, **Celery-based** task runners that form the heart of the system. Each worker is an automated script responsible for the main monitoring and execution loop for a single vault position. They operate independently and are designed for high availability and robust error handling.

#### State Management & Persistence

The system's memory is a comprehensive state management database. It goes beyond storing the initial strategy to track the complete, dynamic state of each position. This includes:

* **`status`**: The current operational state (e.g., `active`, `rebalancing`, `error`).
* **`onchain_state`**: The latest data fetched from the blockchain for the position.
* **`performance_metrics`**: Key metrics like APR and fees earned.
* **`worker_last_heartbeat`**: A timestamp to monitor if a worker is alive and responsive.
* **`alerts`**: A log of recent warnings or issues.

This persistence enables **robust error handling and recovery**, ensuring that if a worker crashes or restarts, a new instance can resume exactly where the previous one left off.

#### Strategy Definitions

Each vault is assigned a predefined strategy (e.g., Automated Liquidity Management, **PT Looping, Basis Trades**) from a library of pre-approved playbooks. These definitions, stored in the database, contain the exact configuration and parameters for the vault, including token addresses, protocol details, and specific strategy rules. Workers execute these strategies faithfully and cannot deviate from their instructions.

#### Execution Layer (hl-bot-suite)

To ensure maximum security and determinism, workers do not execute blockchain transactions directly. Instead, they send commands for atomic actions (e.g., "rebalance," "compound") to a secure, external API service. This Execution Layer is responsible for the final, complex step of building, signing, and broadcasting the on-chain transaction. This separation of concerns creates a secure boundary between the worker's decision logic and on-chain execution.

### How It Works: The Worker Lifecycle

The Worker System is event-driven, beginning when a user deposits funds into a vault.

1. **Trigger**: A user deposit event initiates the workflow, assigning a dedicated Neko Worker to manage the vault's new or existing position.
2. **Initialization**: The worker loads its assigned **strategy** and **parameters** from the state management database.
3. **Execution Loop**: The worker enters a continuous loop to manage the position:
   * **Acquire Lock**: It secures a lock on the position to prevent concurrent operations from other workers.
   * **Load State**: It fetches the latest status of its assigned position from the database.
   * **Fetch On-Chain Data**: It queries the blockchain and subgraphs for real-time data about the position (e.g., current price tick, uncollected fees).
   * **Evaluate Strategy**: It compares the live on-chain data against the rules defined in its strategy to determine if an action is required.
   * **Execute Action**: If an action is needed, the worker sends a precise command (e.g., `rebalance`, `compound`) with the necessary parameters to the secure Execution Layer.
   * **Update State**: It records the results of the cycle—including any actions taken, performance metrics, and the latest on-chain data—back into the database.
   * **Reschedule**: The worker schedules itself to run again after a predefined interval (e.g., every 5 minutes), creating a continuous, **self-scheduling** monitoring loop.

### How Neko Guarantees Safe Execution

The system's architecture is fundamentally designed to prevent AI hallucinations from impacting on-chain execution and user funds.

* **Predefined Strategies**: Workers only execute strategies that are **pre-approved**, audited, and stored in the database. They do not devise their own actions at runtime.
* **No LLM in the Execution Path**: The core worker loop—from fetching data to executing an action—is pure, deterministic code. It evaluates structured data against fixed rules without any calls to a large language model.
* **Abstracted On-Chain Actions**: Workers are sandboxed from direct on-chain interaction. They issue high-level commands to the Execution Layer API, which translates them into specific, secure transactions. This removes any risk of a worker calling an incorrect contract function.


# Social Agent (FUTURE)

The Neko Social Agent is the primary interface between users and the Neko ecosystem on social platforms like **X (formerly Twitter)**, **Discord**, and **Telegram**. It functions as both an interactive touchpoint and an intelligent engine for information gathering, analysis, and dissemination.

This leverages the **Eliza agent framework** and the X API with its enhanced **Actions V2 architecture**, allowing modular actions, robust error handling, sophisticated LLM integration, and efficient memory management for advanced, dynamic independent posts & responses.

<figure><img src="/files/Y4Ne7bpF6qHFjxX3N7aA" alt=""><figcaption></figcaption></figure>

## Key functions (focused on X / Twitter interaction and analysis)

### Market Intelligence & Content Generation (“AIXBT for Hyperliquid”)

* Objective: Monitor the Hyperliquid ecosystem and broader market, identify key trends and topics, and generate insightful, engaging content.
* Process (Actions V2 Data Flow):

1. **Data Collection**

   Utilizes specific actions like `hyperliquidSearchAction` (searching keywords) and `hyperliquidUsersAction` (monitoring \~27 key influencers) to fetch relevant tweets via the Twitter API. Can also leverage data fetched by other specialized actions (e.g., `dune_apiAction`, `hypurrscanAction`) via memory.
2. **Data Processing**

   Filters and sorts collected data based on engagement metrics (likes, retweets, replies).
3. **LLM Analysis**

   Sends processed data to a Large Language Model (LLM) to identify emerging topics, sentiment, and significant trends within the Hyperliquid ecosystem.
4. **Multi-Source Synthesis** (`autoAction`)

   Can intelligently merge context from various data sources (e.g., Twitter sentiment, Dune metrics, Hypurrscan activity) retrieved from memory to create a comprehensive analysis.
5. **Tweet Composition**

   Uses a Template System (`templates.ts`) to structure prompts, incorporating the LLM analysis, data placeholders, agent personality/voice guidelines, and platform constraints. The LLM then generates the final tweet text.
6. **Posting/Logging**

   Posts the composed tweet to X or logs it if `TWITTER_DRY_RUN` mode is enabled.

### User Engagement & Onboarding (Ad Network / Interaction Point)

* Objective: Facilitate seamless user interaction, drive platform engagement, and simplify the onboarding process onto the Neko application.
* Process:
  * Enables direct user commands via platform mentions (e.g., `@neko_hl gneko` on X triggers a tweet linking to the `neko.fun` application).
  * Plans for future implementation of an interactive iFrame X modal, potentially serving as an innovative ad format or mini-game to drive user acquisition.

## Data & Intelligence Sources

* **Twitter API:** Accessed via specific actions (`hyperliquidSearchAction`, `hyperliquidUsersAction`) for tweet content and engagement data.
* **Dune API:** Accessed via `dune_apiAction` for on-chain metrics (TVL, volume, etc.).
* **Hypurrscan API:** Accessed via `hypurrscanAction` for detailed transaction data and blockchain metrics.
* **Elfa API:** Potentially used for supplementary real-time sentiment analysis (confirm if still primary or augmented by internal LLM analysis).
* **Internal Memory Store:** Used by `autoAction` to retrieve and merge context from different data-fetching actions.
* **User Interactions:** Direct commands and mentions serve as explicit triggers.

## Underlying Technology

* **Eliza Agent Framework:** The core agent structure.
* **`plugin-twitter` & Actions V2:** Provides modular, robust Twitter interaction capabilities.
* **Large Language Models (LLMs):** Used for topic analysis, sentiment detection, and tweet composition.
* **Template System (`templates.ts`):** Ensures consistent voice, formatting, and data integration in generated content.
* **`AutoClient` (`packages/client-auto`):** Manages scheduled execution of actions (like `autoAction`) for automated posting.
* **Configuration System:** Managed via `.env`, character JSON files, and runtime secrets (including `TWITTER_DRY_RUN` control).

## Outcome

Leveraging a sophisticated architecture (Actions V2) and multiple data sources, the Neko Social Agent transcends simple interaction. It provides automated market intelligence, generates context-rich content by correlating on-chain data with social sentiment, and offers seamless onboarding pathways—functioning partly as an ad network and interaction point—to establish a dynamic and informative presence within the Hyperliquid community directly on social platforms.


# Earn Architecture

### Architecture of Neko’s Earn Feature

Neko’s **Earn** feature embodies the principle of **ambient finance**, allowing users to generate yield on their assets effortlessly. By depositing into Neko’s AI-managed strategies through our Manager Wallet API, users delegate the complexities of DeFi execution to sophisticated AI agents while maintaining full cryptographic control through EIP-712 signatures.

### The User Experience: Deposit and Grow

For the user, interacting with Neko Earn is designed for simplicity:

1. **Deposit**

   Choose a strategy (e.g., LHYPE Yield, Stablecoin Arbitrage) and deposit your assets into your dedicated server-managed wallet.
2. **Monitor**

   Track your strategy wallet balance in real-time via blockchain queries as Neko’s agents coordinate DeFi interactions through your authorized signatures.
3. **Auto-Compounding**

   Yield generated is automatically reinvested within your strategy wallet through EIP-712 authorized transactions, maximizing returns while maintaining your cryptographic control.

***

### The AI Management Process: Behind the Scenes

Each Neko strategy is actively managed by a dedicated

**DeFAI Multiagent System**

operating through isolated, server-managed wallets with user-controlled authorization. When triggered by events like a user deposit, a scheduled rebalance, or significant market shifts, these agents execute a sophisticated, data-driven workflow:

1. **Trigger & Initial Context**

   The process starts with events like user deposits to a specific strategy, each isolated by strategyId and requiring user signature authorization.
2. **Security Check (Pre-Interaction)**

   Before planning any on-chain interactions, the agent **calls the Hypernative API**. This crucial step verifies that the whitelisted smart contracts intended for interaction within the strategy are not currently under attack or associated with malicious payloads, adding a layer of proactive security.
3. Intelligence Gathering (Context Augmentation)

   The agent gathers necessary context to inform its strategy decisions:

   1. Queries the **RAG Database** for relevant semantic information, historical context, or similar past scenarios.
   2. Accesses the **CAG Database** for heuristics, learned best practices, and relevant agent transaction history specific to each strategy’s isolated wallet environment.
   3. Retrieves real-time **Market & Prediction Data** from the Time-Series Database.
4. Strategy Planning & Refinement (Multi-Agent Workflow)

   With security verified and context gathered, the core multi-agent workflow begins:

   1. **Planner Agent:** Drafts an initial action plan based on the trigger, current strategy wallet state, market context, and strategy-specific objectives, all requiring one user’s EIP-712 signature authorization.
   2. **Replanner Agent:** Reviews and iterates on the plan, optimizing for risk/reward and ensuring alignment with the strategy’s constraints.
   3. **Executor Agent:** Identifies the specific “tools” needed – contract calls (Worker Agents, Lifi API, Cadence Mechanism API, Subgraph APIs, etc.), API interactions, etc.
   4. **Action-Planner Agent:** Performs the final validation and constructs the precise sequence of on-chain transactions required for execution.
5. Secure Execution via Manager Wallet API
   1. The agent executes the finalized plan by requesting one EIP-712 signature from you, then uses your dedicated strategy wallet (managed via Privy) to interact with DeFi protocols. **This ensures you maintain cryptographic control - no transaction can occur without your explicit signature approval**.

***

### Underlying Technology: Neko Vault Architecture

Neko leverages a strategy-based wallet management system:

* **Single Server-Managed Wallet:** Each user gets one dedicated wallet that handles all their DeFi strategies.
* **Strategy-Based Isolation:** Database-level separation ensures complete independence between your different strategy activities.
* **One-Signature Control:** Every transaction requires just one EIP-712 signature from you.
* **Server Execution:** After your signature, the server handles the complex DeFi interactions.

### Outcome

Neko Earn strategies, powered by the DeFi Multiagent System operating through secure Manager Wallet API architecture with cryptographic user control, deliver a truly automated and intelligent yield generation experience. By continuously monitoring conditions, leveraging diverse data sources, performing security checks, and executing optimized actions within predefined boundaries, Neko aims to provide risk-mitigated, auto-compounding returns, bringing the benefits of ambient finance directly to the user.


# Neko Vault

## Neko Vault Architecture

### Overview

A Neko Vault is an ERC4626-compliant smart contract that serves as the primary user interface for Neko's automated yield strategies. Users deposit a single asset (e.g., ETH, USDC) into a Vault and receive vault shares representing their portion of the underlying assets.

The vault's core function is to delegate the management of its assets to Neko’s DeFAI Multiagent System. This system actively deploys, monitors, and rebalances capital across a variety of DeFi protocols to generate yield on behalf of depositors. The architecture is a hybrid on-chain and off-chain system designed for security, efficiency, and the ability to execute complex, AI-driven strategies.

### Core Components

The Neko architecture is composed of distinct on-chain and off-chain systems that work in concert. The on-chain contracts provide non-custodial security for user funds, while the off-chain system provides the intelligence and execution power for complex strategies.

#### On-Chain Infrastructure (The Vault and its Guards)

These smart contracts are deployed on-chain and directly hold user funds in a non-custodial manner.

<figure><img src="/files/1q2C9sm6zYOczxwj6piK" alt=""><figcaption></figcaption></figure>

1. **Vault (`VaultV2.sol`)**\
   The user-facing entry point. This standard, audited ERC4626 contract is responsible for:
   * Accepting user deposits and issuing vault shares.
   * Processing user withdrawals by redeeming shares for assets.
   * Interacting with a single, paired **Adapter** to manage its assets.
2. **Adapter (`UniversalAdapterEscrow.sol`)**\
   The on-chain hub for all strategy execution and asset management. Each Vault is paired with its own unique **Adapter**, which acts as a non-custodial escrow contract. Its responsibilities include:
   * Holding all assets allocated from the **Vault**.
   * Executing multi-step DeFi strategies via a strict whitelist of approved function calls.
   * Interacting with the **Valuer** to report the total value of its holdings.
3. **Valuer (`UniversalValuerOffchain.sol`)**\
   An on-chain contract that serves as the source of truth for the total value of a vault's assets. It does not perform calculations itself but instead receives cryptographically signed price updates from an off-chain **Keeper Bot**. This design allows Neko to support complex assets (like Pendle PTs or concentrated liquidity LP positions) that are difficult to value accurately in real-time on-chain.

{% hint style="info" %}
The **Adapter** smart contract will only execute calls to a pre-approved list of contracts and functions, preventing any interaction with unintended protocols.
{% endhint %}

#### Off-Chain Intelligence (The DeFAI Worker System)

This is the off-chain "brain" that drives strategy. It is composed of several specialized components that analyze, decide, and execute actions without ever taking custody of funds.

1. **DeFAI Multiagent System (The Strategist)**\
   The high-level analytical engine. A swarm of AI models analyzes vast amounts of historical and real-time market data to select the optimal, pre-approved strategy for a given vault. It identifies opportunities but does not execute transactions.
2. **Neko Worker (The Executor)**\
   A deterministic, event-driven task processor that automatically manages a vault's on-chain position. Each vault is managed by a dedicated, autonomous **Neko Worker** (1 vault = 1 worker). The worker's sole job is to execute a predefined strategy playbook with precision and reliability.
3. **State Management Database (The Memory)**\
   A comprehensive database that stores the complete state of each vault's position, including its assigned strategy, performance metrics, and on-chain status. This persistence ensures that if a worker restarts, it can resume exactly where it left off.
4. **Execution Layer (The Secure Gateway)**\
   A secure, external API service that acts as the final gateway for on-chain execution. Workers do not build or sign transactions directly. Instead, they send high-level commands (e.g., "rebalance," "compound") to the Execution Layer, which is responsible for the final, complex step of building, signing, and broadcasting the on-chain transaction to the **Adapter**.

### How It Works: The Strategy Execution Lifecycle

1. **Deposit & Allocation**: A user deposits assets into the **Vault**. The **Vault** then transfers these assets to its paired **Adapter**, where they are held in non-custodial escrow, ready for deployment.
2. **Strategy Selection**: The **DeFAI Multiagent System** analyzes market conditions and assigns a predefined strategy from the **State Management Database** to the vault's dedicated **Neko Worker**.
3. **Deterministic Execution Loop**: The **Neko Worker** begins its continuous management loop:\
   a. It fetches the latest on-chain data for its assigned position (e.g., current price, uncollected fees).\
   b. It evaluates this data against the strict, predefined rules of its assigned strategy.\
   c. If an action is required, the worker sends a precise, high-level command (e.g., rebalance) to the secure **Execution Layer**.\
   d. The **Execution Layer** translates this command into a specific, whitelisted multicall transaction and broadcasts it to the **Adapter** contract.\
   e. The on-chain **Adapter** executes the transaction, interacting with external DeFi protocols on behalf of the user.\
   f. The worker updates the **State Management Database** with the results and reschedules itself to run again.
4. **Position Valuation**: In parallel, an off-chain **Keeper Bot** continuously calculates the real-time net value of the **Adapter's** position and submits signed updates to the on-chain **Valuer** contract, ensuring the vault's share price is always accurate.

<figure><img src="/files/voCfPjrt96dD2dn02zVs" alt=""><figcaption></figcaption></figure>


# AI/ML architecture

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a href="/pages/UYLgt2iyTPYp4KzYgfIw">Cadence Mechanism</a></td></tr><tr><td><a href="/pages/3NLwICILAt2khkLq867G">Retrieval-Augmented Generation (RAG)</a></td></tr><tr><td><a href="/pages/SPpANrYU4GK4W2WL7R3o">Cache-Augmented Generation (CAG)</a></td></tr></tbody></table>


# Cadence Mechanism

### What It Is

**Cadence** is a high-performance, Rust-based monitoring and alerting system designed for real-time DeFi protocol analysis. Its core function is to detect market anomalies, volatility spikes, and other critical events, and to proactively notify the Neko DeFAI Multiagent System.

It is **not** a passive data pipeline. Instead of providing raw market data, Cadence performs its own sophisticated analysis and sends structured, high-signal alerts only when specific, actionable conditions are met.

#### Your Benefit

Cadence acts as the nervous system for the Neko agent swarm. It handles the intensive, millisecond-grade task of monitoring market conditions, allowing the DeFAI Multiagent System to focus on high-level strategy, planning, and execution. This separation of concerns ensures the agent remains efficient and can react instantly to critical events without the overhead of constant market scanning.

{% hint style="info" %}
This monitoring/alerting system will be helpful and able to detect  and alert the multi-agent system for mass liquidation & cascading liquidation events (which can trigger ADL) both on HyperEVM and HyperCore.&#x20;
{% endhint %}

#### System Architecture

The integration between Cadence and the Neko agent is event-driven and uses a **push-based webhook model**, not polling or WebSockets. This ensures minimal latency from detection to action.

**Alert Workflow:**

1. **Continuous Monitoring**: The standalone **Cadence** system continuously ingests and analyzes real-time data from HyperEVM protocols (AMMs, lending venues) and the Hyperliquid order book. It uses specialized services like `Volatility Monitor`, `Anomaly Detector`, and `Health Score Monitor` to score market conditions.
2. **Anomaly Detection**: When a predefined condition is met (e.g., volatility spikes beyond a threshold, a pool's health score drops), Cadence generates a structured **`Alert` object**. This object contains the severity, alert type, and a snapshot of relevant `pool_metrics` at the moment of detection.
3. **Webhook Notification**: Cadence immediately sends the `Alert` object via an HTTP `POST` request to a dedicated endpoint on the agent's API server: `POST /webhook/cadence/alert`
4. **Alert Reception & Triage**: The agent's `handle_cadence_alert` function receives the alert and checks its `severity`.
   * **Non-Critical Alerts** (`Warning`, `Info`): The alert is logged for auditing and an acknowledgment is sent back to Cadence. No automated action is taken.
   * **Critical Alerts** (`Critical`): The agent immediately escalates the alert for processing by the DeFAI Multiagent System.
5. **Prompt Formatting**: For a critical alert, the agent transforms the structured JSON data into a natural language prompt, prefixed with **"URGENT ALERT from Cadence monitoring system"**. This prompt includes all the `pool_metrics` provided by Cadence, which the agent trusts as the real-time state of the market.

   *Example Formatted Query:*

   ```
   URGENT ALERT from Cadence monitoring system:
   Alert Type: volatility_spike
   Severity: critical
   Pool ID: pool_0xffaa4a3d97fe9107cef8a3f48c069f577ff76cc1
   Message: Extreme volatility detected in WHYPE/USDC pool - 85% spike

   Pool Metrics:
   - Price: $1.8505
   - Volume 24h: $1,500,000.00
   - Liquidity: $5,000,000.00
   - Volatility: 85.00%
   - Health Score: 3.20

   Please analyze this alert and determine if any immediate action is needed...
   ```
6. **Defensive Workflow Execution**: This urgent prompt is passed to the `run_agent_workflow`. The system's prompts (`PLANNER_SYSTEM_PROMPT`, `REPLANNER_PROMPT`, `ACTION_PLANNER_PROMPT`) are specifically enhanced to:

   * **Prioritize** these alerts over standard tasks.
   * Shift from yield optimization to **capital preservation**.
   * Generate a streamlined, time-sensitive plan that may involve immediate liquidity removal or range adjustments.
   * Execute actions with a **higher slippage tolerance** (e.g., 1-2%) to ensure transaction success in volatile conditions.

   <figure><img src="/files/KLMP4cP9hYQFcIGAIYlF" alt=""><figcaption></figcaption></figure>


# Retrieval-Augmented Generation (RAG)

### What It Is

Retrieval-Augmented Generation (RAG) is a critical component of Neko’s AI & Machine Learning infrastructure, responsible for providing Neko agents with **real-time, dynamic context** about the Hyperliquid ecosystem and broader market conditions. This ensures agent decisions are grounded in the most current information available.Unlike Cache-Augmented Generation (CAG) which provides foundational strategic knowledge, RAG focuses on fetching **up-to-the-moment data points** relevant to an agent’s immediate task.

#### [​](https://docs.neko.fun/rag#core-function%3A-dynamic-context-retrieval)Core Function: Dynamic Context Retrieval <a href="#core-function-3a-dynamic-context-retrieval" id="core-function-3a-dynamic-context-retrieval"></a>

The primary function of the RAG system within Neko is to dynamically retrieve specific, timely data points when requested by an agent during its decision-making workflow. This allows agents to react intelligently to rapidly changing on-chain and off-chain events.

#### [​](https://docs.neko.fun/rag#data-sources-%26-content)Data Sources & Content <a href="#data-sources-26-content" id="data-sources-26-content"></a>

The RAG system ingests and makes accessible a wide array of real-time data crucial for DeFi operations, including:

* **Hyperliquid L1 Order Book Data:** Near real-time snapshots from HyperDash, such as best bid/ask, recent trades, volume, and significant depth changes.
* **HyperEVM On-Chain Metrics:** Data parsed directly from HyperEVM blocks, including:
  * Token movements (USDC inflow/outflow).
  * Protocol interactions (strategy deposits, AMM swaps).
  * Key performance indicators (TVL changes, supply/borrow rates).
  * Transaction volumes for specific applications or assets.
  * Significant event flags (large liquidations on EVM protocols).
* **Order Book Event Flags:** Detection of large liquidations or unusual activity directly on the Hyperliquid order book.
* **External Metrics:** Aggregated data from trusted sources like DeFiLlama (overall protocol TVL, fees, revenue).
* **(Future) Embedded Data:** While the primary focus is real-time metrics, the underlying system (as per PRD) might also incorporate vector embeddings from textual data (news, sentiment) for multi-modal retrieval in advanced scenarios, though rapid retrieval often prioritizes structured metrics.
* **(Future) Model Context Protocol (MCP) Integration for RAG:** Future plans involve enhancing the RAG system by adopting MCP.
  * This utilizes specialized servers for dedicated data sources (like HyperEVM application states or order book data), aiming for significant improvements in retrieval speed (via caching, parallelism), flexibility (handling diverse data types), and overall efficiency of providing dynamic context to Neko agents.

#### [​](https://docs.neko.fun/rag#mechanism%3A-low-latency-retrieval-via-redis)Mechanism: Low-Latency Retrieval via Redis <a href="#mechanism-3a-low-latency-retrieval-via-redis" id="mechanism-3a-low-latency-retrieval-via-redis"></a>

Neko’s RAG implementation prioritizes extremely fast data access to support real-time agent decisions, aiming for **sub-100ms query responses** for critical lookups.

1. **Agent Query:** When an agent (e.g., within the DeFi Multiagent System) requires current data to inform its planning or execution (e.g., “What is the current USDC borrow rate on Protocol X?”, “Any large liquidations on ETH-PERP in the last minute?”), it queries the RAG system.
2. **Redis Lookup:** The system heavily leverages **Redis** as a high-speed, in-memory caching and retrieval layer. Redis stores the latest values for frequently accessed, time-sensitive data points ingested by the backend pipeline.
3. **Data Provision:** Redis serves the requested data point(s) back to the agent with minimal latency.
4. **Context Integration:** The agent integrates this retrieved real-time data with its existing context (potentially including foundational knowledge from CAG) to make an informed decision or action.

#### [​](https://docs.neko.fun/rag#underlying-technology-%26-pipeline)Underlying Technology & Pipeline <a href="#underlying-technology-26-pipeline" id="underlying-technology-26-pipeline"></a>

While **Redis** serves as the critical component for achieving low-latency *retrieval*, it operates as part of a broader data ingestion and processing pipeline (detailed in the RAG DB design). This pipeline handles:

* Connecting to diverse data sources (HyperEVM nodes, HyperDash feeds, external APIs).
* Processing, potentially aggregating, and validating incoming data.
* Feeding the processed, real-time metrics into Redis for fast access.
* Potentially storing data in more persistent backend databases (like Graph databases as explored in the PRD) for historical analysis, complex relationship queries, or data not suited for Redis caching.

#### [​](https://docs.neko.fun/rag#synergy-with-cag)Synergy with CAG <a href="#synergy-with-cag" id="synergy-with-cag"></a>

Retrieval-Augmented Generation (RAG) and Cache-Augmented Generation (CAG) are designed to work synergistically, providing Neko agents with a complete and efficient contextual understanding:

* **RAG:** Delivers the **real-time, dynamic data** essential for reacting to current market conditions and specific events (e.g., latest prices, current TVL, recent liquidations). It answers the question “What is happening *right now*?”.
* **CAG:** Provides the **foundational strategic knowledge** and learned heuristics, efficiently loaded into the context (e.g., best practices for a strategy type, core risk parameters). It answers the question “Based on established knowledge, *how* should I approach this situation?”.

By combining the immediate, volatile data retrieved via RAG with the stable, foundational strategic context provided by CAG, Neko agents can make decisions that are both **highly responsive to the present moment** and **grounded in sound, established strategies**. This dual approach allows for intelligent actions that balance tactical adaptation with strategic consistency.

#### [​](https://docs.neko.fun/rag#outcome)Outcome <a href="#outcome" id="outcome"></a>

The RAG system, with Redis at its core for fast access, empowers Neko agents to operate with **up-to-the-second awareness** of the dynamic Hyperliquid environment. By providing timely and accurate real-time data, RAG enables more effective, contextually relevant, and potentially safer automated DeFi strategies, allowing agents to adapt quickly to market shifts, seize opportunities, and manage risk effectively.


# Cache-Augmented Generation (CAG)

### What It Is

Neko incorporates Cache-Augmented Generation (CAG) as a core component of its AI & Machine Learning infrastructure. CAG provides the **DeFi Multiagent System** with immediate access to essential, pre-loaded strategic knowledge, particularly concerning **yield optimization and risk management heuristics** relevant to the HyperEVM environment.Unlike Retrieval-Augmented Generation (RAG) which fetches dynamic data in real-time, CAG focuses on providing agents with foundational, relatively stable knowledge efficiently.

#### [​](https://docs.neko.fun/cag#purpose%3A-efficient-strategic-context-setting)Purpose: Efficient Strategic Context Setting <a href="#purpose-3a-efficient-strategic-context-setting" id="purpose-3a-efficient-strategic-context-setting"></a>

The primary goal of using CAG within Neko is to **rapidly equip agents with core strategic context** without the latency associated with real-time database lookups for *this specific type* of information. This allows agents to quickly ground their decision-making processes in established best practices and learned heuristics relevant to their assigned tasks (e.g., managing an Earn strategy).

#### [​](https://docs.neko.fun/cag#mechanism%3A-the-cag-database-kv-cache)Mechanism: The CAG Database (KV Cache) <a href="#mechanism-3a-the-cag-database-kv-cache" id="mechanism-3a-the-cag-database-kv-cache"></a>

Neko utilizes a specialized **CAG Database**, likely implemented as a pre-computed **key-value (KV) cache**. This cache contains distilled strategic information relevant to DeFi operations on HyperEVM.

* **Pre-computation:** The knowledge within the CAG DB is processed and stored beforehand.
* **Context Injection:** When an agent requires foundational strategic guidance, the relevant portions of this KV cache are efficiently loaded directly into the agent’s operational **context window**.
* **Efficiency:** This direct injection avoids the need for complex real-time vector searches or embeddings *for this cached knowledge*, making context setting faster, especially for well-defined, constrained knowledge sets.

#### [​](https://docs.neko.fun/cag#content%3A-distilled-defi-knowledge-%26-heuristics)Content: Distilled DeFi Knowledge & Heuristics <a href="#content-3a-distilled-defi-knowledge-26-heuristics" id="content-3a-distilled-defi-knowledge-26-heuristics"></a>

The information stored within Neko’s CAG DB represents **distilled knowledge and effective heuristics** derived from analyzing successful DeFi strategies and risk management principles (drawing inspiration from the vast landscape of techniques outlined in Neko’s research context). This includes:

* Core principles for managing specific strategy types.
* Effective patterns for liquidity provision or borrowing strategies on HyperEVM.
* Key risk parameters or safe operational boundaries.
* Learned heuristics from past agent performance.

This is *not* raw, real-time data but rather a condensed, readily accessible library of strategic “rules of thumb” or foundational knowledge.

#### [​](https://docs.neko.fun/cag#synergy-with-rag)Synergy with RAG <a href="#synergy-with-rag" id="synergy-with-rag"></a>

CAG and RAG work in tandem to provide agents with comprehensive context:

* **CAG:** Provides the **foundational strategic knowledge** and heuristics (the “how-to” based on learned patterns).
* **RAG:** Provides the **real-time, dynamic data** (current market prices, specific protocol states, recent events).

By feeding both the pre-loaded CAG context and the real-time RAG data into the agent’s decision-making process (e.g., the LLM core), Neko ensures that actions are both strategically sound and responsive to the immediate on-chain environment.

#### [​](https://docs.neko.fun/cag#outcome)Outcome <a href="#outcome" id="outcome"></a>

Leveraging CAG allows Neko agents to make **faster, more informed decisions** by instantly accessing a pre-loaded cache of relevant strategic heuristics. This efficiency, combined with the real-time data provided by RAG, enables the DeFAI Multiagent system to operate effectively and adaptively within the dynamic HyperEVM ecosystem, optimizing for yield and managing risk according to both established best practices and current market conditions.


# Security

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a href="/pages/ddcf7f35650c66140de44712398123fe52554ef5">Audits</a></td></tr><tr><td><a href="/pages/d996231d38de845afe68814ef7f2be53aec4bed8">Hypernative</a></td></tr></tbody></table>


# Audits

## Morpho Vault V2

The Neko Vault architecture is 1:1 from Morpho's throughly reviewed Vault V2 and Vault V2 Factory contracts.&#x20;

| Date       | Auditor                                         | Report                                                                                                       |
| ---------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| 2025-09-15 | [ChainSecurity](https://www.chainsecurity.com/) | [chainsecurity-report](https://github.com/morpho-org/vault-v2/blob/main/audits/2025-09-15-chainsecurity.pdf) |
| 2025-09-15 | [Blackthorn](https://www.blackthorn.xyz/)       | [blackthorn-report](https://github.com/morpho-org/vault-v2/blob/main/audits/2025-09-15-blackthorn.pdf)       |
| 2025-07-15 | [Zellic](https://www.zellic.io/)                | [zellic-report](https://github.com/morpho-org/vault-v2/blob/main/audits/2025-07-15-zellic.pdf)               |

***

## Universal Adapter

This is custom logic built out that interfaces with Morpho Vault V2, so the owner can whitelist new protocols to interface with; without needing to upgrade smart contracts or migrate liquidity to a new vault.&#x20;

{% hint style="info" %}
This is how our strategies will be able to evolve in real-time, in a non-custodial fashion
{% endhint %}

| Date       | Auditor                                         | Report (PDF)                                                                                                                                                                                                                                             |
| ---------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2025-10-10 | [Octane Security](https://www.octane.security/) | [octane-report-draft](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy6KZK4gpJ1V4VuGXtQO5%2Fuploads%2Ft8DKAqaxPA03NmVL6P87%2Fomo_draft_report.pdf?alt=media\&token=8bcecabd-f41c-405b-9acb-1d81ffe2fbf5)                           |
| 2025-09-30 | [SBSecurity](https://www.sbsecurity.net/)       | [sbsecurity-report](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy6KZK4gpJ1V4VuGXtQO5%2Fuploads%2FTxCNx6UYxK0wJCPXgzWG%2FNeko.hl%20Security%20Review%20-%20SBSecurity.pdf?alt=media\&token=eed502ea-cffb-49ac-8206-4d5ee92ca431) |


# Hypernative

We will be leveraging Hypernative for real-time security to ensure the Neko Vaults are not getting attacked themselves.  As well as detecting any malicious payloads attacking third party protocols that have users fund being actively deployed into via the Neko Vaults.&#x20;


# Brand Kit

{% file src="/files/uET3CYmBMf8VsdCjmQmB" %}


