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/quoteRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
chainId | number | Yes | The blockchain network ID where the transaction will be executed |
to | string | Yes | The recipient wallet address or smart contract address. Format varies by chain (hex for EVM, base58 for Solana, named for NEAR) |
value | string | No | Amount of native currency to send in the smallest unit (wei for EVM, lamports for Solana, yoctoNEAR for NEAR, MIST for Sui). Defaults to ‘0’ |
callData | string | Yes | Encoded transaction data in hexadecimal format (use ‘0x’ for simple transfers) |
label | string | No | Optional human-readable label for tracking |
gasLimit | string | No | Optional gas limit for the transaction. Required for Aptos and Sui transactions |
gasPrice | string | No | Gas price in wei (for legacy transactions). Cannot be used with maxFeePerGas or maxPriorityFeePerGas |
maxFeePerGas | string | No | Maximum fee per gas for EIP-1559 transactions. Must be used together with maxPriorityFeePerGas |
maxPriorityFeePerGas | string | No | Maximum priority fee per gas for EIP-1559 transactions. Must be used together with maxFeePerGas |
maxUSD | number | No | Maximum cost in USD that you’re willing to pay for this transaction |
shouldBatchInMulticall | boolean | No | Whether to batch this transaction in a multicall |
retries | number | No | Number of retries if transaction fails. Defaults to 0 |
isAuthenticatedTx | boolean | No | Whether to use authenticated relay mode for additional security. Defaults to false |
derivationPath | string | No | Optional HD wallet derivation path for transaction signing |
transactionType | string | No | Type of relay transaction: "flash" (default), "authenticated", "funding-signed", or "flash-blocks" (Base/Base Sepolia only) |
authorizationList | array | No | Optional 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:
| Field | Type | Required | Description |
|---|---|---|---|
chainId | number | Yes | Chain ID for the authorization |
address | string | Yes | Ethereum address (must start with “0x”) |
nonce | number | Yes | Nonce for the authorization |
r | string | Yes | Signature r component (must start with “0x”) |
s | string | Yes | Signature s component (must start with “0x”) |
yParity | number | Yes | Signature y parity (0 or 1) |
v | number/bigint | No | Optional signature v value |
Gas Parameter Rules
- Legacy transactions: Use
gasPriceonly - EIP-1559 transactions: Use both
maxFeePerGasandmaxPriorityFeePerGastogether - You cannot mix
gasPricewithmaxFeePerGasormaxPriorityFeePerGas
Response
Success Response
response.json
{
"success": true,
"data": {
"costUSD": 0.0009221670934825817,
"minBalanceRequired": "223171904787"
},
"timestamp": "2025-10-24T12:34:56.789Z"
}Response Fields
| Field | Type | Description |
|---|---|---|
costUSD | number | Estimated transaction cost in USD. This includes gas fees and relay service charges |
minBalanceRequired | string | Minimum 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:
| Network | Unit | Conversion |
|---|---|---|
| EVM Chains | Wei | 1 ETH = 10¹⁸ wei |
| Solana | Lamports | 1 SOL = 10⁹ lamports |
| NEAR | yoctoNEAR | 1 NEAR = 10²⁴ yoctoNEAR |
| Aptos | Octas | 1 APT = 10⁸ octas |
| Sui | MIST | 1 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