> For the complete documentation index, see [llms.txt](https://intracloud.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://intracloud.gitbook.io/docs/readme.md).

# README

<div align="center"><img src="https://693163810-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2wSXEnAOn6Dj9kTrK1Z8%2Fuploads%2Fgit-blob-4f77eace37b4bb55ef256066fa8af62530a773e3%2Fdocs.png?alt=media" alt="IntraCloud" width="100%"></div>

<h2 align="center">IntraCloud</h2>

<p align="center"><strong>Autonomous Prediction Markets Powered by On-Chain Intelligence</strong></p>

<p align="center"><a href="https://intracloud.tech">Platform</a> · <a href="https://intracloud.gitbook.io">Documentation</a> · <a href="#repositories">Repositories</a> · <a href="#architecture">Architecture</a></p>

***

### Overview

IntraCloud is a vertically integrated prediction market protocol that couples a Llama-3.1 autonomous agent with Uniswap v3/v4 liquidity intelligence and TWAP-resolved on-chain settlement. The system continuously monitors Uniswap pool dynamics—liquidity depth, oracle quality, TWAP drift, swap frequency, and manipulation resistance—to autonomously select the highest-signal trading pair, formulate a directional price thesis, and deploy a time-bounded prediction round to an immutable smart contract.

Users interact through a real-time web interface: observe the agent's reasoning, place binary positions, and claim payouts—all settled trustlessly via Uniswap v3 TWAP oracles with no off-chain price feeds or external dependencies.

### Repositories

| Repository                                                                       | Description                                                                                                       |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| [`intracloud-agent`](https://github.com/farbodghasemlu/intracloud-agent)         | Cloudflare Worker + Llama-3.1 autonomous agent — pool discovery, multi-source scoring, round lifecycle management |
| [`intracloud-contracts`](https://github.com/farbodghasemlu/intracloud-contracts) | Solidity prediction market — Uniswap v3 TWAP resolution, pull-based claims, operator access model                 |
| [`intracloud-webapp`](https://github.com/farbodghasemlu/intracloud-webapp)       | Next.js trading interface — real-time pricing, position management, wallet integration                            |
| **this repo**                                                                    | Protocol documentation — architecture guides, contract reference, platform FAQ                                    |

### Architecture

```
┌─────────────────────────────────────────────────────────────────┐
│                        IntraCloud Platform                      │
├──────────────┬──────────────┬──────────────┬────────────────────┤
│   Agent      │  Contracts   │   Web App    │   Documentation    │
│  (Cloudflare │  (Foundry /  │  (Next.js /  │   (GitBook /       │
│   Workers +  │  Solidity)   │  wagmi /     │    Markdown)       │
│   Llama-3.1) │              │  viem)       │                    │
├──────────────┴──────────────┴──────────────┴────────────────────┤
│              Uniswap v3/v4 · Sepolia · TWAP Oracles             │
└─────────────────────────────────────────────────────────────────┘
```

### Uniswap Integration Depth

IntraCloud leverages five distinct layers of the Uniswap ecosystem:

* **Uniswap v3 SDK** — Tick-to-price conversion, drift computation, and pool math primitives
* **Uniswap v4 SDK** — Pool ID validation for next-generation routing verification
* **Uniswap Trade API** — Quote routing across v3/v4 liquidity with price impact diagnostics
* **Uniswap v3 Subgraph** — Candidate pool discovery and historical volume/TVL signals
* **Uniswap v3 TWAP Oracles** — On-chain price resolution for prediction settlement (no external oracles)

### Protocol Flow

1. **Discovery** — Agent indexes `PoolCreated` events from Uniswap v3 Factory and cross-references subgraph candidates
2. **Scoring** — Multi-factor analysis: TWAP stability, oracle cardinality, liquidity depth, manipulation resistance, Trade API quote confidence
3. **Selection** — Highest-scoring pool is selected; agent generates directional prediction with calibrated duration (5–15 min)
4. **Settlement** — Smart contract fetches TWAP at round start, resolves against TWAP at expiry, distributes payouts proportionally
5. **Iteration** — Agent stores analysis summary, resolves completed rounds, and begins next cycle

### Documentation Structure

This repository is the source for [intracloud.gitbook.io](https://intracloud.gitbook.io), hosted on GitBook with Git-synced Markdown.

```
agent/
└── prediction-agent.md      — Agent architecture, scoring model, round lifecycle
contracts/
└── prediction-market.md     — Contract ABI reference, event schema, integration patterns
platform/
├── overview.md              — Platform introduction and core concepts
├── guides/                  — Step-by-step user and integration guides
├── faq.md                   — Frequently asked questions
├── changelog.md             — Release history and protocol updates
└── support.md               — Support channels and escalation
```

### License

MIT
