Solaris AISolaris AI FlowDocs
Node ReferenceDeFi

Relay

Keyless Solana swaps, quotes, prices, and token search through Relay, with the platform fee inside the swap.

View as Markdown

Relay (relay.link) is a swap and bridge venue. The Relay node trades on Solana without any API key: prices, quotes, and token search need nothing connected, and swaps sign with your Privy wallet. Solaris AI's own apps trade on it. Bridging and other chains are not part of this version.

Prerequisites

  • No API key. Relay serves every operation without a credential. Canvas workflows run on Relay's public limits; Solaris AI's own key is used only by its apps, whose usage is metered.
  • Connected Privy wallet for swap (live mode).

Operations

OperationDescriptionRequires API keyRequires wallet
getPriceUSD price for one or more mintsNoNo
getQuotePreview a swap: output amount, minimum received, price impactNoNo
searchTokensFind tokens by symbol, name, or mint, fresh launches includedNoNo
swapExecute a swap from your wallet, platform fee inside the routeNoYes

getPrice

Give one or more mint addresses, comma-separated, up to 50 per node (a longer list is refused rather than cut short). The output is keyed by mint, the same shape the Jupiter node uses, so {relayResponse.data.<mint>.usdPrice} works either way. SOL is addressed by the wrapped-SOL mint So11111111111111111111111111111111111111112. A mint Relay cannot price returns null for that mint rather than failing the node.

getQuote

Quotes the exact trade a swap would run: from your wallet when the run has one, with the platform fee in the route, so the preview matches what a live swap fills at. data.priceImpact is a non-negative fraction of the trade lost to impact, so a Condition rule of less_than_or_equal 0.1 means "at most 10% impact". data.minOutAmount is the least you receive after slippage; data.appFee is the platform fee the route would take, in the input token's smallest unit.

searchTokens

Searches Relay's currency list, including tokens it has not verified, by symbol, name, or mint. Each row carries mint, symbol, name, decimals, and verified. Verified is a trust signal, not a tradability gate: an unverified mint can still be quoted and swapped.

swap

amount is the gross amount in the input token's smallest unit. The platform fee (0.4% of the input, less for SOLARIS holders) is a Relay app fee inside the same transaction, so there is no separate fee transfer and nothing to refund. Relay returns instructions rather than a landing service: the node builds the transaction with a fresh blockhash and a live priority fee, measures its compute by simulation, signs once, simulates the signed bytes, and resends those exact bytes until the chain confirms or the transaction expires. A swap that is still unconfirmed when the run's budget ends is reported with its signature and is never resent under a new signature: the node records every broadcast before sending it, and its next run checks that record against the chain before signing anything new, refusing while the earlier swap is still settling.

For very small orders in tokens other than SOL or USDC, Relay may be unable to collect the fee. The trade still executes; platformFeeCollected reports 0 in that case.

Dry run. With dryRun on, the node quotes and simulates without signing or broadcasting and routes no fee. Rehearsals always run swaps as dry runs.

Configuration

FieldTypeRequiredDescription
Response NametextYesName used by downstream nodes, such as {relayResponse.data}
inputMinttemplateFor getQuote and swapToken to sell, as a mint address
outputMinttemplateFor getQuote and swapToken to buy, as a mint address
amounttemplateFor getQuote and swapGross amount in the input token's smallest unit
slippageBpsnumberNoSlippage in basis points, 0-10000; default 100
tokenQuerytemplateFor getPrice and searchTokensMint list for price, or free text for search
dryRunboolean or templateNoSimulate the swap instead of executing it

Output

  • getPrice: data.<mint>.usdPrice
  • getQuote: data.inAmount, data.outAmount, data.minOutAmount, data.priceImpact, data.slippageBps, data.requestId, data.appFee
  • searchTokens: data[] rows with mint, symbol, name, decimals, verified
  • swap: signature, requestId, inAmount, outAmount, priceImpact, platformFeeCollected (what Relay's own request record says it credited; empty with feeAccountingPending: true only while Relay has not yet reached a terminal state for the request; a terminal success, failure, or refund is reported as-is in relayStatus with whatever was credited), platformFeeQuoted, platformFeeBps, plus dryRun and platformFeeWouldCollect on simulations

Fills are confirmed from the chain, so inAmount and outAmount on a live swap are what actually moved, not the quote. If the confirmed transaction cannot be read back within a few seconds, the node returns status: ConfirmedAccountingPending with the signature and empty amounts rather than substituting quoted numbers.

On this page