-
Notifications
You must be signed in to change notification settings - Fork 18
[docs-agent] Add Solana Trader API docs (REST spec, overview, nav) #1620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alchemy-bot
wants to merge
4
commits into
main
Choose a base branch
from
docs/solana-trader-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
800e942
[docs-agent] Add Solana Trader API docs (REST spec, overview, nav)
alchemy-bot 337c818
[docs-agent] Flatten Solana Trader API sidebar (drop operation tags)
alchemy-bot fab6e25
[docs-agent] Solana Trader API spec review pass (vlad's nits)
alchemy-bot ac653fb
[docs-agent] Drop 4xx/5xx responses on /build and /quote-multiple-out…
alchemy-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
content/api-reference/solana/solana-trader-api-overview.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| title: Solana Trader API | ||
| description: Alchemy's REST endpoints for pricing and building Solana token swaps. | ||
| subtitle: Alchemy's REST endpoints for pricing and building Solana token swaps. | ||
| --- | ||
|
|
||
| ## Background | ||
|
|
||
| The Solana Trader API returns swap quotes and, on request, an assembled | ||
| transaction that a taker can sign and broadcast. Use it to price a swap ahead | ||
| of time, present a route to a user, or hand a signable transaction to a | ||
| wallet. Requests use the same Alchemy API key as your other Solana calls. | ||
|
|
||
| Alchemy routes Trader API requests through [Metis](https://station.jup.ag/blog/jupiter-swap-v2-metis), the routing engine that powers Jupiter's Swap V2 `/order` endpoint. If you have already integrated Jupiter's contract, the response shape here will feel familiar. Two differences worth calling out: | ||
|
|
||
| * Alchemy carries auth in the URL path (see [Endpoint](#endpoint)), not in an `x-api-key` header. | ||
| * `/quote-multiple-output-mints` is an Alchemy-specific endpoint that returns quotes for one input mint against up to 32 candidate output mints in a single request. | ||
|
|
||
| The API exposes three endpoints: | ||
|
|
||
| * `GET /order` returns a swap quote. Pass a `taker` to also receive an unsigned base64 transaction; omit `taker` for a quote-only response. | ||
| * `GET /build` returns raw swap instructions for composing into your own transaction (multi-leg flows, program deposits, cleanup steps). | ||
| * `POST /quote-multiple-output-mints` returns quotes for a single input against up to 32 output mints in one call. | ||
|
|
||
| ## Endpoint | ||
|
|
||
| Solana Trader API is available on **Solana Mainnet** through the standard Alchemy Solana endpoint. Devnet is not supported. | ||
|
|
||
| ```text | ||
| https://solana-mainnet.g.alchemy.com/v2/{apiKey} | ||
| ``` | ||
|
|
||
| Use your Solana Mainnet API key from the [Alchemy Dashboard](https://dashboard.alchemy.com/apps). The `docs-demo` key powers the Try It widget on the method pages below. | ||
|
|
||
| ## Methods | ||
|
|
||
| | Method | Function | CU cost | Throughput CUs (how many CUs this will count for towards your CUs per second capacity) | | ||
| | --- | --- | --- | --- | | ||
| | [GET /order](/docs/chains/solana/solana-trader-api/solana-trader-api/get-swap-order) | Get a swap quote. Include a `taker` to also receive an unsigned base64 transaction; omit `taker` for quote fields only. | 100 | 100 | | ||
| | [GET /build](/docs/chains/solana/solana-trader-api/solana-trader-api/build-swap-instructions) | Return raw swap instructions for composing into your own transaction. | 100 | 100 | | ||
| | [POST /quote-multiple-output-mints](/docs/chains/solana/solana-trader-api/solana-trader-api/quote-multiple-output-mints) | Quote a single input mint against up to 32 candidate output mints in one call. | 100 | 100 | | ||
|
|
||
| ## Related | ||
|
|
||
| * [`sendTransaction`](/docs/chains/solana/solana-api-endpoints/send-transaction) — submit the signed transaction returned by `/order` to the cluster. | ||
| * [Solana Jito Bundles and Transactions](/docs/chains/solana/solana-jito-bundles-and-transactions) — pair a signed swap with a Jito tip for atomic, low-latency inclusion. | ||
| * [Solana API Overview](/docs/solana/solana-api-overview) — the full Solana JSON-RPC surface. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update all three links to match the routes generated by the current content indexer. Because each operation's first tag is
Solana Trader API Endpoints,buildOperationPathinsertssolana-trader-api-endpointsbetween the API slug and operation ID; without aninclude-tagsconfiguration that removes the tag, the listed/solana-trader-api/<operation>targets are not indexed and will return 404, while the generated pages live under/solana-trader-api/solana-trader-api-endpoints/<operation>.Useful? React with 👍 / 👎.