1
Get a quote
Price the swap. You get back the best route across every venue plus an opaque
quoteToken.
The two addresses are well-formed placeholders, so the call runs as-is: nobody holds their
keys, so funds sent to them are lost. Add -H 'x-api-key: rvn_live_…' to quote with your fee.2
Execute
Hand the
quoteToken back. RAVN returns how to complete the swap, tagged by executionType.3
Complete it
Branch on
executionType. This is the entire client-side contract, unless you quote with
broadcastViaRavn: then a TRANSACTION carrying submit is signed
and posted to /submit-transaction, never broadcast.The code from here to the end of step 4 is one Node script for an EVM wallet. It quotes the
same swap from that wallet, then sends exactly what RAVN returns, for real. Save it as
quickstart.mjs, npm install viem, and run it with Node 20+:
PRIVATE_KEY=0x… SOL_DESTINATION=<your Solana wallet> RAVN_API_KEY=rvn_live_… node quickstart.mjs
(the key is optional, and needed only for your fee). Add SANDBOX=1 for a test run that
sends and signs nothing, with any throwaway PRIVATE_KEY.4
Track it
Poll Poll every swap to a final status. That poll is what marks the swap settled in RAVN’s
ledger, and only settled swaps count toward a fee payout. See Settlement.
status with the quoteToken that execute returned (not the one from step 1), and as
ref: the statusRef from execute (DEPOSIT, and TRANSACTION when present), the
statusRef from submit-signature (SIGNATURE), or otherwise the transaction hash you
broadcast (TRANSACTION). When you sent a fee payment, pass its hash as txHash on every poll.Amounts are strings in the token’s smallest unit. Native coin uses the sentinel
0xEeee...EEeE. The quoteToken is opaque, so never parse it. It expires, so re-quote if it
goes stale.
