Multi-chain surfaces
Boson is deployed to multiple chains. Each chain has its own Diamond, its own subgraph, and its own seller / offer ID space. A marketplace that surfaces offers from multiple chains must index each independently and reconcile in its application layer.
Pattern: one SDK instance per chain
const chains = ["production-137-0", "production-8453-0", "production-42161-0"] as const
const sdks = Object.fromEntries(
chains.map(c => [c, CoreSDK.fromDefaultConfig({
web3Lib: readOnlyAdapter,
envName: "production", // matches the env prefix of each configId above
configId: c,
})]),
) as Record<typeof chains[number], CoreSDK>
async function getAllActiveOffers() {
const results = await Promise.all(
chains.map(c => sdks[c].getOffers({ where: { voided: false } })),
)
return results.flatMap((offers, i) => offers.map(o => ({ ...o, chain: chains[i] })))
}Display considerations
- Show the chain on every offer card. Users care.
- Don't merge IDs across chains. Always carry the
configIdalongside the offer ID. - Bridge currencies in the UI — show USD-equivalent if the buyer's wallet is on a different chain than the offer.
Common gotchas
- A buyer on Polygon can't commit to an offer on Base without bridging.
- Subgraph health varies per chain. Health-check each separately; route around a stale subgraph by reading from RPC.
- Gas estimates vary wildly. Mainnet > L2s by ~100×. Surface this in commit-button copy.