Skip to Content
Symmio Trading-SDK — the SDK surface for builders on Arbitrum
CorePoolsgetWeeklyListingLimit

getWeeklyListingLimit

Fetch the protocol’s remaining new-market listings for the current rolling weekly window — how many pools may still be listed across the protocol before the window resets. It is a public read: no accessToken, resolved from the config, safe to read before sign-in. The cap is global, not per user.

Check this before addMarket. The service caps how many pools may be created protocol-wide per week. When remaining is 0 the cap is spent — the UI must block creating another pool until resetAt, not just let the write fail. addMarket’s own weekly-limit rejection surfaces as an ADD_MARKET_FAILED after a round-trip; reading this first lets you disable the Create button and explain why up front.

import { getWeeklyListingLimit } from "@symmio/trading-core"; const { limit, remaining, resetAt } = await getWeeklyListingLimit(config); if (remaining <= 0) { // block create-pool until `resetAt` (a Unix timestamp) }

This is a REST read against the listing backend, not a contract call, and it is public — no accessToken. The backend is resolved from the config before the request, so a target without Pools fails immediately and without any network traffic — see resolveListingService. Pools is Enigma-only today.

Parameters

Both fields are optional — with neither, the config’s default chain and that chain’s default solver resolve the listing backend.

chainIdnumberoptional

Target chain id. Defaults to the config’s defaultChainId. Selects which chain’s listing backend is used, and is folded into the query key.

Returns

Promise<WeeklyListingLimit>
limitnumber

Total new-market listings allowed per rolling weekly window.

remainingnumber

Listings still available in the current window. 0 means no more pools can be listed until the window resets — gate the create-pool flow on this.

resetAtnumber

When the window resets, as the Unix timestamp the service returns. Show it in the “limit reached” message so the user knows when a pool can be listed again.

Query options

import { getWeeklyListingLimitQueryOptions } from "@symmio/trading-core"; import { useQuery } from "@tanstack/react-query"; useQuery(getWeeklyListingLimitQueryOptions(config));

GetWeeklyListingLimitOptions is the action’s parameters plus a query bag of TanStack overrides. The factory folds config.getChainConfigKey(chainId) into the key; getWeeklyListingLimitQueryKey builds the same key for cache matching and invalidation. GetWeeklyListingLimitData is what the query resolves to (the same WeeklyListingLimit), GetWeeklyListingLimitReturnType is the action’s return alias, and GetWeeklyListingLimitQueryOptions is the options bag it produces. toWeeklyListingLimit maps the raw service response into the normalized WeeklyListingLimit for callers driving the request themselves.

Throws

  • LISTING_NOT_CONFIGURED — a SymmError (kind: "config") when the chain has no listing backend configured. Gate with supportsListingService to hide Pools instead of erroring. Only chains with a listing backend have Pools.
  • FETCH_WEEKLY_LISTING_LIMIT_FAILED — the request itself failed. Any axios failure becomes a SymmApiError carrying status, statusText, responseData, url and method; a non-axios throw becomes a plain SymmError (kind: "api") with the original error as its cause.
Last updated on