From 5078b6b1ef12b3c45bcd9b29e01cdc13516dbd81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Tue, 2 Jul 2024 12:44:24 +0200 Subject: [PATCH] fallback openbook market if there is only one --- utils/governance/listingTools.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/utils/governance/listingTools.ts b/utils/governance/listingTools.ts index c77aac3e..770b3d77 100644 --- a/utils/governance/listingTools.ts +++ b/utils/governance/listingTools.ts @@ -232,6 +232,16 @@ export const getBestMarket = async ({ if (!markets.length) { return undefined } + + if (markets.length === 1) { + notify({ + title: 'Only one openbook market exists check it carefully', + description: ``, + type: 'error', + }) + return markets[0].publicKey + } + const marketsDataJsons = await Promise.all([ ...markets.map((x) => fetch(`/openSerumApi/market/${x.publicKey.toBase58()}`),