Skip to main content

Swaps and conversion

Move an organization balance between supported crypto assets and networks.

Radom exposes two distinct surfaces, and they are not interchangeable:

  • Swaps/swap/*. General asset movement between supported networks and tokens.
  • Conversion/conversion/eurc. A single dedicated route for USDC to EURC.
Retired endpoints

The legacy RFQ conversion endpoints (/conversion/pairs, /conversion/quote, /conversion/accept) no longer exist. If you integrated against them, migrate to /swap/* as described below.

Before you start

  • An active Radom organization with a funded balance in the source asset.

  • An API token from the Developer API tokens page in the Radom Dashboard.

Every request below sends the token in the Authorization header. There is no Bearer prefix — send the raw token value:

Authorization: <RADOM_API_TOKEN>
Content-Type: application/json

Swaps

PurposeMethodEndpoint
List supported source assetsGET/swap/supported_assets
List valid targets for a sourcePOST/swap/supported_targets
Preview the output amountPOST/swap/quote
Execute the swapPOST/swap
Retrieve a swap by idGET/swap/{id}

Both /swap and /swap/quote take the same body: a from asset, an into asset, and a numeric amount. An asset is a network plus, for non-native tokens, a token contract address.

1. List supported source assets

curl -X GET "https://api.radom.com/swap/supported_assets" \
-H "Authorization: <RADOM_API_TOKEN>"

2. List valid targets for that source

Call this before showing a destination picker, so you never offer a route that cannot execute.

curl -X POST "https://api.radom.com/swap/supported_targets" \
-H "Authorization: <RADOM_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"from": {
"network": "Ethereum",
"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
}
}'

3. Preview the output amount

curl -X POST "https://api.radom.com/swap/quote" \
-H "Authorization: <RADOM_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"from": {
"network": "Ethereum",
"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
},
"into": {
"network": "Base",
"token": "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca"
},
"amount": 100.00
}'

amount is a number, not a string. A quote is an estimate — the executed amount can differ, so quote immediately before executing.

4. Execute the swap

Same body as the quote, sent to /swap.

curl -X POST "https://api.radom.com/swap" \
-H "Authorization: <RADOM_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"from": {
"network": "Ethereum",
"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
},
"into": {
"network": "Base",
"token": "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca"
},
"amount": 100.00
}'

A successful response means Radom accepted the request, not that the swap has settled. Poll GET /swap/{id} to follow it.

5. Track the swap to a terminal state

curl -X GET "https://api.radom.com/swap/<SWAP_ID>" \
-H "Authorization: <RADOM_API_TOKEN>"
StatusMeaningTerminal
PendingAccepted, not yet startedNo
InitiatedIn progressNo
FinalizedCompleted successfullyYes
FailedDid not completeYes

Only treat Finalized as success. Do not release goods, credit a customer, or trigger downstream payouts on Pending or Initiated.

Conversion: USDC to EURC

/conversion/eurc is a dedicated route with a different body shape from the swap endpoints. It converts USDC on Ethereum or Base into EURC on Solana.

curl -X POST "https://api.radom.com/conversion/eurc" \
-H "Authorization: <RADOM_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"from_network": "Ethereum",
"fromAmount": "100.00"
}'

Two things differ from /swap and are easy to get wrong:

  • from_network is snake_case, while fromAmount is camelCase.
  • fromAmount is a string, whereas the swap endpoints take a numeric amount.

from_network accepts only Ethereum or Base. Any other value returns 400. The destination is always EURC on Solana and is not configurable.

Best practices

  • Fetch supported sources and targets before rendering a route, rather than validating after the fact.
  • Quote immediately before executing so the user sees a current estimate.
  • Treat an unsupported-pair error as final for that route until the supported asset list changes.
  • Reconcile on GET /swap/{id} reaching Finalized, not on the response to POST /swap.
  • Store API tokens as secrets and rotate them periodically.

Reference