[PE-7272] Solana relay endpoints to do swaps direct through DBC - #13351
Conversation
|
| }) | ||
| return | ||
| } | ||
| // Inputs are all validated now 👍 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
is this gonna work with artist coin <-> artist coin swaps?
There was a problem hiding this comment.
thats not what this endpoint does - this endpoint is solely for AUDIO-COIN
There was a problem hiding this comment.
although that made me realize I think I actually set this up solely for buys - oop
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
updated to work both ways
| @@ -0,0 +1,126 @@ | |||
| import { DynamicBondingCurveClient } from '@meteora-ag/dynamic-bonding-curve-sdk' | |||
There was a problem hiding this comment.
seems like opportunity for shared code here
There was a problem hiding this comment.
wdym - can you elaborate
There was a problem hiding this comment.
can u re-use the quote logic in the swap endpoint?
or can we share the validation logic?
nbd tho i like wet
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
any point in using "getSwapQuote" in this route since it's quite similar up to this point?
There was a problem hiding this comment.
if you mean the other route logic I added? Same as I said to reed there's not much point tbh
I like the idea, I updated to use meteora in the naming. |
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
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)