Managing Transactions with Stablecoin Gas

How stablecoin gas works on Tempo and how to format your transactions to utilize it

One of the biggest friction points for institutions adopting public blockchains is the need to hold and manage volatile native tokens (like ETH or SOL) simply to pay for network execution fees.

Tempo eliminates this treasury risk through a native stablecoin fee abstraction model. On Tempo, developers and users can pay transaction fees directly in supported USD‑denominated TIP‑20 stablecoins (including wrapped versions of assets like USDC or USDT where available).

How Stablecoin Gas Works

Tempo achieves gas abstraction through a protocol‑native Automated Market Maker (FeeAMM) that is built into the protocol rather than deployed as a user smart contract.

When a transaction is submitted, the network automatically calculates the fee in the user's chosen stablecoin and processes the conversion in the background. This design ensures that:

  • Predictable Costs: Transaction fees remain pegged to fiat value (typically around $0.001), shielding your operations from the price volatility of native crypto assets.
  • Simplified Accounting: "Dollars in" equals "digital dollars out," eliminating the need to maintain separate inventories of utility tokens purely for operational costs.
  • Unified Liquidity: The built-in DEX seamlessly converts supported stablecoins for fee payments, removing the need for manual token swaps.

Structuring the Transaction Payload

Because Tempo is EVM-compatible, submitting a transaction is largely identical to interacting with Ethereum. However, Tempo transaction receipts and payloads include network-specific extensions to accommodate stablecoin gas.

Checking Token Balances

Since Tempo does not use a native gas token, standard EVM methods like eth_getBalance are not the source of truth for your fee‑paying capacity. To check your balance for gas payments, you must query the specific TIP‑20 stablecoin contract directly using the balanceOf function.

In practice, always treat TIP‑20.balanceOf(yourAddress) on your chosen fee token as your real gas balance.

Example: Ethers.js Implementation

When using libraries like ethers.js connected to a Blockdaemon endpoint, you can interact with the network just as you normally would. The FeeAMM handles the gas token deduction automatically behind the scenes, provided the sending address holds a sufficient balance of the supported stablecoin.

const { ethers } = require("ethers");

// Connect to your Blockdaemon Tempo RPC endpoint
const provider = new ethers.JsonRpcProvider("YOUR_BLOCKDAEMON_ENDPOINT_URL");
const wallet = new ethers.Wallet("YOUR_PRIVATE_KEY", provider);

// The transaction payload requires standard EVM parameters
const tx = {
  to: "0xRecipientAddress...",
  value: 0, // Set to 0 if interacting with a smart contract or transferring TIP-20 tokens
  data: "0xContractData...",
  // Gas limits are still specified; the cost is settled in your configured TIP-20 fee token via the FeeAMM
  gasLimit: 21000, 
};

async function sendTransaction() {
  const response = await wallet.sendTransaction(tx);
  const receipt = await response.wait();
  
  // Some providers extend Tempo receipts with additional fee metadata
	console.log("Fee Token (provider-specific):", receipt.feeToken);
	console.log("Fee Payer (provider-specific):", receipt.feePayer);
}

sendTransaction();

Note: Some infrastructure providers extend Tempo transaction receipts with fields such as feeToken (the TIP-20 contract address used for the fee) and feePayer (the address that covered the gas, which is useful for sponsored transactions). These are provider-specific extensions rather than part of the base Tempo spec.

Funding Your Testnet Address

If you are building on the Tempo testnet, you can easily fund your wallet with test stablecoins to cover gas fees. Use the tempo_fundAddress JSON‑RPC method to receive test assets like pathUSD, AlphaUSD, BetaUSD, and ThetaUSD.

curl -X POST YOUR_BLOCKDAEMON_ENDPOINT_URL \
  -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "method": "tempo_fundAddress", "params": ["YOUR_ADDRESS"], "id": 1 }'

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.