Skip to content

[PE-7272] Solana relay endpoints to do swaps direct through DBC - #13351

Merged
DejayJD merged 4 commits into
mainfrom
jd/meteora-dbc-swaps-relayonly
Oct 31, 2025
Merged

[PE-7272] Solana relay endpoints to do swaps direct through DBC#13351
DejayJD merged 4 commits into
mainfrom
jd/meteora-dbc-swaps-relayonly

Conversation

@DejayJD

@DejayJD DejayJD commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Context

We're seeing Jupiter have issues finding swap routes to our tokens
In the event this happens we can use the meteora DBC client directly to get a swap (after doing a swap to AUDIO first, but we already do this)

Description

  • This is just the solana relay & sdk changes
  • Adds new routes to solana relay for DBC swaps & quotes
    • They're not named anything specific to DBC bc my thinking is the same endpoint could be used for DAMMs as well if we want
  • Adds sdk methods to SolanaRelay

How Has This Been Tested?

Postman looking good, verified TX on explorer.solana.com
TODO: test with client once this ships (having issues with fee payers locally)

@changeset-bot

changeset-bot Bot commented Oct 31, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 49509bc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

})
return
}
// Inputs are all validated now 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thx robot

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

who you calling a robot - I wrote this myself lul

const currentPoint = await connection.getSlot()

// Get swap quote
// swapBaseForQuote: false means we're swapping quote (AUDIO) for base (artist token)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this gonna work with artist coin <-> artist coin swaps?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thats not what this endpoint does - this endpoint is solely for AUDIO-COIN

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

although that made me realize I think I actually set this up solely for buys - oop

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sg yeah can merge this first but we will probably wanna think about this for sells and swaps later. but i think buys is more important off the bat.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated to work both ways

@@ -0,0 +1,126 @@
import { DynamicBondingCurveClient } from '@meteora-ag/dynamic-bonding-curve-sdk'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems like opportunity for shared code here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

wdym - can you elaborate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can u re-use the quote logic in the swap endpoint?
or can we share the validation logic?
nbd tho i like wet

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah I dont see much point - the actual quote logic is one method (swapQuote) - the rest is just setting up dependencies and I don't see much point in reusing that tbh

@dylanjeffers dylanjeffers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice work. naming wise, since this is meteora specific, do we want that out in solana-relay? or we thinking this is a first class thing someone could use exclusively, and we happen to use it as a fallback?


// Get swap quote
// swapBaseForQuote: false means we're swapping quote (AUDIO) for base (artist token)
const swapQuote = await dbcClient.pool.swapQuote({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any point in using "getSwapQuote" in this route since it's quite similar up to this point?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if you mean the other route logic I added? Same as I said to reed there's not much point tbh

@DejayJD

DejayJD commented Oct 31, 2025

Copy link
Copy Markdown
Contributor Author

nice work. naming wise, since this is meteora specific, do we want that out in solana-relay? or we thinking this is a first class thing someone could use exclusively, and we happen to use it as a fallback?

I like the idea, I updated to use meteora in the naming.
Also re: "this is meteora specific" - all of launchpad is meteora specific so I dont see why this would be any different

@DejayJD
DejayJD merged commit 42ff097 into main Oct 31, 2025
6 of 8 checks passed
@DejayJD
DejayJD deleted the jd/meteora-dbc-swaps-relayonly branch October 31, 2025 23:47
audius-infra pushed a commit that referenced this pull request Nov 3, 2025
[42ff097] [PE-7272] Solana relay endpoints to do swaps direct through DBC (#13351) JD Francis
[98da331] Claim vested coins flow QA (#13335) Reed
[c156f12] Skip unrecognized challenge_ids (#13315) Ray Jacobson
[5679e39] [API-369] Skip ratio check for dvl challenge (#13349) Randy Schott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants