Fees and costs
Writes can cost money. This page is about showing those costs in your UI.
Today’s documented ledger is Infinite Mainnet (EVM). Cost kinds such as bridge and multi-ledger gas lines are contract shapes for when a quote path spans ledgers — they may be absent on single-ledger Infinite Mainnet quotes.
Two different things
| Question | Answer |
|---|---|
| Do writes cost something? | Yes — network gas and Nutrimatic’s service fee apply on writes. Swaps can also include market / bridge costs. |
| Does the SDK give you a cost list before you execute? | Only for swaps. Call routing.quote; the quote includes a costs array you can show on screen. |
routing.quote is the method that asks for a swap quote (amounts, slippage, expiry). That quote’s costs field is the breakdown for your “you will pay…” UI.
For liquidity, approve, stake, and farm, those writes can still charge gas and the service fee when they run, but the SDK does not return a costs list beforehand. Your UI can confirm the action and follow status; it does not get a swap-style cost breakdown for those calls.
Cost lines on a swap quote
Each entry in Quote.costs has kind, amount, instrumentId, and sometimes estimated.
| Field | Type | Description |
|---|---|---|
kind | QuoteCostKind | What this line is — see kinds below. |
amount | string | Display decimal in that instrument’s units (same style as other write amounts). |
instrumentId | InstrumentId | Asset this line is denominated in. Resolve the symbol via the catalog if your UI needs a ticker. |
estimated | boolean | Optional. When true, treat amount as approximate until the write confirms on-chain. Common for gas; sometimes for bridge. |
kind | What it is | Paid in |
|---|---|---|
gas | Network execution cost | Ledger native |
trade | Market / swap fee for the route | That line’s instrumentId (often a trade asset) |
bridge | Extra cost when the plan moves value across ledgers | That line’s instrumentId |
service | Fixed Nutrimatic fee for the write | Ledger native |
Example — Quote.costs on a swap
[
{
"kind": "trade",
"amount": "0.0045",
"instrumentId": "evm:421018:instrument:42"
},
{
"kind": "gas",
"amount": "0.0007",
"instrumentId": "evm:421018:instrument:42",
"estimated": true
},
{
"kind": "service",
"amount": "0.0001",
"instrumentId": "evm:421018:instrument:42"
}
]When each kind appears (swap quotes)
| Kind | On a swap quote |
|---|---|
gas | Always; usually estimated: true |
trade | Always |
service | Always |
bridge | Only when the quote path needs a cross-ledger step |
- A successful swap quote includes the lines that apply — show those; if a kind is absent, it does not apply to that quote.
- Do not sum lines that use different
instrumentIds into one number — show each line with its own asset (or convert in your UI if you have prices).
Multi-ledger quotes
When a quote’s path spans more than one ledger:
- You may see more than one
gasorserviceline — one per ledger involved, each in that ledger’s native instrument. - A
bridgeline appears when there is a cross-ledger step; itsinstrumentIdis the asset that line is charged in. Quote.ledgeris still the primary ledger for the quote; cost lines carry their owninstrumentId(and thus ledger) per line.
Service fee
- Fixed per ledger — same amount for all writes on that chain.
- Always in that ledger’s native instrument.
Amounts can differ across ledgers: native tokens vary a lot in price, so each ledger’s fee is set to stay modest in real terms.
This small fee helps us keep building Nutrimatic with care — so you can keep shipping on a product we love making.
Infinite Mainnet (evm:421018): 0.0001 42 on every write. See Ledgers.
Related
| Goal | Start here |
|---|---|
Get a swap quote that includes costs | Swaps — routing.quote |
| Multi-step path fees | Settlement — Path |
QuoteCost shape | Types — QuoteCost |
| Write overview | Write operations |
Liquidity / stake / farm (no pre-execute costs list) | Liquidity · Staking · Farming |