> For the complete documentation index, see [llms.txt](https://docs.northstar.sonicsvm.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.northstar.sonicsvm.org/concepts/programmable-fees.md).

# Programmable Fees

A NorthStar session opens with a `FeeStructure` parameter that decides three things: which token pays for activity inside the session, how much each instruction costs, and what share of that revenue flows to the operator versus the protocol.

That's the whole concept. The default is gasless on devnet (`zero_fee_structure()`); production grids set their own.

## The three knobs

| Knob              | What it controls                                                                              |
| ----------------- | --------------------------------------------------------------------------------------------- |
| **Fee token**     | Any SPL mint — SOL, USDC, an operator's own token, or none.                                   |
| **Fee schedule**  | Per-instruction lamports / token units. Can be uniform, per-instruction, or identically zero. |
| **Revenue split** | Basis points of fee revenue that flow to the session operator (vs. the protocol).             |

Operators commit to the structure at `OpenSession` time; it can't change mid-session. Closing and reopening with a new structure is the supported path.

## Why per-session economics

A persistent L1 imposes one fee market on every workload. A per-session market localises the externality:

* A market-data feed publishing 10 quotes per second can charge sub-millicent per quote in its own token.
* A privacy-grade RFQ venue can charge premium fees for sealed-bid execution.
* An agent sandbox can run gasless to remove user-side friction.

None of these economics are achievable on a shared L1.

## Operators capture revenue

The same primitive that lets an operator set the fee schedule lets a wallet, aggregator, or super-app open grids on behalf of users and capture a share of every transaction in those grids. New revenue stream for incumbent integrators; no validator infrastructure required.

## See also

* [Programmable Economics](https://github.com/mirrorworld-universe/northstar-docs/blob/main/content/build/fees.md) — full surface area, code examples, and the production rollout plan.
* [Sessions](/concepts/sessions.md) — the lifecycle this fee structure attaches to.
* [Settle-back guarantees](/concepts/settle-back.md) — how fee-vault balances reconcile to L1 on close.


---

# 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://docs.northstar.sonicsvm.org/concepts/programmable-fees.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.
