Skip to Content

Get Transaction Quote

Before submitting a transaction, you can request a quote to estimate the cost in USD and the minimum balance required. This helps you understand the transaction cost upfront and ensure your account has sufficient balance.

Endpoint

POST https://api.tachyon.rath.fi/api/quote

Request Body

ParameterTypeRequiredDescription
chainIdnumberYesThe blockchain network ID where the transaction will be executed
tostringYesThe recipient wallet address or smart contract address. Format varies by chain (hex for EVM, base58 for Solana, named for NEAR)
valuestringNoAmount of native currency to send in the smallest unit (wei for EVM, lamports for Solana, yoctoNEAR for NEAR, MIST for Sui). Defaults to ‘0’
callDatastringYesEncoded transaction data in hexadecimal format (use ‘0x’ for simple transfers)
labelstringNoOptional human-readable label for tracking
gasLimitstringNoOptional gas limit for the transaction. Required for Aptos and Sui transactions
gasPricestringNoGas price in wei (for legacy transactions). Cannot be used with maxFeePerGas or maxPriorityFeePerGas
maxFeePerGasstringNoMaximum fee per gas for EIP-1559 transactions. Must be used together with maxPriorityFeePerGas
maxPriorityFeePerGasstringNoMaximum priority fee per gas for EIP-1559 transactions. Must be used together with maxFeePerGas
maxUSDnumberNoMaximum cost in USD that you’re willing to pay for this transaction
shouldBatchInMulticallbooleanNoWhether to batch this transaction in a multicall
retriesnumberNoNumber of retries if transaction fails. Defaults to 0
isAuthenticatedTxbooleanNoWhether to use authenticated relay mode for additional security. Defaults to false
derivationPathstringNoOptional HD wallet derivation path for transaction signing
transactionTypestringNoType of relay transaction: "flash" (default), "authenticated", "funding-signed", or "flash-blocks" (Base/Base Sepolia only)
authorizationListarrayNoOptional list of authorization entries for delegated transactions or batched operations (EIP-7702). Not allowed for flash-blocks transactions

AuthorizationListItem Object

When using authorizationList, each item should contain:

FieldTypeRequiredDescription
chainIdnumberYesChain ID for the authorization
addressstringYesEthereum address (must start with “0x”)
noncenumberYesNonce for the authorization
rstringYesSignature r component (must start with “0x”)
sstringYesSignature s component (must start with “0x”)
yParitynumberYesSignature y parity (0 or 1)
vnumber/bigintNoOptional signature v value

Gas Parameter Rules

  • Legacy transactions: Use gasPrice only
  • EIP-1559 transactions: Use both maxFeePerGas and maxPriorityFeePerGas together
  • You cannot mix gasPrice with maxFeePerGas or maxPriorityFeePerGas

Response

Success Response

response.json
{ "success": true, "data": { "costUSD": 0.0009221670934825817, "minBalanceRequired": "223171904787" }, "timestamp": "2025-10-24T12:34:56.789Z" }

Response Fields

FieldTypeDescription
costUSDnumberEstimated transaction cost in USD. This includes gas fees and relay service charges
minBalanceRequiredstringMinimum balance required in the smallest unit to execute the transaction. Unit varies by chain (wei for EVM, lamports for Solana, yoctoNEAR for NEAR, octas for Aptos, MIST for Sui)

Error Response

error-response.json
{ "success": false, "error": { "code": "INVALID_PARAMETERS", "message": "Missing required transaction parameters for quote", "category": "VALIDATION_ERROR", "details": { "field": "chainId", "message": "chainId is required" }, "traceId": "trace_abc123xyz789" }, "timestamp": "2025-10-24T12:34:56.789Z" }

Example Requests

EVM Chains (Ethereum, Base, Polygon, etc.)

api-request.sh
curl -X POST "https://api.tachyon.rath.fi/api/quote" \ -H "Content-Type: application/json" \ -H "apikey: YOUR_API_KEY" \ -d '{ "chainId": 8453, "to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49", "value": "1000000000000000", "callData": "0x", "label": "My Base Transaction" }'

With Gas Limit:

api-request.sh
curl -X POST "https://api.tachyon.rath.fi/api/quote" \ -H "Content-Type: application/json" \ -H "apikey: YOUR_API_KEY" \ -d '{ "chainId": 8453, "to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49", "value": "1000000000000000", "callData": "0x", "gasLimit": "21000", "label": "My Transaction with Gas Limit" }'

With EIP-1559 Gas Parameters:

api-request.sh
curl -X POST "https://api.tachyon.rath.fi/api/quote" \ -H "Content-Type: application/json" \ -H "apikey: YOUR_API_KEY" \ -d '{ "chainId": 8453, "to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49", "value": "1000000000000000", "callData": "0x", "maxFeePerGas": "2000000000", "maxPriorityFeePerGas": "1000000000", "label": "EIP-1559 Transaction" }'

Advanced Examples

Quote with Max USD Limit

api-request.sh
curl -X POST "https://api.tachyon.rath.fi/api/quote" \ -H "Content-Type: application/json" \ -H "apikey: YOUR_API_KEY" \ -d '{ "chainId": 8453, "to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49", "value": "1000000000000000", "callData": "0x", "maxUSD": 5.0, "label": "Transaction with USD Cap" }'

Authenticated Transaction Quote

api-request.sh
curl -X POST "https://api.tachyon.rath.fi/api/quote" \ -H "Content-Type: application/json" \ -H "apikey: YOUR_API_KEY" \ -d '{ "chainId": 8453, "to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49", "value": "1000000000000000", "callData": "0x", "transactionType": "authenticated", "isAuthenticatedTx": true, "label": "Authenticated Transaction Quote" }'

Flash-Blocks Transaction Quote

api-request.sh
curl -X POST "https://api.tachyon.rath.fi/api/quote" \ -H "Content-Type: application/json" \ -H "apikey: YOUR_API_KEY" \ -d '{ "chainId": 8453, "to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49", "value": "1000000000000000", "callData": "0x", "transactionType": "flash-blocks", "label": "Flash-Blocks Quote" }'

Note: Flash-blocks transaction type is only supported on Base (8453) and Base Sepolia (84532). Authorization lists cannot be used with flash-blocks transactions.

Quote with Authorization List (EIP-7702)

api-request.sh
curl -X POST "https://api.tachyon.rath.fi/api/quote" \ -H "Content-Type: application/json" \ -H "apikey: YOUR_API_KEY" \ -d '{ "chainId": 8453, "to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49", "value": "1000000000000000", "callData": "0x", "authorizationList": [ { "chainId": 8453, "address": "0x1234567890abcdef1234567890abcdef12345678", "nonce": 1, "r": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", "s": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "yParity": 1 } ], "label": "Delegated Transaction Quote" }'

Quote with Custom Derivation Path

api-request.sh
curl -X POST "https://api.tachyon.rath.fi/api/quote" \ -H "Content-Type: application/json" \ -H "apikey: YOUR_API_KEY" \ -d '{ "chainId": 8453, "to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49", "value": "1000000000000000", "callData": "0x", "derivationPath": "m/44'\''/60'\''/0'\''/0/1", "label": "Quote from Custom Account" }'

Quote with Multicall Batching

api-request.sh
curl -X POST "https://api.tachyon.rath.fi/api/quote" \ -H "Content-Type: application/json" \ -H "apikey: YOUR_API_KEY" \ -d '{ "chainId": 8453, "to": "0x3dbE34f2C21b3B2980d4dc53f3c7E51e39663F49", "value": "0", "callData": "0xa9059cbb000000000000000000000000...", "shouldBatchInMulticall": true, "label": "Batched Transaction Quote" }'

Understanding Units

The minBalanceRequired field uses different units depending on the blockchain:

NetworkUnitConversion
EVM ChainsWei1 ETH = 10¹⁸ wei
SolanaLamports1 SOL = 10⁹ lamports
NEARyoctoNEAR1 NEAR = 10²⁴ yoctoNEAR
AptosOctas1 APT = 10⁸ octas
SuiMIST1 SUI = 10⁹ MIST

Use Cases

  • Pre-transaction validation: Check if users have sufficient balance before attempting a transaction
  • Cost transparency: Display estimated costs to users in your application UI
  • Budget planning: Help users understand the financial impact of their transactions with maxUSD limits
  • Multi-chain comparison: Compare costs across different blockchain networks for the same operation
  • Gas optimization: Test different gas parameters to find the optimal transaction cost
Last updated on