> For the complete documentation index, see [llms.txt](https://wiki.orbofi.com/learn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.orbofi.com/learn/tokenization-liquidity-and-onchain-systems/liquidity-layer.md).

# Liquidity Layer

### Uniswap V4, from block one

Every agent trades in a single Uniswap V4 pool. There is **no bonding curve** and no threshold to cross — the V4 pool is the only venue and it exists from the launch transaction onward. (A gated migration path exists on the initializer but has never been used; see the [FAQ](/learn/tokenization-liquidity-and-onchain-systems/faq.md).)

The launch supply is placed as **locked liquidity**. The creator cannot withdraw it.

### The pool key

The same shape on every Orbofi agent launched so far — only the currencies differ:

```ts
const poolKey = {
  currency0,                 // lower address of (agent, numeraire)
  currency1,                 // higher address
  fee: 8388608,              // 0x800000 — V4 dynamic-fee sentinel
  tickSpacing: 200,
  hooks: "0x4e3468951D49f2EEa976eD0D6e75fFCb44a9a544",
};
```

{% hint style="warning" %}
**Read these from the `Initialize` event rather than hardcoding them.** `hooks`, `fee` and `tickSpacing` are launch parameters validated against an allowlist and a set of floors (`minPoolFee`, `minStartFee`, `minFeeDecayDuration` on the factory), not protocol constants. They are uniform today because one initializer is allowlisted; a second one would make a hardcoded `hooks` revert every quote for those agents — and the failure looks like a currency-ordering bug, which is where you would waste the afternoon. You are already indexing `Initialize`; take all three from it.
{% endhint %}

Currencies are **address-sorted**, so the agent is `currency0` for some pools and `currency1` for others. Derive it:

```ts
const tokenIsCurrency0 = agentToken.toLowerCase() < numeraire.toLowerCase();
```

Both cases occur in production. An ETH-paired agent is almost always `currency1`; a stock-paired one is split roughly evenly between the two — so derive it, never assume.

### Dynamic fee, and the anti-snipe window

The pool registers the V4 dynamic-fee flag, so the swap fee is **not constant**. It follows a decaying schedule set at launch:

|             |                                                                                                  |
| ----------- | ------------------------------------------------------------------------------------------------ |
| Opening fee | **80%** (`800000`, units of 1e6)                                                                 |
| Decay       | linear, over **10 seconds**                                                                      |
| Settles at  | the pool's standing rate — see [Fees](/learn/tokenization-liquidity-and-onchain-systems/fees.md) |
| Starts at   | pool initialization                                                                              |

The 80% opening fee exists to make first-block sniping unprofitable. It decays to the standing rate within ten seconds of the pool opening, so it is invisible to ordinary trading — but a quote taken in the first few seconds of a launch will correctly show a punitive rate.

### Reading the fee back

The two legs are charged by two different mechanisms, and only one of them is visible to Uniswap's accounting:

| Source                   | What it reports                     |
| ------------------------ | ----------------------------------- |
| `Swap` event `fee` field | **LP leg only** — `1000`, i.e. 0.1% |
| `quoteExactInputSingle`  | The real cost, net of both legs     |

The hook leg is taken through hook deltas rather than the pool's own fee, so it never appears in `Swap.fee`. An integration that displays that field as the trading cost understates it by roughly 16x. Confirmed by decoding a live swap: `fee = 1000`, against a pool whose standing rate is more than an order of magnitude higher.

{% hint style="warning" %}
**Always quote; never hardcode the fee.** Use `quoteExactInputSingle` on the V4 Quoter. Any hardcoded rate is wrong during the anti-snipe window, and would misprice the first ten seconds of every launch.
{% endhint %}

### Price

Take `sqrtPriceX96` from the pool's `Initialize` event and keep it current from each `Swap`:

$$P = \left(\frac{\text{sqrtPriceX96}}{2^{96}}\right)^2$$

`P` is **currency1 per currency0** in raw units. Orient it to the agent, then convert through the numeraire's USD feed. Worked example in [Inspect an agent token](/learn/tokenization-liquidity-and-onchain-systems/integrations/inspect-an-agent-token.md).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wiki.orbofi.com/learn/tokenization-liquidity-and-onchain-systems/liquidity-layer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
