> For the complete documentation index, see [llms.txt](https://docs.orriss.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.orriss.xyz/research.md). Agents can also search and read this documentation through its [MCP server](https://docs.orriss.xyz/~gitbook/mcp).

# Execution-cost study

Recorded Orca swaps, a matched-inventory control and the limits of an oracle-relative execution model.

How much does the placement of liquidity change the price a trader receives? The Orriss working paper compared one recorded Orca SOL/USDC Whirlpool with two books that put the same inventory within 2% of the spot price. At a $100,000 input, both concentrated books produced nearly identical quotes. Across the much smaller trades in the historical sample, the relative book reduced modeled costs by $44.36 in total.

## A $100,000 trade in each direction

On 16 November 2026 at 19:59:06 UTC, the team captured the Whirlpool, both vaults and nine tick arrays at finalized Solana slot `470257547`. The spot price was 71.426195744 USDC per SOL. The vaults held 202,043.517350395 SOL and 2,426,642.859505 USDC. Valuing SOL at the recorded spot and USDC at $1 puts 85.61% of the gross inventory value on the SOL side.

<figure><img src="https://2901705416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwgb6N4AUimhmgBryw2j4%2Fuploads%2FG8rWWklWEAsar0AJdTyv%2Fresearch-cost.png?alt=media" alt="At $100,000 input, modeled and centered books have similar costs. Buys cost about 4.7 basis points and sells about 8.1, versus about 13.6 in either direction for the recorded Orca state."><figcaption><p>At a $100,000 input, buy and sell costs are 13.565 and 13.554 bps for the recorded Orca state, 4.691 and 8.115 for the relative book, and 4.682 and 8.137 for the centered V3 control.</p></figcaption></figure>

The Orca SDK supplied exact-input quotes against the recorded accounts. The relative book distributed SOL uniformly above spot and USDC uniformly below it. A second model placed the same two reserves in concentrated-liquidity positions immediately above and below spot. All three calculations included a 4 bp fee or directional markup. A basis point is 0.01% of input value, or $10 on this order.

Buying SOL from the relative book cost $88.75 less than buying from the recorded Whirlpool state. Selling the same dollar value of SOL saved $54.39 in the model. The deeper SOL inventory supported more buy-side output. The centered V3 control came within 0.023 bps of the relative book in both directions, which attributes most of the difference in this snapshot to where capital was placed.

## What the recorded swaps show

The collection window ran from 15 November 2026 at 19:55:48 UTC through the same time on 16 November. The team took the latest 300 successful transactions referencing the Whirlpool in each of 24 hourly windows. Their combined elapsed coverage was 2,294 seconds (38 minutes and 14 seconds). Across 7,200 unique transactions, 1,836 swaps matched the target pool and reconciled exactly to changes in its two vault balances.

| Measure                                                 |                                    Result |
| ------------------------------------------------------- | ----------------------------------------: |
| Observed input notional                                 |                             $1,497,794.96 |
| Median trade / 90th percentile                          |                       $268.65 / $2,366.95 |
| Observed execution cost                                 |                                   $654.89 |
| Modeled relative-book execution cost on the same inputs |                                   $610.53 |
| Difference                                              | $44.36, or 0.296 bps of observed notional |

For an input amount q and pre-trade price P in USDC per SOL, the reference output o₀ is q/P when buying SOL and q × P when selling SOL. If the trader receives o, the execution cost in basis points is

**Cost (bps) = 10,000 × (1 − o / o₀).**

This measure includes the trading charge and the effect of order size on the fill price. Network charges are excluded. Each modeled historical order started with replenished depth and used that swap’s pre-trade Whirlpool price as a fresh reference. The sampling method and inventory reset limit the conclusion to these inputs. A full day’s realized savings or an LP’s net return would require continuous inventory and price histories, routing information and operating costs.

## Applying the study to the SOL/USDC pool

The research model assigned **200 bins per side** over a **±2% range**. Each bin spanned one basis point. Prices varied continuously inside each bin, with a **4 bp directional markup**. The Orriss SOL/USDC program uses **10 bins per side** over **±10%**, fills at the midpoint of each 1% bin, and charges **20 bps of input**. To estimate an executable swap, use the pool’s current reference, reserves, active bin and fee. The research figures describe the parameter set in the paper.

## Reproduce the results

Open the PDF’s attachments, extract `Orriss_SOL_USDC_Replication.zip`, and run `python3 reproduce.py` from the extracted directory using Python 3.10 or later. The script checks event and vault deltas and writes `reproduced/results.json` and `reproduced/decoded-swaps.csv`. Appendix C gives the hourly sampling ledger and the optional Orca SDK quote reconstruction.

The paper gives the snapshot comparison on page 8, the sampled swaps on page 9 and the study limitations on page 12. [Read the Orriss working paper, version 1.0 (PDF)](https://2901705416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwgb6N4AUimhmgBryw2j4%2Fuploads%2FLleZGsi6S6LurnAX56tO%2FOrriss_Oracle_Relative_Liquidity_Research.pdf?alt=media)


---

# 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://docs.orriss.xyz/research.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.
