Abstract gas fees for EOA transactions
API Reference
Abstract Transaction Fees
Sponsor gas fees for standard Solana wallet transactions using Grid paymaster
POST
Abstract gas fees for EOA transactions
The Gas Abstraction endpoint enables fee sponsorship for standard Solana wallet transactions through the Grid paymaster system. This service removes the requirement for users to hold SOL tokens for transaction fees, creating a seamless user experience.Documentation Index
Fetch the complete documentation index at: https://developers.squads.so/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
The gas abstraction process follows these steps:- Transaction Submission: Send your unsigned, base64-encoded transaction to the endpoint
- Fee Calculation: The paymaster computes the required fees in your specified currency (defaults to USDC)
- Paymaster Signing: The paymaster adds its signature to sponsor the fees
- User Signing: Add the user’s signature to the paymaster-signed transaction
- Blockchain Submission: Submit the fully signed transaction to Solana
Implementation Guide
Fee Structure
Fee Calculation
The total fee consists of:- Compute Units: Based on transaction complexity and computational requirements
- Rent Fees: For account creation or rent-exempt balance requirements
- Currency Conversion: Fees quoted in your specified currency (default: USDC)
Billing Details
- Sandbox Environment: Devnet transactions are processed but not billed
- Production Environment: Mainnet transactions are recorded and billed according to your Grid API agreement
- Fee Components: Transaction, priority, and rent fees are included in billing
Custom Identifiers
Use the optionalcustomIdentifier query parameter to group and track related transactions:
- Group transactions by user, session, or feature
- Query fee history by identifier
- Track usage patterns and costs per category
Transaction Validation
Transactions must:- Be valid Solana transactions that can be simulated successfully
- Use versioned transaction format
- Be properly serialized to base64
- Not be pre-signed
Error Handling
Common error scenarios:Invalid Transaction Format
Invalid Environment Header
X-Grid-Environment header is set to either sandbox or production.
Service Unavailable
Security Best Practices
- API Key Protection: Never expose your Grid API key in client-side code or public repositories
- Environment Separation: Use sandbox for testing, production only for live transactions
- Transaction Verification: Always validate the returned signed transaction matches your intent
- Fee Monitoring: Implement alerts for unexpected fee spikes
- Rate Limiting: Implement appropriate rate limiting to avoid overwhelming the API
Authorizations
API Key for authentication
Headers
The environment you're using. Can be sandbox or production.
Query Parameters
Optional custom identifier for tracking purposes
Body
application/json
Base64-encoded transaction to process for fee abstraction