# Overview

## **Thetanuts V4 · OptionBook Integration Guide**

> ⚠️ **Important:** All examples are for reference and **audit has not been completed yet**. **Review, test, and verify** before production. Thetanuts is not responsible for issues arising from this code.

### What is OptionBook?

OptionBook is a **decentralized options order book on Base**. Makers quote off-chain; takers fill on-chain.

**Flow**

1. **Makers** create signed orders (spreads, butterflies, condors).
2. **Orders** are aggregated and published via API.
3. **Takers** (your users) call `fillOrder()` on the OptionBook contract.
4. **Options** are deployed as new contracts with collateral locked.
5. **Settlement** is processed daily by Thetanuts.

**Builder Key:** The `referrer` parameter in `fillOrder()` tags positions created via **your** platform—use it to display only “your” positions and track referral fees.

### What you’ll build

* Fetch orders from API (dev/test) or your own indexer (prod).
* Execute USDC-collateral trades with `fillOrder()`.
* Calculate payouts.
* Fetch/filter user positions by **your referrer**.

*This guide uses **USDC** for clarity. OptionBook supports other tokens (WETH and CBBTC).*
