> For the complete documentation index, see [llms.txt](https://sparklexai.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sparklexai.gitbook.io/docs/core-concepts/ai-engine.md).

# AI Engine

**The AI engine is SparkleX's strategic core. It runs off-chain, always on, watching activity across major chains and protocols. Its job is to spot yield, judge risk, and recommend the next move before the opportunity fades.**

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

\
\
It performs three key functions:<br>

1. **Real-Time Monitoring.** Thousands of live signals flow in — lending and staking rates, gas levels, volatility, liquidity depth, incentive calendars, LTV headroom, oracle health. The feed updates block by block.

2. **Predictive Modeling.** The engine doesn’t wait to react. It simulates what happens if we tighten an LP range, add a leverage loop, rotate stake, or stand still. Each scenario is scored for expected return after risk and gas.<br>

3. **Strategy Planning.** Once a strategy is selected, the engine turns it into a simple, signed plan—for example: "*Move the ETH-USDC liquidity band to $3,000–$3,200 and harvest rewards."* It never touches funds. It passes the plan to your AI Copilot, which talks to your vault.

\
Because strategy lives off-chain, SparkleX can keep improving models without asking you to move capital or accept new contracts. Intelligence evolves; custody does not.


---

# 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://sparklexai.gitbook.io/docs/core-concepts/ai-engine.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.
