From 07b7be36c67577fc38a9fea11963fac8716401ab Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Mon, 10 Nov 2025 00:33:32 -0500 Subject: [PATCH 1/3] Add direct listing flag to coins --- api/v1_coins.go | 10 ++++++++-- .../0184_add_artist_coins_direct_listing.sql | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 ddl/migrations/0184_add_artist_coins_direct_listing.sql diff --git a/api/v1_coins.go b/api/v1_coins.go index 5e5368eb..a29dca4c 100644 --- a/api/v1_coins.go +++ b/api/v1_coins.go @@ -166,8 +166,14 @@ const sharedSelectCoinSql = ` 'address', COALESCE(artist_coin_pools.address, ''), 'price', COALESCE(artist_coin_pools.price, 0), 'priceUSD', COALESCE(artist_coin_pools.price_usd, 0), - 'curveProgress', COALESCE(artist_coin_pools.curve_progress, 0), - 'isMigrated', COALESCE(artist_coin_pools.is_migrated, false), + 'curveProgress', CASE + WHEN artist_coins.direct_listing = true THEN 1 + ELSE COALESCE(artist_coin_pools.curve_progress, 0) + END, + 'isMigrated', CASE + WHEN artist_coins.direct_listing = true THEN true + ELSE COALESCE(artist_coin_pools.is_migrated, false) + END, 'creatorQuoteFee', COALESCE(artist_coin_pools.creator_quote_fee, 0), 'totalTradingQuoteFee', COALESCE(artist_coin_pools.total_trading_quote_fee, 0), 'creatorWalletAddress', COALESCE(artist_coin_pools.creator_wallet_address, '') diff --git a/ddl/migrations/0184_add_artist_coins_direct_listing.sql b/ddl/migrations/0184_add_artist_coins_direct_listing.sql new file mode 100644 index 00000000..5bdb2905 --- /dev/null +++ b/ddl/migrations/0184_add_artist_coins_direct_listing.sql @@ -0,0 +1,7 @@ +begin; + +alter table artist_coins add column if not exists direct_listing boolean not null default false; + +comment on column artist_coins.direct_listing is 'Whether this coin was directly listed (bypassing the bonding curve). When true, curveProgress should be 1 and isMigrated should be true.'; + +commit; From 4cb753d68fb573e9822ced0f86ad5d93043ca367 Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Mon, 10 Nov 2025 00:38:29 -0500 Subject: [PATCH 2/3] Update test schema --- sql/01_schema.sql | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sql/01_schema.sql b/sql/01_schema.sql index 50b557c0..56b2fa00 100644 --- a/sql/01_schema.sql +++ b/sql/01_schema.sql @@ -2,9 +2,8 @@ -- PostgreSQL database dump -- - --- Dumped from database version 17.6 (Debian 17.6-1.pgdg13+1) --- Dumped by pg_dump version 17.6 (Debian 17.6-1.pgdg13+1) +-- Dumped from database version 17.5 (Debian 17.5-1.pgdg120+1) +-- Dumped by pg_dump version 17.5 (Debian 17.5-1.pgdg120+1) SET statement_timeout = 0; SET lock_timeout = 0; @@ -6061,7 +6060,8 @@ CREATE TABLE public.artist_coins ( link_2 text, link_3 text, link_4 text, - damm_v2_pool text + damm_v2_pool text, + direct_listing boolean DEFAULT false NOT NULL ); @@ -6079,6 +6079,13 @@ COMMENT ON TABLE public.artist_coins IS 'Stores the token mints for artist coins COMMENT ON COLUMN public.artist_coins.damm_v2_pool IS 'The canonical DAMM V2 pool address for this artist coin, if any. Used in solana indexer.'; +-- +-- Name: COLUMN artist_coins.direct_listing; Type: COMMENT; Schema: public; Owner: - +-- + +COMMENT ON COLUMN public.artist_coins.direct_listing IS 'Whether this coin was directly listed (bypassing the bonding curve). When true, curveProgress should be 1 and isMigrated should be true.'; + + -- -- Name: sol_meteora_damm_v2_pools; Type: TABLE; Schema: public; Owner: - -- @@ -12251,4 +12258,3 @@ ALTER TABLE ONLY public.users -- PostgreSQL database dump complete -- - From 486c2335b40704f18bf1ed82806f1cbf7ad3bb2a Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Mon, 10 Nov 2025 01:03:37 -0500 Subject: [PATCH 3/3] Use dammv2 column --- api/v1_coins.go | 4 ++-- .../0184_add_artist_coins_direct_listing.sql | 7 ------- sql/01_schema.sql | 16 +++++----------- 3 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 ddl/migrations/0184_add_artist_coins_direct_listing.sql diff --git a/api/v1_coins.go b/api/v1_coins.go index a29dca4c..9a980ee2 100644 --- a/api/v1_coins.go +++ b/api/v1_coins.go @@ -167,11 +167,11 @@ const sharedSelectCoinSql = ` 'price', COALESCE(artist_coin_pools.price, 0), 'priceUSD', COALESCE(artist_coin_pools.price_usd, 0), 'curveProgress', CASE - WHEN artist_coins.direct_listing = true THEN 1 + WHEN artist_coins.damm_v2_pool IS NOT NULL THEN 1 ELSE COALESCE(artist_coin_pools.curve_progress, 0) END, 'isMigrated', CASE - WHEN artist_coins.direct_listing = true THEN true + WHEN artist_coins.damm_v2_pool IS NOT NULL THEN true ELSE COALESCE(artist_coin_pools.is_migrated, false) END, 'creatorQuoteFee', COALESCE(artist_coin_pools.creator_quote_fee, 0), diff --git a/ddl/migrations/0184_add_artist_coins_direct_listing.sql b/ddl/migrations/0184_add_artist_coins_direct_listing.sql deleted file mode 100644 index 5bdb2905..00000000 --- a/ddl/migrations/0184_add_artist_coins_direct_listing.sql +++ /dev/null @@ -1,7 +0,0 @@ -begin; - -alter table artist_coins add column if not exists direct_listing boolean not null default false; - -comment on column artist_coins.direct_listing is 'Whether this coin was directly listed (bypassing the bonding curve). When true, curveProgress should be 1 and isMigrated should be true.'; - -commit; diff --git a/sql/01_schema.sql b/sql/01_schema.sql index 56b2fa00..50b557c0 100644 --- a/sql/01_schema.sql +++ b/sql/01_schema.sql @@ -2,8 +2,9 @@ -- PostgreSQL database dump -- --- Dumped from database version 17.5 (Debian 17.5-1.pgdg120+1) --- Dumped by pg_dump version 17.5 (Debian 17.5-1.pgdg120+1) + +-- Dumped from database version 17.6 (Debian 17.6-1.pgdg13+1) +-- Dumped by pg_dump version 17.6 (Debian 17.6-1.pgdg13+1) SET statement_timeout = 0; SET lock_timeout = 0; @@ -6060,8 +6061,7 @@ CREATE TABLE public.artist_coins ( link_2 text, link_3 text, link_4 text, - damm_v2_pool text, - direct_listing boolean DEFAULT false NOT NULL + damm_v2_pool text ); @@ -6079,13 +6079,6 @@ COMMENT ON TABLE public.artist_coins IS 'Stores the token mints for artist coins COMMENT ON COLUMN public.artist_coins.damm_v2_pool IS 'The canonical DAMM V2 pool address for this artist coin, if any. Used in solana indexer.'; --- --- Name: COLUMN artist_coins.direct_listing; Type: COMMENT; Schema: public; Owner: - --- - -COMMENT ON COLUMN public.artist_coins.direct_listing IS 'Whether this coin was directly listed (bypassing the bonding curve). When true, curveProgress should be 1 and isMigrated should be true.'; - - -- -- Name: sol_meteora_damm_v2_pools; Type: TABLE; Schema: public; Owner: - -- @@ -12258,3 +12251,4 @@ ALTER TABLE ONLY public.users -- PostgreSQL database dump complete -- +