From fdc779b336f43d29d027bc1b5c97162bfef24108 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Fri, 17 Oct 2025 11:32:31 -0700 Subject: [PATCH 1/2] Don't update DBC pool address from job to prevent spam to slack --- jobs/coin_dbc.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/jobs/coin_dbc.go b/jobs/coin_dbc.go index 7c0224e9..c67fa205 100644 --- a/jobs/coin_dbc.go +++ b/jobs/coin_dbc.go @@ -179,11 +179,6 @@ func (j *CoinDBCJob) UpdatePool(ctx context.Context, poolPubkey solana.PublicKey j.logger.Error("error inserting pool", zap.Error(err)) return fmt.Errorf("error inserting pool: %w", err) } - err = j.UpdateCoinDbcPool(ctx, pool.BaseMint.String(), poolPubkey.String()) - if err != nil { - j.logger.Error("error updating coin dbc_pool", zap.Error(err)) - return fmt.Errorf("error updating coin dbc_pool: %w", err) - } return nil } @@ -278,15 +273,3 @@ func (j *CoinDBCJob) UpsertPool( }) return err } - -func (j *CoinDBCJob) UpdateCoinDbcPool(ctx context.Context, mint string, dbcPool string) error { - _, err := j.pool.Exec(ctx, ` - UPDATE artist_coins - SET dbc_pool = @dbc_pool - WHERE mint = @mint - `, pgx.NamedArgs{ - "mint": mint, - "dbc_pool": dbcPool, - }) - return err -} From ce650eb9fe1d6248920682b98668942f141d66a5 Mon Sep 17 00:00:00 2001 From: Marcus Pasell <3690498+rickyrombo@users.noreply.github.com> Date: Fri, 17 Oct 2025 11:38:03 -0700 Subject: [PATCH 2/2] add dbc_pool to create coin api --- api/swagger/swagger-v1.yaml | 5 +++++ api/v1_create_coin.go | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/swagger/swagger-v1.yaml b/api/swagger/swagger-v1.yaml index e83d4342..4a0bc310 100644 --- a/api/swagger/swagger-v1.yaml +++ b/api/swagger/swagger-v1.yaml @@ -5664,6 +5664,7 @@ components: - ticker - decimals - name + - dbc_pool properties: mint: type: string @@ -5691,6 +5692,10 @@ components: type: string description: The description of the coin example: "A majestic bear token for wildlife conservation" + dbc_pool: + type: string + description: The address of the dynamic bonding curve pool associated with the coin + example: "2AAsAwNPTNBk5N466xyPiwqdgbc5WLbDTdnn9gVuDKaN" create_coin_response: type: object properties: diff --git a/api/v1_create_coin.go b/api/v1_create_coin.go index e3aa8da7..a9a63c24 100644 --- a/api/v1_create_coin.go +++ b/api/v1_create_coin.go @@ -19,6 +19,7 @@ type CreateCoinBody struct { Name string `json:"name" validate:"required,min=1,max=32"` LogoUri string `json:"logo_uri" validate:"omitempty,url"` Description string `json:"description" validate:"max=2500"` + DbcPool string `json:"dbc_pool"` } func (app *ApiServer) v1CreateCoin(c *fiber.Ctx) error { @@ -62,8 +63,8 @@ func (app *ApiServer) v1CreateCoin(c *fiber.Ctx) error { } sql := ` - INSERT INTO artist_coins (mint, ticker, user_id, decimals, name, logo_uri, description) - VALUES (@mint, @ticker, @user_id, @decimals, @name, @logo_uri, @description) + INSERT INTO artist_coins (mint, ticker, user_id, decimals, name, logo_uri, description, dbc_pool) + VALUES (@mint, @ticker, @user_id, @decimals, @name, @logo_uri, @description, @dbc_pool) RETURNING mint, ticker, user_id, decimals, name, logo_uri, description, created_at ` @@ -75,6 +76,7 @@ func (app *ApiServer) v1CreateCoin(c *fiber.Ctx) error { "name": body.Name, "logo_uri": body.LogoUri, "description": body.Description, + "dbc_pool": body.DbcPool, }) var result struct {