This could be a simple no, but any answer here would help.
Is there any way of getting quotes from express relay, getting the swap instruction data, then executing it on the express relay solana contract (PytERJFhAKuNNuaiXkApLfWzwNwSNDACpigT3LwQfou) from within ours.
We integrate with Jupiters /swap-instructions API method currently, which gives us swap data we can use to directly invoke a swap via their aggregator program from within our contract.
Are we able to use express relay in the same way, via CPI? It has better prices on a lot of pairs, mainly xStocks.
Right now this is not possible, because the API to request a swap transaction has the swap as an instruction. It would be fairly difficult to invoke a swap via CPI without explicit inputs, since the transaction needs to be signed by multiple parties. One could in theory craft a transaction with set inputs and a CPI to the swap instruction, but this would require a lot of change on the API. Given the main focus of ER has been for retail swaps, this wasn’t incorporated into the original design.
I get an error 401 when trying to test the API to receive a quote, not sure why this is - I used the example in the docs. Thoughts on that too?
So, there is no way to use it via CPI then, correct? What do you mean with “It would be fairly difficult to invoke a swap via CPI without explicit inputs, since the transaction needs to be signed by multiple parties. One could in theory craft a transaction with set inputs and a CPI to the swap instruction, but this would require a lot of change on the API.” - clarification on this would be super helpful.