Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Search & discovery · Boson Protocol
Skip to content

Search & discovery

The Core SDK's Marketplace and Search mixins layer on top of the subgraph to give you typed, paginated, faceted access to offers.

// All active offers from any seller, sorted by created-at descending
const offers = await sdk.searchOffers({
  filter: {
    state: "ACTIVE",          // derived: voided=false, validUntilDate>now, qty>0
    exchangeToken: USDC_ADDRESS,
    priceRange: { min: "0", max: "100000000" },
  },
  sort: { field: "createdAt", order: "desc" },
  pagination: { first: 50, skip: 0 },
})
 
// Faceted aggregationcounts by seller
const facets = await sdk.facetOffers({
  facet: "seller",
  filter: { state: "ACTIVE" },
})

Indexing & lag

All queries hit the subgraph — 1–3 block lag. For real-time inventory checks (e.g. "can a buyer still commit?"), confirm quantityAvailable from the Diamond directly.

Common patterns

  • Browse by category — encode categories as productV1.tags in metadata; index in your own search service.
  • Rank by social signal — combine subgraph data with off-chain signals (favorites, views) in your application layer.
  • "New" badge — offers with createdAt > now - 7d.

Next