Gas Station
Gas accounts hold native cryptocurrencies (ETH, MATIC, BNB, etc.) used to pay transaction fees when sweeping deposits and processing withdrawals. Monitor your gas balances to ensure smooth operations.
What are gas accounts?
Gas accounts are special wallets that hold native blockchain tokens used to pay for transaction fees:
- Ethereum: Holds ETH to pay gas for sweeping USDC, USDT, DAI deposits
- Polygon: Holds MATIC to pay gas for token transfers
- BSC: Holds BNB to pay gas for token operations
- Bitcoin: Transaction fees paid from UTXOs (no separate gas account)
- Tron: Holds TRX for energy/bandwidth
- XRP: Transaction fees paid from XRP balance (no separate gas account)
Without sufficient gas, deposits cannot be swept to settlement accounts and withdrawals cannot be processed.
Get gas wallets
Retrieve all gas wallets for your organization across all supported chains.
Request
curl https://api.coinspayd.io/gas-station \
-H "x-api-key: {your-api-key}"
Response
{
"gasWallets": [
{
"chainId": "eip155:1",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"balance": "5000000000000000000",
"Chain": {
"name": "Ethereum",
"properties": {
"nativeCurrency": "ETH",
"decimals": 18
}
}
},
{
"chainId": "eip155:137",
"address": "0xabcdef1234567890abcdef1234567890abcdef12",
"balance": "100000000000000000000",
"Chain": {
"name": "Polygon",
"properties": {
"nativeCurrency": "MATIC",
"decimals": 18
}
}
},
{
"chainId": "tron:0x00000000000000000000000000000000",
"address": "TXYZabcdef123456789...",
"balance": "50000000",
"Chain": {
"name": "Tron",
"properties": {
"nativeCurrency": "TRX",
"decimals": 6
}
}
}
]
}
Understanding gas balances
Gas wallet balances are returned in base units. Convert to human-readable amounts:
EVM Chains (18 decimals)
| Chain | Base Units | Human Amount |
|---|---|---|
| Ethereum | "5000000000000000000" | 5.0 ETH |
| Polygon | "100000000000000000000" | 100.0 MATIC |
| BSC | "10000000000000000000" | 10.0 BNB |
// Convert ETH base units to human-readable
const baseUnits = "5000000000000000000"
const humanAmount = parseInt(baseUnits) / 10**18
console.log(`${humanAmount} ETH`) // 5.0 ETH
Tron (6 decimals)
// Convert TRX base units to human-readable
const baseUnits = "50000000"
const humanAmount = parseInt(baseUnits) / 10**6
console.log(`${humanAmount} TRX`) // 50.0 TRX
Monitoring gas levels
Set up alerts to monitor gas levels and prevent operational issues:
// Check if gas wallets need refilling
const MIN_ETH = 1.0 // Minimum 1 ETH
const MIN_MATIC = 50.0 // Minimum 50 MATIC
const MIN_BNB = 1.0 // Minimum 1 BNB
const MIN_TRX = 100.0 // Minimum 100 TRX
gasWallets.forEach(wallet => {
const decimals = wallet.Chain.properties.decimals
const balance = parseInt(wallet.balance) / 10**decimals
const currency = wallet.Chain.properties.nativeCurrency
let minRequired = 0
if (currency === 'ETH') minRequired = MIN_ETH
if (currency === 'MATIC') minRequired = MIN_MATIC
if (currency === 'BNB') minRequired = MIN_BNB
if (currency === 'TRX') minRequired = MIN_TRX
if (balance < minRequired) {
console.warn(`⚠️ Low gas on ${wallet.Chain.name}: ${balance} ${currency}`)
console.warn(` Address: ${wallet.address}`)
console.warn(` Send at least ${minRequired - balance} ${currency}`)
}
})
# Check if gas wallets need refilling
MIN_BALANCES = {
'ETH': 1.0,
'MATIC': 50.0,
'BNB': 1.0,
'TRX': 100.0
}
for wallet in gas_wallets:
decimals = wallet['Chain']['properties']['decimals']
balance = int(wallet['balance']) / 10**decimals
currency = wallet['Chain']['properties']['nativeCurrency']
min_required = MIN_BALANCES.get(currency, 0)
if balance < min_required:
print(f"⚠️ Low gas on {wallet['Chain']['name']}: {balance} {currency}")
print(f" Address: {wallet['address']}")
print(f" Send at least {min_required - balance} {currency}")
Refilling gas wallets
When gas levels are low, send native tokens to the gas wallet addresses:
Manual Refill
- Get the gas wallet address from the API
- Send native tokens from your exchange or wallet
- Wait for confirmation
Example: Refill Ethereum gas wallet
# Get Ethereum gas wallet address
curl https://api.coinspayd.io/gas-station \
-H "x-api-key: {your-api-key}" \
| jq '.gasWallets[] | select(.chainId == "eip155:1") | .address'
# Send ETH to that address from your wallet/exchange
# Address: 0x1234567890abcdef1234567890abcdef12345678
Automated Monitoring
Set up a cron job or scheduled task to check gas levels daily:
#!/bin/bash
# check-gas-levels.sh
API_KEY="your-api-key"
WEBHOOK_URL="https://your-alerts.com/webhook"
# Get gas wallets
RESPONSE=$(curl -s https://api.coinspayd.io/gas-station \
-H "x-api-key: $API_KEY")
# Parse and check balances (use jq for JSON parsing)
# Send alert if any wallet is below threshold
Gas usage patterns
Different operations consume different amounts of gas:
Ethereum
| Operation | Estimated Gas | Cost at 30 Gwei |
|---|---|---|
| Sweep ERC-20 deposit | ~50,000 gas | |
| Process withdrawal | ~60,000 gas | |
| Daily operations (10 tx) | ~500,000 gas |
Polygon
| Operation | Estimated Gas | Cost at 50 Gwei |
|---|---|---|
| Sweep ERC-20 deposit | ~50,000 gas | |
| Process withdrawal | ~60,000 gas | |
| Daily operations (10 tx) | ~500,000 gas |
Tron
| Operation | Energy Needed | Approximate TRX |
|---|---|---|
| Sweep TRC-20 deposit | ~30,000 energy | ~3 TRX |
| Process withdrawal | ~35,000 energy | ~3.5 TRX |
| Daily operations (10 tx) | ~300,000 energy | ~30 TRX |
Best practices
Maintain Adequate Balances
- Ethereum: Keep at least 1-2 ETH
- Polygon: Keep at least 50-100 MATIC
- BSC: Keep at least 0.5-1 BNB
- Tron: Keep at least 100-200 TRX
Monitor Regularly
- Check gas levels daily
- Set up alerts for low balances
- Automate monitoring with scripts
Refill Proactively
- Refill before levels get critical
- Keep a buffer for unexpected volume spikes
- Consider automated refills from a treasury wallet
Track Costs
- Monitor gas consumption trends
- Calculate daily/monthly gas costs
- Optimize operations to reduce gas usage