Skip to content
CTRL K

    Types

    This page is a dictionary of shapes — look up a type when an operations page links here. You do not need to read it top to bottom.

    Nutrimatic models ledgers, instruments, and venues for market data, plus execution types for writes. Read operations and Write operations use these shapes.

    Field presence. Types on this page define the shape Nutrimatic returns. Fields without ? are always included on a successful response. Fields with ? may be absent when that value is not yet available — treat absence as unknown, not as zero or empty unless stated otherwise. Method parameters follow a separate rule (Required in operation docs); config types use ? for fields you may omit at SDK init.

    Shared: Ledger, IDs, WalletAdapter, ExecutionHandle, Path
    Market: Instrument, Venue, candles, feeds, pool views
    Execution: Quote, QuoteCost, Swap/Liquidity/Stake/Farm requests, SettlementStatus
    Product DeFi: Balance, Position, StakePosition, Farm

    At a glance

    Shared

    TypeWhat it isUsed in
    LedgerRefA blockchain declared in SDK configConfig, DeploymentManifest
    LedgerScopeLedger ID or alias on inputsMethod ledgers filters
    WalletAdapterBring-your-own signingConfig wallet, write path
    SignRequest / SignedPayloadSign in / out for the adapterWallet adapter
    ExecutionHandleStatus of a writeeasy.swap, liquidity.*, stake/farm/approve
    PathOrdered multi-step planQuotes, settlement

    Market (DeFi)

    TypeWhat it isUsed in
    InstrumentA tradable token with product identityCatalog, pair legs, prices
    AmmVenueRefAn AMM poolCatalog, venue-scoped reads
    InstrumentProfileEditorial metadata (description, logo, links)getInstrumentProfile
    PairListingOne listable market rowlistPairs, getPair
    RatePrice between base and quotePool views, live state
    CandleSeriesOHLCV chart datagetChart, getCandles
    FeedSeriesDiscrete event feed pagegetVenueFeed, getTrades, getTradeFeed
    TradeFeedTrade-only feed aliasgetTrades, getTradeFeed
    VenueFeedMulti-kind venue feed aliasgetVenueFeed
    InstrumentTelemetryViewToken price, market aggregate, optional supplygetTokenPrice, getInstrumentView
    InstrumentMarketViewAggregated venue volume / liquidityNested under instrument telemetry
    InstrumentSupplyViewTotal supply, issuance, treasury, holdersNested under instrument telemetry
    InstrumentTreasuryViewTreasury balances + vesting scheduleNested under supply.treasury
    AmmTelemetryViewPool summary metricsgetPoolView, getAmmView
    AmmVenueStateLive reserves and spotgetAmmState
    TradeViewOne executed trade eventgetTrades, getTradeFeed
    LiquidityEventViewLP add/remove eventgetVenueFeed
    DeploymentManifestDeployed contracts for a ledgergetDeployment

    Execution

    TypeWhat it isUsed in
    Quote / QuoteLeg / QuoteRequest / QuoteCostSwap quote and cost linesrouting.quote, easy.swap
    SwapRequestExecute a swapeasy.swap
    LiquidityAddRequest / LiquidityRemoveRequestLP opsliquidity.add / remove
    Balance / Allowance / ApproveRequestWallet balancesbalances.*
    Position / PositionKindUnified portfolio rowpositions.*
    StakePosition / stake requestsProduct stakingstaking.*
    Farm / FarmPosition / farm requestsLiquidity miningfarming.*
    ExecutionStatusShared status enumHandle, settlement, steps
    SettlementStatusAsync / multi-step progresssettlement.track

    Network-specific ledger IDs and aliases: Ledgers.


    Identifiers

    Nutrimatic uses stable string IDs. Pass them back into SDK calls as documented — you do not need raw contract addresses in user-facing layers.

    ID formats

    IDPatternExample
    LedgerId{kind}:{chainRef}evm:421018
    InstrumentId{ledgerId}:instrument:{symbol}evm:421018:instrument:42
    VenueId{ledgerId}:amm:{protocol}:{address}evm:421018:amm:v2:0xabc123

    pairLabel

    Human-readable pair string used by easy.read (e.g. 42-USDT). The SDK resolves it to venue and instrument IDs.

    LedgerScope

    type LedgerScope = LedgerId | string  // ID or alias from config
    

    Input only. Used in optional ledgers filters and similar method arguments — you may pass the ledger id or its alias. Responses always return the canonical LedgerId (never an alias). Resolution rules: Read operations — Filtering with ledgers. Supported networks: Ledgers.


    Catalog entities

    Metadata and discovery — stable descriptions of what exists on a ledger.

    LedgerRef

    A blockchain entry in SDK config. Declare the full shape once at init.

    interface LedgerRef {
      readonly id: LedgerId
      readonly kind: 'evm' | 'bitcoin' | 'cosmos'
      readonly chainId?: number | string
      readonly alias?: string
    }
    FieldTypeDescription
    idLedgerIdCanonical ledger ID, e.g. evm:421018. Responses always echo this — never an alias.
    kind'evm' | 'bitcoin' | 'cosmos'Network family. Determines how addresses and signing are interpreted for this ledger.
    chainIdnumber | stringOptional. Chain identifier for EVM and similar networks, e.g. 421018. Omit for ledger kinds that don’t use one.
    aliasstringOptional. Short name you can pass instead of id in method filters, e.g. infinite-mainnet.

    Example:

    {
      "id": "evm:421018",
      "kind": "evm",
      "chainId": 421018,
      "alias": "infinite-mainnet"
    }

    See also: Configuration — ledgers · Ledgers · catalog.listLedgers()


    Instrument

    A token or asset Nutrimatic tracks with a product identity — not a raw contract address in the UI layer.

    interface Instrument {
      readonly id: InstrumentId
      readonly symbol: string
      readonly ledgerId: LedgerId
      readonly lineage?: string
      readonly displayName?: string
      readonly decimals?: number
      readonly onChainAddress?: string
    }
    FieldTypeDescription
    idInstrumentIdStable Nutrimatic instrument ID — use this in the UI layer instead of the raw contract address.
    symbolstringTicker shown to users, e.g. 42.
    ledgerIdLedgerIdLedger this instrument lives on.
    lineagestringOptional. Tag describing where the instrument comes from, e.g. native for a chain’s gas token.
    displayNamestringOptional. Human-readable name, when different from symbol.
    decimalsnumberOptional. Decimal places used to convert raw on-chain amounts into display amounts.
    onChainAddressstringOptional. On-chain token address for explorers. Omit for native gas assets.

    Example:

    {
      "id": "evm:421018:instrument:42",
      "symbol": "42",
      "ledgerId": "evm:421018",
      "lineage": "native",
      "displayName": "42",
      "decimals": 18
    }

    See also: catalog.listInstruments() · catalog.getInstrument() · Read operations


    InstrumentProfile

    Editorial presentation metadata for an instrument — separate from Instrument identity and from market telemetry. Commercial name lives on Instrument.displayName, not here.

    interface InstrumentProfileLink {
      readonly label: string
      readonly url: string
    }
    
    interface InstrumentProfile {
      readonly instrumentId: InstrumentId
      readonly tagline?: string
      readonly description?: string
      readonly logoUrl?: string
      readonly headerUrl?: string
      readonly links?: readonly InstrumentProfileLink[]
      readonly tags?: readonly string[]
      readonly listedAt?: string
      readonly updatedAt?: string
    }
    FieldTypeDescription
    instrumentIdInstrumentIdInstrument this profile describes.
    taglinestringOptional. One-line product blurb for headers.
    descriptionstringOptional. Longer copy for token detail pages.
    logoUrlstringOptional. HTTPS URL to a logo image.
    headerUrlstringOptional. Banner / header image URL.
    linksInstrumentProfileLink[]Optional. Links with open label strings (convention: website, x, telegram, discord, docs, manifesto) and url.
    tagsstring[]Optional. Classification tags (kebab-case; e.g. stablecoin, native).
    listedAtstringOptional. ISO time when the instrument was listed in the catalog.
    updatedAtstringOptional. ISO timestamp of the last profile edit.

    Example:

    {
      "instrumentId": "evm:421018:instrument:42",
      "tagline": "The native asset of Infinite.",
      "description": "Native token of Infinite Mainnet.",
      "logoUrl": "https://cdn.nutrimatic.xyz/instruments/42.png",
      "links": [
        { "label": "website", "url": "https://example.com" },
        { "label": "x", "url": "https://x.com/example" }
      ],
      "tags": ["native"],
      "listedAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-07-01T00:00:00Z"
    }

    See also: catalog.getInstrumentProfile() · Read operations


    AmmVenueRef

    An AMM venue — a pool available for quotes, charts, and live state.

    interface VenueRef {
      readonly id: VenueId
      readonly ledgerId: LedgerId
      readonly kind: 'amm'
    }
    
    interface AmmVenueRef extends VenueRef {
      readonly protocol: 'v2' | 'v3' | 'v4'
      readonly poolAddress?: string
    }
    FieldTypeDescription
    idVenueIdStable Nutrimatic venue ID for this pool.
    ledgerIdLedgerIdLedger the pool lives on.
    kind'amm'Venue kind discriminator — always 'amm' for this type.
    protocol'v2' | 'v3' | 'v4'Which AMM protocol version powers the pool.
    poolAddressstringOptional. On-chain pool contract address, when Nutrimatic has resolved one.

    Example:

    {
      "id": "evm:421018:amm:v2:0xabc123",
      "ledgerId": "evm:421018",
      "kind": "amm",
      "protocol": "v2",
      "poolAddress": "0xabc123"
    }

    See also: catalog.listVenues() · catalog.getVenue() · Read operations


    DeploymentManifest

    Contract deployment metadata for a ledger — packages, names, and addresses for read-only integration.

    interface DeploymentManifest {
      readonly ledger: LedgerRef
      readonly version: string
      readonly updatedAt?: string
      readonly contracts: readonly {
        package: string
        contract: string
        address: string
        access?: string
      }[]
    }
    FieldTypeDescription
    ledgerLedgerRefLedger this deployment manifest describes.
    versionstringManifest version string — bumps when the deployed contract set changes.
    updatedAtstringOptional. ISO timestamp of the last manifest update.
    contractsobject[]Deployed contracts for this ledger: package, contract name, on-chain address, and optional access level.

    Example:

    {
      "ledger": {
        "id": "evm:421018",
        "kind": "evm",
        "chainId": 421018,
        "alias": "infinite-mainnet"
      },
      "version": "1.0.0",
      "updatedAt": "2026-07-01T00:00:00Z",
      "contracts": [
        { "package": "dex", "contract": "Router", "address": "0xrouter", "access": "public" }
      ]
    }

    See also: catalog.getDeployment() · Read operations


    Market primitives

    Building blocks reused inside views and live state.

    Rate

    A spot price between a base and quote instrument.

    interface Rate {
      readonly value: number | string
      readonly baseInstrumentId: InstrumentId
      readonly quoteInstrumentId: InstrumentId
      readonly asOf?: number
    }
    FieldTypeDescription
    valuenumber | stringPrice of one unit of baseInstrumentId in terms of quoteInstrumentId, as a display value (not raw/smallest-unit).
    baseInstrumentIdInstrumentIdThe instrument being priced.
    quoteInstrumentIdInstrumentIdThe instrument the price is denominated in.
    asOfnumberOptional. Unix time in seconds this rate was observed.

    Example:

    {
      "value": 1.04,
      "baseInstrumentId": "evm:421018:instrument:42",
      "quoteInstrumentId": "evm:421018:instrument:usdt",
      "asOf": 1719795600
    }

    See also: AmmTelemetryView · AmmVenueState · venues.getSpotRate()


    Percent

    A percentage change — typically 24h delta.

    interface Percent {
      readonly value: number
    }

    Example: { "value": 2.3 } — 2.3% change.


    Quantity

    An on-chain amount with decimals — used for pool reserves and other read views. Swap quote legs use display amounts instead — see QuoteLeg.

    interface Quantity {
      readonly raw: bigint | string
      readonly decimals: number
    }
    FieldTypeDescription
    rawbigint | stringInteger amount in the token’s smallest on-chain unit (e.g. wei) — not a display value.
    decimalsnumberDecimal places to divide raw by to get a display amount.

    Example:

    { "raw": "1000000000000000000", "decimals": 18 }

    CandleInterval

    OHLCV bucket size. Smallest supported interval is 15 minutes (1m / 5m are not in the product).

    type CandleInterval = '15m' | '1h' | '4h' | '1d' | '1w'

    Candle

    One OHLCV bucket from Nutrimatic. time is the bucket start in Unix seconds.

    interface Candle {
      readonly time: number
      readonly open: number
      readonly high: number
      readonly low: number
      readonly close: number
    }

    Example:

    {
      "time": 1719792000,
      "open": 1.02,
      "high": 1.05,
      "low": 1.01,
      "close": 1.04
    }

    CandleQuery

    Optional window controls on getChart and getCandles. Full guide for beginners: Chart windows.

    type CandleReadScope = 'default' | 'partialOnly'
    
    interface CandleQuery {
      readonly limit?: number
      readonly after?: number
      readonly before?: number
      readonly scope?: CandleReadScope
    }
    FieldTypeDescription
    limitnumberOptional. Max closed candles to return (most recent within the window). Default 300 if omitted; responses cap at 1000. See Chart windows.
    afternumberOptional. Only candles newer than this Unix time in seconds (tail refresh). Pass lastClosedCandleTime(series.candles).
    beforenumberOptional. Only candles older than this Unix time in seconds (scroll back). Use with limit; pass firstClosedCandleTime(series.candles).
    scope'default' | 'partialOnly'Optional. 'partialOnly' = only the live open bar (candles is always []). See Chart windows — scope.

    Example request:

    {
      "limit": 300,
      "after": 1719792000
    }

    Views

    Objects returned by read operations — ready for charts, tables, and tickers.

    PairListing

    One tradable pair row for market lists and selectors.

    interface PairListing {
      readonly pairLabel: string
      readonly venueId: VenueId
      readonly baseInstrumentId: InstrumentId
      readonly quoteInstrumentId: InstrumentId
    }
    FieldTypeDescription
    pairLabelstringDisplay label for the market (e.g. 42-USDT). Use as-is in selectors; pass to getPair, getChart, or getTradeFeed.
    venueIdVenueIdPool that prices and provides liquidity for this pair. Pass to getPoolView, getAmmView, or getAmmState.
    baseInstrumentIdInstrumentIdBase leg — the asset being priced (e.g. 42 in 42-USDT).
    quoteInstrumentIdInstrumentIdQuote leg — the pricing denominator (e.g. USDT in 42-USDT).

    Example:

    {
      "pairLabel": "42-USDT",
      "venueId": "evm:421018:amm:v2:0xabc123",
      "baseInstrumentId": "evm:421018:instrument:42",
      "quoteInstrumentId": "evm:421018:instrument:usdt"
    }

    See also: Read operations — listPairs · getPair


    CandleSeries

    OHLCV candle data for charts. Responses are display-ready — price axis and base/quote convention are normalized for UI.

    candles holds closed buckets only (ascending by time). The in-progress bucket may appear separately as partialCandle. Window parameters: Chart windows.

    interface CandleSeries {
      readonly venueId: VenueId
      readonly interval: CandleInterval
      readonly priceAxisLabel: string
      readonly candles: readonly Candle[]
      readonly asOf?: number
      readonly partialCandle?: Candle
    }
    FieldTypeDescription
    venueIdVenueIdPool the candles were built from. Keep the same when merging tail responses.
    intervalCandleIntervalBucket size for each candle (e.g. '1h'). Must match across merges.
    priceAxisLabelstringReady-to-display label for the chart’s price axis (e.g. 42/USDT).
    candlesCandle[]Closed OHLCV points, oldest → newest (time in Unix seconds). Draw the main chart from this array.
    asOfnumberOptional. Unix time in seconds when Nutrimatic built this snapshot.
    partialCandleCandleOptional. Current in-progress bucket — not listed in candles. Draw as the live rightmost bar.

    Example:

    {
      "venueId": "evm:421018:amm:v2:0xabc123",
      "interval": "1h",
      "priceAxisLabel": "42/USDT",
      "asOf": 1719795600,
      "candles": [
        { "time": 1719792000, "open": 1.02, "high": 1.05, "low": 1.01, "close": 1.04 }
      ],
      "partialCandle": {
        "time": 1719795600,
        "open": 1.04,
        "high": 1.06,
        "low": 1.03,
        "close": 1.05
      }
    }

    See also: Chart windows · Read operations — getChart · getCandles


    InstrumentTelemetryView

    Token-level snapshot: USD price, 24h change, optional market totals across listed venues, and optional supply when Nutrimatic offers it for that instrument.

    interface InstrumentTelemetryView {
      readonly instrumentId: InstrumentId
      readonly priceUsd?: number
      readonly change24h?: Percent
      readonly market?: InstrumentMarketView
      readonly supply?: InstrumentSupplyView
    }
    FieldTypeDescription
    instrumentIdInstrumentIdInstrument this snapshot describes — resolved from your input.
    priceUsdnumberOptional. Latest price in USD when Nutrimatic can anchor the instrument via listed markets (directly against a USD stable, or through another listed instrument that already has a USD price). Omit when no usable USD anchor exists. Display as-is; re-fetch for updates.
    change24hPercentOptional. Percent change of this instrument’s USD price over ~24 hours (e.g. 2.3 means +2.3%). Positive is up, negative is down. Omit or zero when there is no usable then/now USD price.
    marketInstrumentMarketViewOptional. Volume and liquidity aggregated across listed venues for this instrument.
    supplyInstrumentSupplyViewOptional. Total supply, issuance, treasury/vesting, holders count, and derived figures when available. Omit when not offered for this instrument.

    Example (with market and supply):

    {
      "instrumentId": "evm:421018:instrument:42",
      "priceUsd": 1.04,
      "change24h": { "value": 2.3 },
      "market": {
        "volume24hUsd": 125000,
        "liquidityUsd": 890000
      },
      "supply": {
        "asOf": 1753072800,
        "total": { "raw": "100451001124521553982862588", "decimals": 18 },
        "issuance": {
          "inflation": 0.1,
          "annualProvisions": { "raw": "10045100112452155398286258", "decimals": 18 }
        },
        "holders": { "count": 176 },
        "treasury": {
          "address": "infinite10fhk6nsvuw4mhfdtv6zux754n8mz2z39ynqqf7",
          "balance": { "raw": "100154418839999999999459207", "decimals": 18 },
          "locked": { "raw": "98872808363384891700000000", "decimals": 18 },
          "unlocked": { "raw": "1281610476615108299459207", "decimals": 18 },
          "vesting": {
            "kind": "continuous",
            "startAt": 1769666400,
            "endAt": 3095388000,
            "durationSec": 1325721600,
            "elapsedSec": 14947200,
            "remainingSec": 1310774400,
            "lockedPercent": 98.87,
            "unlockedPercent": 1.13,
            "original": { "raw": "100000000000000000000000000", "decimals": 18 }
          }
        },
        "derived": {
          "circulating": { "raw": "15781927611436622828862588", "decimals": 18 },
          "mcapCirculating": 16413204.72,
          "fdv": 104469041.17
        }
      }
    }

    Example (market only — no supply block):

    {
      "instrumentId": "evm:421018:instrument:usdt",
      "priceUsd": 1,
      "change24h": { "value": 0 },
      "market": {
        "volume24hUsd": 98000,
        "liquidityUsd": 1200000
      }
    }

    Nested shapes: InstrumentMarketView · InstrumentSupplyView

    See also: Read operations — getTokenPrice · getInstrumentView


    InstrumentMarketView

    Aggregated stats across listed venues where the instrument is base or quote (not a single pool).

    interface InstrumentMarketView {
      readonly volume24hUsd?: number
      readonly liquidityUsd?: number
    }
    FieldTypeDescription
    volume24hUsdnumberOptional. Sum of 24h USD volume across those venues (each venue’s volume is counted once per instrument that is base or quote).
    liquidityUsdnumberOptional. Sum of half the USD TVL of each listed venue where this instrument is base or quote (so one pool is not double-counted when comparing legs).

    Example:

    {
      "volume24hUsd": 125000,
      "liquidityUsd": 890000
    }

    InstrumentSupplyView

    Supply and related figures when Nutrimatic materializes them. Nested blocks are optional — use what is present.

    interface InstrumentSupplyView {
      readonly asOf: number
      readonly total: Quantity
      readonly issuance?: InstrumentIssuanceView
      readonly holders?: { count: number }
      readonly treasury?: InstrumentTreasuryView
      readonly derived?: InstrumentSupplyDerivedView
    }
    FieldTypeDescription
    asOfnumberUnix time in seconds when this supply snapshot was taken.
    totalQuantityTotal supply on-chain (raw + decimals).
    issuanceobjectOptional. Inflation rate and annual provisions.
    holders{ count }Optional. Count of addresses with non-zero balance — not a wallet list.
    treasuryInstrumentTreasuryViewOptional. Curated treasury / DAO balances and vesting schedule.
    derivedobjectOptional. Circulating supply and market caps derived from policy + price.

    Issuance

    FieldTypeDescription
    inflationnumberOptional. Annual inflation as a fraction (0.1 = 10%/year).
    annualProvisionsQuantityOptional. Approximate new tokens per year.

    Derived

    FieldTypeDescription
    circulatingQuantityCirculating supply per product policy (e.g. total minus treasury locked).
    mcapCirculatingnumberOptional. Circulating × priceUsd when price is available.
    fdvnumberOptional. Total supply × priceUsd when price is available.

    Example: see the full supply object under InstrumentTelemetryView.


    InstrumentTreasuryView

    Curated treasury account for an instrument — balances and optional vesting schedule.

    interface InstrumentTreasuryView {
      readonly address: string
      readonly balance: Quantity
      readonly locked: Quantity
      readonly unlocked: Quantity
      readonly vesting?: InstrumentVestingView
    }
    FieldTypeDescription
    addressstringOn-chain address of the curated treasury account.
    balanceQuantityTotal balance in that account.
    lockedQuantityAmount still locked (e.g. unvested).
    unlockedQuantityAmount unlocked / spendable in that account.
    vestingInstrumentVestingViewOptional. Schedule metadata (start/end, remaining time, percents).

    Vesting (InstrumentVestingView): times are Unix seconds. lockedPercent / unlockedPercent use original as the base when present.

    FieldTypeDescription
    kindstringSchedule kind (e.g. continuous).
    startAt / endAtnumberVesting window start and end (Unix seconds).
    durationSecnumberFull schedule length in seconds.
    elapsedSec / remainingSecnumberElapsed and remaining time at supply.asOf.
    lockedPercent / unlockedPercentnumberShare of original still locked / already unlocked.
    originalQuantityOptional. Original vesting amount at schedule start.

    Example:

    {
      "address": "infinite10fhk6nsvuw4mhfdtv6zux754n8mz2z39ynqqf7",
      "balance": { "raw": "100154418839999999999459207", "decimals": 18 },
      "locked": { "raw": "98872808363384891700000000", "decimals": 18 },
      "unlocked": { "raw": "1281610476615108299459207", "decimals": 18 },
      "vesting": {
        "kind": "continuous",
        "startAt": 1769666400,
        "endAt": 3095388000,
        "durationSec": 1325721600,
        "elapsedSec": 14947200,
        "remainingSec": 1310774400,
        "lockedPercent": 98.87,
        "unlockedPercent": 1.13,
        "original": { "raw": "100000000000000000000000000", "decimals": 18 }
      }
    }

    AmmTelemetryView

    Pool-level summary — spot, change, TVL, and volume.

    interface AmmTelemetryView {
      readonly venueId: VenueId
      readonly spot?: Rate
      readonly change24h?: Percent
      readonly tvlUsd?: number
      readonly volume24hUsd?: number
    }
    FieldTypeDescription
    venueIdVenueIdPool this summary describes — echoes the venue you queried.
    spotRateOptional. Current spot price (base in terms of quote). Display value as-is.
    change24hPercentOptional. Percent price change over the trailing 24 hours. Positive is up, negative is down.
    tvlUsdnumberOptional. Total value locked in the pool, in USD.
    volume24hUsdnumberOptional. Trading volume over the trailing 24 hours, in USD.

    Example:

    {
      "venueId": "evm:421018:amm:v2:0xabc123",
      "spot": {
        "value": 1.04,
        "baseInstrumentId": "evm:421018:instrument:42",
        "quoteInstrumentId": "evm:421018:instrument:usdt",
        "asOf": 1719795600
      },
      "change24h": { "value": 0.8 },
      "tvlUsd": 1250000,
      "volume24hUsd": 84000
    }

    See also: Read operations — getPoolView · getAmmView


    AmmVenueState

    Live on-chain pool state — reserves and spot. Complements telemetry views when you need raw pool data.

    interface AmmVenueState {
      readonly venueId: VenueId
      readonly reserves: readonly Quantity[]
      readonly spot: Rate
    }
    FieldTypeDescription
    venueIdVenueIdPool this state describes — echoes the venue you queried.
    reservesQuantity[]Current on-chain reserves for each pool leg, in raw (smallest-unit) integers. Convert with each Quantity.decimals before showing in the UI.
    spotRateSpot price implied by the current reserves. Display value as-is; re-fetch for updates.

    Example:

    {
      "venueId": "evm:421018:amm:v2:0xabc123",
      "reserves": [
        { "raw": "1000000000000000000", "decimals": 18 },
        { "raw": "1040000000", "decimals": 6 }
      ],
      "spot": {
        "value": 1.04,
        "baseInstrumentId": "evm:421018:instrument:42",
        "quoteInstrumentId": "evm:421018:instrument:usdt",
        "asOf": 1719795600
      }
    }

    See also: Read operations — getAmmState


    TradeView

    One executed trade on a venue — a FeedEventRef with kind: 'trade'. Full feed patterns: Activity feeds.

    interface TradeView {
      readonly eventId: string
      readonly time: number
      readonly kind: 'trade'
      readonly ledgerId: string
      readonly txHash: string
      readonly actor: string
      readonly venueId: VenueId
      readonly price: number
      readonly baseAmount: number
      readonly quoteAmount: number
      readonly side: 'buy' | 'sell'
    }
    FieldTypeDescription
    eventIdstringOpaque, stable event ID — use it for ordering and de-duplication; do not parse its contents.
    timenumberUnix time in seconds the trade occurred.
    kind'trade'Event kind discriminator — always 'trade' for this view.
    ledgerIdstringLedger the trade happened on.
    txHashstringTransaction hash — build your own explorer URL; Nutrimatic does not return explorer links.
    actorstringFlow-relevant address for this trade (Swap to) — not the router.
    venueIdVenueIdPool where the trade executed.
    pricenumberExecution price, as a display value in the pair’s quote instrument (quote per 1 base).
    baseAmountnumberDisplay amount of the pair base instrument moved.
    quoteAmountnumberDisplay amount of the pair quote instrument moved.
    side'buy' | 'sell'Aggressor side — which direction initiated the trade.

    Example:

    {
      "eventId": "evm:421018:swap:0xabc…:12",
      "time": 1719795600,
      "kind": "trade",
      "ledgerId": "evm:421018",
      "txHash": "0xabc123def456",
      "actor": "0xuser000000000000000000000000000000000001",
      "venueId": "evm:421018:amm:v2:0xabc123",
      "price": 1.04,
      "baseAmount": 250,
      "quoteAmount": 260,
      "side": "buy"
    }

    See also: Activity feeds · Read operations — getTrades


    LiquidityEventView

    Liquidity add or remove at a venue. Same feed window model as trades; kinds 'liquidity_add' and 'liquidity_remove'.

    interface LiquidityEventView {
      readonly eventId: string
      readonly time: number
      readonly kind: 'liquidity_add' | 'liquidity_remove'
      readonly ledgerId: string
      readonly txHash: string
      readonly actor: string
      readonly venueId: VenueId
      readonly amount: number
      readonly baseAmount: number
      readonly quoteAmount: number
    }
    FieldTypeDescription
    eventIdstringOpaque, stable event ID — use it for ordering and de-duplication; do not parse its contents.
    timenumberUnix time in seconds the event occurred.
    kind'liquidity_add' | 'liquidity_remove'Whether liquidity was added to or removed from the pool.
    ledgerIdstringLedger the event happened on.
    txHashstringTransaction hash — build your own explorer URL; Nutrimatic does not return explorer links.
    actorstringFlow-relevant address — mint: LP Transfer recipient; remove: Burn to. Not the router.
    venueIdVenueIdPool the liquidity change affected.
    amountnumberLP-token amount as a display value (pool LP decimals) — not raw/smallest-unit.
    baseAmountnumberDisplay amount of the pair base instrument added or removed.
    quoteAmountnumberDisplay amount of the pair quote instrument added or removed.

    Example:

    {
      "eventId": "evm:421018:lp:0xdef…:3",
      "time": 1719795550,
      "kind": "liquidity_add",
      "ledgerId": "evm:421018",
      "txHash": "0xdef789abc012",
      "actor": "0xuser000000000000000000000000000000000001",
      "venueId": "evm:421018:amm:v2:0xabc123",
      "amount": 1000,
      "baseAmount": 50,
      "quoteAmount": 52
    }

    See also: Activity feeds — Liquidity events · getVenueFeed


    FeedEventRef

    Common fields on every discrete feed event. Total order: time ASC, eventId ASC.

    type FeedEventKind =
      | 'trade'
      | 'liquidity_add'
      | 'liquidity_remove'
    
    interface FeedEventRef {
      readonly eventId: string
      readonly time: number
      readonly kind: FeedEventKind
      readonly ledgerId: string
      readonly txHash: string
      readonly actor: string
    }
    FieldTypeDescription
    eventIdstringOpaque, stable event ID.
    timenumberUnix seconds.
    kindFeedEventKindEvent kind.
    ledgerIdstringLedger of the event.
    txHashstringTransaction hash — compose explorer URLs in your app.
    actorstringFlow-relevant address (not the router). See TradeView / LiquidityEventView.

    Example:

    {
      "eventId": "evt_trade_01",
      "time": 1719795500,
      "kind": "trade",
      "ledgerId": "evm:421018",
      "txHash": "0xabc123def456",
      "actor": "0xuser000000000000000000000000000000000001"
    }

    FeedCursor

    Cursor for incremental feed windows. Use with after and before on FeedQuery.

    interface FeedCursor {
      readonly time: number
      readonly eventId: string
    }

    Example:

    {
      "time": 1719795500,
      "eventId": "evt_trade_01"
    }

    Obtain cursors from your feed with lastFeedCursor and firstFeedCursor.


    FeedQuery

    Optional window controls on getVenueFeed, getTrades, and getTradeFeed. Full guide: Activity feeds.

    type FeedReadScope = 'default' | 'headOnly'
    
    interface FeedQuery {
      readonly limit?: number
      readonly after?: FeedCursor
      readonly before?: FeedCursor
      readonly scope?: FeedReadScope
      readonly kinds?: readonly FeedEventKind[]
    }
    FieldTypeDescription
    limitnumberOptional. Max events to return (most recent within the window; the returned array is still ascending). Default 50 if omitted; responses cap at 200. See Activity feeds.
    afterFeedCursorOptional. Only events newer than this cursor (tail refresh). Pass lastFeedCursor(feed.events).
    beforeFeedCursorOptional. Only events older than this cursor (scroll up). Use with limit; pass firstFeedCursor(feed.events).
    scope'default' | 'headOnly'Optional. 'headOnly' = live edge only; events is always []. See Activity feeds — scope.
    kindsFeedEventKind[]Optional. Restrict to specific event kinds (e.g. ['trade']). Omit to get every kind the venue supports (method defaults may differ — see each read op).

    Example request:

    {
      "limit": 50,
      "after": { "time": 1719795500, "eventId": "evt_trade_01" },
      "kinds": ["trade"]
    }

    FeedSeries

    A page of feed events for one scope.

    interface FeedSeries<T extends FeedEventRef = FeedEventRef> {
      readonly scopeId: VenueId
      readonly scopeKind: 'venue'
      readonly events: readonly T[]
      readonly asOf?: number
      readonly ordering: 'asc'
    }

    events holds discrete events only, ascending by total order (time, then eventId). Merge tail responses with mergeFeedSeries.

    Example:

    {
      "scopeId": "evm:421018:amm:v2:0xabc123",
      "scopeKind": "venue",
      "ordering": "asc",
      "asOf": 1719795600,
      "events": [
        {
          "eventId": "evt_trade_01",
          "time": 1719795500,
          "kind": "trade",
          "ledgerId": "evm:421018",
          "txHash": "0xabc123def456",
          "actor": "0xuser000000000000000000000000000000000001",
          "venueId": "evm:421018:amm:v2:0xabc123",
          "price": 2.48,
          "baseAmount": 1.5,
          "quoteAmount": 3.72,
          "side": "sell"
        }
      ]
    }

    TradeFeed

    Type alias for a trade-only feed:

    type TradeFeed = FeedSeries<TradeView>

    Returned by getTrades and getTradeFeed.

    VenueFeed

    Type alias for a feed that may include multiple event kinds:

    type VenueFeed = FeedSeries<TradeView | LiquidityEventView>

    Returned by getVenueFeed.

    See also: Activity feeds · Chart windows (OHLCV — separate domain)


    Execution

    Types for writes. Full flows: Write operations · Swaps · Liquidity · Balances · Staking · Farming · Settlement.

    WalletAdapter

    interface WalletAdapter {
      getAddress(): Promise<string>
      getLedger(): Promise<LedgerId>
      sign(request: SignRequest): Promise<SignedPayload>
    }

    Bring-your-own signing — see Wallet adapter. getLedger() returns the canonical ledger ID, not an alias.

    SignRequest

    interface SignRequest {
      readonly ledger: LedgerId
      readonly kind: 'evm' | 'bitcoin' | 'cosmos' | string
      readonly purpose:
        | 'swap'
        | 'liquidity_add'
        | 'liquidity_remove'
        | 'settlement'
        | 'approve'
        | 'stake'
        | 'unstake'
        | 'stake_claim'
        | 'farm_deposit'
        | 'farm_withdraw'
        | 'farm_harvest'
        | string
      readonly payload: unknown
      readonly expiresAt?: number
    }

    Example: see Wallet adapter — SignRequest.

    SignedPayload

    interface SignedPayload {
      readonly ledger: LedgerId
      readonly kind: string
      readonly payload: unknown
    }

    Example: see Wallet adapter — SignedPayload.

    QuoteRequest

    Provide exactly one of pair or venue. intent / side cover the four swap-UI cases — Swaps — Choosing intent and side.

    amount is always a display decimal string. slippageBps optional — default 50. deadline / times are Unix milliseconds.

    interface QuoteRequest {
      readonly pair?: string
      readonly venue?: VenueId | string
      readonly intent: 'buy' | 'sell'
      readonly side: 'exactIn' | 'exactOut'
      readonly amount: string
      readonly ledgers?: readonly LedgerScope[]
      readonly slippageBps?: number
      readonly deadline?: number
    }

    Example request (spend fixed USDT to buy 42):

    {
      "pair": "42-USDT",
      "intent": "buy",
      "side": "exactIn",
      "amount": "100",
      "ledgers": ["infinite-mainnet"],
      "slippageBps": 50
    }

    QuoteLeg

    One side of a quoted trade. amountIn is what you spend; amountOut is what you receive (trade direction, not pair order).

    amount is always a display decimal string for that instrument (human units already scaled by the instrument’s decimals). Nutrimatic handles on-chain raw conversion. If you need decimals for input masks or your own checks, read them from the instrument in the catalog — they are not repeated on the leg.

    interface QuoteLeg {
      readonly instrumentId: InstrumentId
      readonly amount: string
    }
    FieldTypeDescription
    instrumentIdInstrumentIdWhich asset this leg is (canonical instrument ID).
    amountstringHow much of that asset, as a display decimal string (e.g. "1.5") — not raw/smallest-unit.

    Example:

    {
      "instrumentId": "evm:421018:instrument:42",
      "amount": "1.5"
    }

    QuoteCost

    One cost line on a swap Quote.costs. Only swap quotes return a costs list before execute — Fees and costs.

    type QuoteCostKind = 'gas' | 'trade' | 'bridge' | 'service'
    
    interface QuoteCost {
      readonly kind: QuoteCostKind
      readonly amount: string
      readonly instrumentId: InstrumentId
      readonly estimated?: boolean
    }

    Example:

    {
      "kind": "service",
      "amount": "0.0001",
      "instrumentId": "evm:421018:instrument:42"
    }

    Quote

    interface Quote {
      readonly id: string
      readonly pairLabel: string
      readonly intent: 'buy' | 'sell'
      readonly amountIn: QuoteLeg
      readonly amountOut: QuoteLeg
      readonly slippageBps: number
      readonly expiresAt: number
      readonly ledger: LedgerId
      /** Always present on a successful swap quote (`gas`, `trade`, `service`; `bridge` when needed). */
      readonly costs: readonly QuoteCost[]
      readonly path?: Path
    }

    Example: see Swaps — routing.quote.

    SwapRequest

    Provide exactly one of quoteId or request. Prefer quoteId after routing.quote. slippageBps optional — default the quote’s bound; if set, must be that bound.

    interface SwapRequest {
      readonly quoteId?: string
      readonly request?: QuoteRequest
      readonly slippageBps?: number
      readonly deadline?: number
    }

    Example request:

    {
      "quoteId": "quote_01HZX…"
    }

    LiquidityAddRequest

    Both amount0 and amount1 are required (balanced deposit). token0 = pair base, token1 = pair quote — Liquidity. slippageBps optional — default 50.

    interface LiquidityAddRequest {
      readonly venue: VenueId | string
      readonly amount0: string
      readonly amount1: string
      readonly slippageBps?: number
      readonly deadline?: number
      readonly ledgers?: readonly LedgerScope[]
    }

    Example request:

    {
      "venue": "evm:421018:amm:v2:0xabc123",
      "amount0": "10",
      "amount1": "25",
      "slippageBps": 50
    }

    LiquidityRemoveRequest

    liquidity, amount0Min, and amount1Min are display decimal strings. slippageBps is optional — default 50 if omitted. Full field guide: Liquidity — liquidity.remove.

    interface LiquidityRemoveRequest {
      readonly venue: VenueId | string
      readonly liquidity: string
      readonly amount0Min?: string
      readonly amount1Min?: string
      readonly slippageBps?: number
      readonly deadline?: number
      readonly ledgers?: readonly LedgerScope[]
    }

    Example request:

    {
      "venue": "evm:421018:amm:v2:0xabc123",
      "liquidity": "1000",
      "amount0Min": "9.5",
      "amount1Min": "24",
      "slippageBps": 50
    }

    Balance

    Instrument balance as a display decimal. Field guide: Balances.

    interface Balance {
      readonly instrumentId: InstrumentId
      readonly amount: string
      readonly owner: string
      readonly ledger: LedgerId
    }

    Example:

    {
      "instrumentId": "evm:421018:instrument:42",
      "amount": "12.5",
      "owner": "0xabc…",
      "ledger": "evm:421018"
    }

    Allowance

    interface Allowance {
      readonly instrumentId: InstrumentId
      readonly owner: string
      readonly spender: string
      readonly amount: string
      readonly ledger: LedgerId
    }

    Example:

    {
      "instrumentId": "evm:421018:instrument:42",
      "owner": "0xabc…",
      "spender": "0xspender…",
      "amount": "100",
      "ledger": "evm:421018"
    }

    ApproveRequest

    interface ApproveRequest {
      readonly instrumentId: InstrumentId
      readonly spender: string
      readonly amount: string
      readonly deadline?: number
    }

    Example request:

    {
      "instrumentId": "evm:421018:instrument:42",
      "spender": "0xspender…",
      "amount": "100"
    }

    PositionKind

    type PositionKind = 'lp' | 'stake' | 'farm'

    Product DeFi only — not native chain / consensus stake. See Positions.

    Position

    interface Position {
      readonly id: PositionId
      readonly kind: PositionKind
      readonly ledger: LedgerId
      readonly instrumentId?: InstrumentId
      readonly venueId?: VenueId
      readonly farmId?: FarmId
      readonly amount: string
      readonly claimableReward?: {
        readonly instrumentId: InstrumentId
        readonly amount: string
      }
      readonly owner: string
    }

    Example:

    {
      "id": "pos_stake_01…",
      "kind": "stake",
      "ledger": "evm:421018",
      "owner": "0xabc…",
      "amount": "250",
      "instrumentId": "evm:421018:instrument:42",
      "claimableReward": {
        "instrumentId": "evm:421018:instrument:42",
        "amount": "1.25"
      }
    }

    StakePosition

    Product-token stake row. Ops: Staking.

    interface StakePosition {
      readonly id: PositionId
      readonly instrumentId: InstrumentId
      readonly ledger: LedgerId
      readonly owner: string
      readonly amount: string
      readonly claimableReward?: {
        readonly instrumentId: InstrumentId
        readonly amount: string
      }
    }

    Example:

    {
      "id": "pos_stake_01…",
      "instrumentId": "evm:421018:instrument:42",
      "ledger": "evm:421018",
      "owner": "0xabc…",
      "amount": "250",
      "claimableReward": {
        "instrumentId": "evm:421018:instrument:42",
        "amount": "1.25"
      }
    }

    StakeRequest / UnstakeRequest / StakeClaimRequest

    interface StakeRequest {
      readonly instrumentId: InstrumentId
      readonly amount: string
      readonly deadline?: number
      readonly ledgers?: readonly LedgerScope[]
    }
    
    interface UnstakeRequest {
      readonly instrumentId: InstrumentId
      readonly amount: string
      readonly deadline?: number
      readonly ledgers?: readonly LedgerScope[]
    }
    
    interface StakeClaimRequest {
      readonly instrumentId: InstrumentId
      readonly deadline?: number
      readonly ledgers?: readonly LedgerScope[]
    }

    Example request (StakeRequest):

    {
      "instrumentId": "evm:421018:instrument:42",
      "amount": "100"
    }

    Farm

    interface Farm {
      readonly id: FarmId
      readonly ledger: LedgerId
      readonly stakeInstrumentId: InstrumentId
      readonly rewardInstrumentId: InstrumentId
      readonly venueId?: VenueId
    }

    Example:

    {
      "id": "farm_01H…",
      "ledger": "evm:421018",
      "stakeInstrumentId": "evm:421018:instrument:lp-42-usdt",
      "rewardInstrumentId": "evm:421018:instrument:42",
      "venueId": "evm:421018:amm:v2:0xabc123"
    }

    FarmPosition

    interface FarmPosition {
      readonly id: PositionId
      readonly farmId: FarmId
      readonly ledger: LedgerId
      readonly owner: string
      readonly amount: string
      readonly claimableReward?: {
        readonly instrumentId: InstrumentId
        readonly amount: string
      }
    }

    Example:

    {
      "id": "pos_farm_01…",
      "farmId": "farm_01H…",
      "ledger": "evm:421018",
      "owner": "0xabc…",
      "amount": "10",
      "claimableReward": {
        "instrumentId": "evm:421018:instrument:42",
        "amount": "0.4"
      }
    }

    FarmDepositRequest / FarmWithdrawRequest / FarmHarvestRequest

    Ops: Farming.

    interface FarmDepositRequest {
      readonly farmId: FarmId
      readonly amount: string
      readonly deadline?: number
    }
    
    interface FarmWithdrawRequest {
      readonly farmId: FarmId
      readonly amount: string
      readonly deadline?: number
    }
    
    interface FarmHarvestRequest {
      readonly farmId: FarmId
      readonly deadline?: number
    }

    Example request (FarmDepositRequest):

    {
      "farmId": "farm_01H…",
      "amount": "10"
    }

    ExecutionStatus

    Closed status vocabulary for ExecutionHandle, SettlementStatus, and each settlement step. Full guide: Settlement — Status vocabulary.

    type ExecutionStatus =
      | 'pending'
      | 'submitted'
      | 'in_progress'
      | 'confirmed'
      | 'failed'
    StatusTerminal
    pending, submitted, in_progressNo — keep polling when tracking
    confirmed, failedYes — stop polling

    ExecutionHandle

    Returned by easy.swap and liquidity.*. Use id with settlement.track while status is still running. Field meanings: Swaps — easy.swap.

    interface ExecutionReceipt {
      readonly txRef?: string
      readonly raw?: unknown
    }
    
    interface ExecutionHandle {
      readonly id: string
      readonly status: ExecutionStatus
      readonly ledger: LedgerId
      readonly txRef?: string
      readonly receipt?: ExecutionReceipt
    }

    Example:

    {
      "id": "exec_01HZY…",
      "status": "confirmed",
      "ledger": "evm:421018",
      "txRef": "0xabc…",
      "receipt": { "txRef": "0xabc…" }
    }

    Path

    Ordered plan when a quote or execution is more than one hop. Field meanings and integrator rules: Settlement — Path.

    interface PathStep {
      readonly instrumentId: InstrumentId
      readonly venueId?: VenueId
      readonly ledger?: LedgerId
    }
    
    interface Path {
      readonly steps: readonly PathStep[]
    }

    Example: see Settlement — Path.

    SettlementStatus

    Progress after settlement.track. Same status vocabulary as the handle. Field meanings: Settlement — settlement.track.

    interface SettlementStepStatus {
      readonly index: number
      readonly status: ExecutionStatus
      readonly ledger?: LedgerId
      readonly txRef?: string
    }
    
    interface SettlementStatus {
      readonly id: string
      readonly status: ExecutionStatus
      readonly path?: Path
      readonly steps?: readonly SettlementStepStatus[]
      readonly updatedAt?: number
    }

    Example: see Settlement — settlement.track.


    Errors

    NutrimaticError

    Thrown by the SDK when a call cannot complete. Branch on code — full list: Errors.

    class NutrimaticError extends Error {
      readonly name: 'NutrimaticError'
      readonly code: NutrimaticErrorCode
      readonly message: string
    }

    Example:

    {
      "name": "NutrimaticError",
      "code": "PAIR_NOT_FOUND",
      "message": "Pair not found: 42-USDT"
    }

    NutrimaticErrorCode

    Stable string union used as NutrimaticError.code. See Errors — Common codes for meanings. Do not branch on MODULE_NOT_IMPLEMENTED.


    Config types

    Types you pass when creating the SDK — not returned by read operations.

    type IntegrationContext = 'client' | 'backend'
    
    interface NutrimaticSdkConfig {
      readonly apiBaseUrl?: string
      readonly ledgers: readonly LedgerRef[]
      readonly mode: 'read' | 'full'
      readonly integrationContext: IntegrationContext
      readonly wallet?: WalletAdapter
    }
    FieldRole
    apiBaseUrlOptional HTTPS host — default canonical Telemetry; override for test or your own Telemetry — Configuration
    ledgersRequired LedgerRef[] — validated at init
    mode'read' | 'full'Modes
    integrationContext'client' | 'backend'
    walletOptional WalletAdapter — writes + default owner when omitted

    Full field docs: Configuration.


    Related

    GoalStart here
    Fetch market viewsRead operations
    Charts / activity compositionChart windows · Activity feeds
    Quotes, swaps, LP, settlementWrite operations
    Balances, positions, stake, farmBalances · Positions · Staking · Farming
    Cost breakdown on a swap quoteFees and costs
    BYO signingWallet adapter
    Ledgers and IDsLedgers
    Failure codesErrors