Skip to content

Solana Indexer DBC pool improvements#485

Merged
rickyrombo merged 9 commits into
mainfrom
mjp-ff
Oct 20, 2025
Merged

Solana Indexer DBC pool improvements#485
rickyrombo merged 9 commits into
mainfrom
mjp-ff

Conversation

@rickyrombo

Copy link
Copy Markdown
Contributor
  • Clamp graduation progress at 1.0
  • Remove DBC pool from create coin endpoint
  • Track DBC pool using memcmp filters and artist coin base mints
  • Track DBC VolatilityTracker (for completeness) and Metrics (for fees)

pool TEXT PRIMARY KEY,
slot BIGINT NOT NULL,
last_update_timestamp BIGINT NOT NULL,
volatility_accumulator NUMERIC NOT NULL,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't use dynamic fees, but i guess we can track this

Filter: &pb.SubscribeRequestFilterAccountsFilter_Memcmp{
Memcmp: &pb.SubscribeRequestFilterAccountsFilterMemcmp{
// Base mint is after discriminator, VolatilityTracker, config and creator
Offset: 8 + (8 + 8 + 16 + 16 + 16) + 32 + 32,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's an interesting gpt suggestion to avoid magic

package dbc

import (
	"bytes"

	bin "github.com/gagliardetto/binary"
	"github.com/gagliardetto/solana-go"
	"api.audius.co/solana/spl/programs/meteora_dbc"
)

// Mirror exactly the fields that appear BEFORE BaseMint in the on-chain Pool layout.
// IMPORTANT: order and types must match the Borsh schema used on-chain!
type poolPrefixBeforeBaseMint struct {
	VolatilityTracker meteora_dbc.VolatilityTracker
	Config            solana.PublicKey
	Creator           solana.PublicKey
}

func borshSize[T any](v T) int {
	var buf bytes.Buffer
	enc := bin.NewBorshEncoder(&buf)
	_ = enc.Encode(v) // layout is known; errors here would mean schema mismatch
	return buf.Len()
}

var OffsetBaseMintInPool int

func init() {
	const anchorDiscriminatorSize = 8
	OffsetBaseMintInPool = anchorDiscriminatorSize + borshSize(poolPrefixBeforeBaseMint{})
}

Comment thread api/v1_create_coin.go
@@ -76,7 +75,6 @@ func (app *ApiServer) v1CreateCoin(c *fiber.Ctx) error {
"name": body.Name,
"logo_uri": body.LogoUri,
"description": body.Description,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill open a PR to remove FE

Comment thread solana/indexer/dbc/dbc.go
return err
}

func upsertDbcPoolVolatilityTracker(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also not necessary, but doesn't hurt

@rickyrombo rickyrombo merged commit 7992a2d into main Oct 20, 2025
5 checks passed
@rickyrombo rickyrombo deleted the mjp-ff branch October 20, 2025 18:51
raymondjacobson added a commit to AudiusProject/apps that referenced this pull request Oct 20, 2025
### Description

Follows AudiusProject/api#485

Also add environment to sdk verifyuser script

### How Has This Been Tested?

_Please describe the tests that you ran to verify your changes. Provide
repro instructions & any configuration._

gen:dev
types pass
raymondjacobson added a commit to AudiusProject/apps that referenced this pull request Oct 20, 2025
### Description

Follows AudiusProject/api#485

Also add environment to sdk verifyuser script

### How Has This Been Tested?

_Please describe the tests that you ran to verify your changes. Provide
repro instructions & any configuration._

gen:dev
types pass
raymondjacobson added a commit to AudiusProject/apps that referenced this pull request Oct 20, 2025
### Description

Follows AudiusProject/api#485

Also add environment to sdk verifyuser script

### How Has This Been Tested?

_Please describe the tests that you ran to verify your changes. Provide
repro instructions & any configuration._

gen:dev
types pass
raymondjacobson added a commit to AudiusProject/apps that referenced this pull request Oct 20, 2025
### Description

Follows AudiusProject/api#485

Also add environment to sdk verifyuser script

### How Has This Been Tested?

_Please describe the tests that you ran to verify your changes. Provide
repro instructions & any configuration._

gen:dev
types pass
schottra added a commit that referenced this pull request Oct 24, 2025
* main:
  Add logo_uri to user coin (#487)
  [PE-7200] Add wallet coins endpoint (#486)
  Solana Indexer DBC pool improvements (#485)
  Remove log line (#484)
  Don't update DBC pool address from job to prevent spam to slack (#483)
  Refactor Solana Indexer, Support DAMM V2 (#473)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants