Ethereum DeFi Gets ‘Gasless' Trading With New 0x API

The newest addition to 0x’s selection of trading APIs allows builders to use "gasless" swaps in their decentralized applications on Ethereum.

By Reza Jafery

4 min read

If you're a regular DeFi user on Ethereum, you’ve likely had transactions fail from time to time because you didn’t pony up enough ETH for gas—0x aims to solve that.

0x—a prominent developer of web3 infrastructure, including the popular decentralized exchange (DEX) Matcha—today announced the launch of their newest trading API: Tx Relay

Tx Relay facilitates “gasless” swaps, or the ability to swap between cryptocurrencies without spending any ETH on gas fees. Gas fees are the costs a user pays to execute a transaction—whether it’s a swap, a mint, or a token approval, it needs gas. 

The problem is, on average, 8-10% of DEX transactions fail, and this figure spikes up to 20% during times of network congestion (when Ethereum is experiencing an abnormally high volume of transactions). The Tx Relay API abstracts away the usual process of pre-emptively setting how much gas you want to use on your transaction by covering all the gas needed for the transaction and combining it into the transaction itself. 

The cost of the gas is then added to the swap, and paid by the user in the form of the token they’re swapping. The API is available today on Ethereum and Polygon, but the team plans to launch on Arbitrum shortly after in Q1 of 2024. 

Coinbase Wallet Product Manager Claudia Haddad believes that network fees have been a top pain point for the last few years. The simplified trading experience gasless swaps create is a “huge UX unlock,” she told Decrypt.  

Crypto users are no strangers to gas fees and the headaches that come with them. Coinbase, which is both an investor in 0x and a beta tester for the new API, claims that 69% of Ethereum swaps encounter a “not enough gas” error when the user starts the trade. Figuring out gas fees, or getting your transactions to execute at all during times of high congestion, are common pain points for the average crypto trader. They’re also common hurdles for new crypto users. 

For example, gas can typically only be paid in the blockchain’s native token. For example, on Ethereum you pay in ETH. A common mistake many new crypto traders make is not leaving enough Ethereum in their wallet to cover transaction costs.

In a similar vein, crypto wallet Giddy last year announced what it called the "first-ever Autogas feature for Polygon," which allowed users perform transactions on Polygon without holding MATIC in their balance—paying with the USDC stablecoin  instead. “We believe ‘Autogas’ will become an industry standard in the not so distant future,”said Giddy co-founder and CEO Eric Parker at the time.

With 0x’s new gasless swap, users don’t have to worry about maintaining a balance of whatever their blockchain’s gas token is, the fee is deducted from their trade in the background. 

Gasless swaps made using the Tx Relay API also benefit from MEV protection. In simple terms, that means protection against bots and other advanced tools. While sophisticated traders often run their trades through private mempools or custom RPCs, most users are either unaware or just plain too lazy to implement the basic protections available. The Tx Relay API aims to abstract this too away from the user.

Example of how a trade using Tx Relay works. Image: 0x

Last year, crypto wallet Giddy announced what it called the "first-ever Autogas feature for Polygon," which allowed users perform transactions on Polygon without holding MATIC in their balance and paying with USDC instead. “We believe ‘Autogas’ will become an industry standard in the not so distant future,”said Giddy co-founder and CEO Eric Parker at the time.

Gasless swaps have been pretty popular with 0x users during their beta. Coinbase reported thousands of users using them in December alone. Matcha has also reported that using the feature reduced failed trades by 85%. When asked how the new API would deal with large spikes in network congestion, 0x co-CEO and co-founder Amir Bandeali said cases of congestion-related failed transactions were rare, but when they occur, the transactions would be automatically resubmitted and executed. 

If everything works as expected, this could create a much better overall user experience for crypto traders, and make the task of conducting on-chain transactions less intimidating to new users.

Editor's note: this article was updated to add mention of the Giddy wallet's gasless approach.

Get crypto news straight to your inbox--

sign up for the Decrypt Daily below. (It’s free).

Recommended News