HomeKnowledge BaseHow Qantura Harnessed CoW Swap To Power the Future of Payments

How Qantura Harnessed CoW Swap To Power the Future of Payments

8 min read
·
Published Oct 29, 2024, 11:52 AM

CoW-Case-Study-Qantura-main-image.png TL:DR

  • Qantura provides a seamless integration layer that transforms how smart wallets engage with blockchain applications.

  • In order for their service to work, it needed a Meta DEX with built-in MEV protection to allow users to swap their yield tokens whenever they tap the VISA card to spend money on real-world items.

  • The Qantura team chose CoW Protocol to create a seamless way to rebalance customer wallets.

  • The result was a first-of-its-kind application that enables frictionless payments with yield-bearing assets.

  • Within the first month after the release, the project saw more than $100,000 USD settled.

Introduction

CoW DAO builds products that help keep users safe. But it also builds products that other people can use and integrate. One of those is CoW Protocol. With its built-in MEV protection, simple user interface, customized order functionality, and ease of integration, projects looking for a way of providing better prices for its users while keeping them safe look no further.

The client

Qantura provides a seamless integration layer that transforms how smart wallets engage with blockchain applications. The company leverages account abstraction to simplify complex blockchain interactions while maintaining the highest security standards. Founded by crypto OGs and security experts, they're making it effortless for wallets to expand their capabilities using their plug-and-play modules. They have already partnered with industry leaders like Zeal Wallet and Gnosis Pay.

Identifying the problem and challenges

Historically, if someone wanted to pay in crypto, the merchant would have to accept that token directly or use a service provider that performed the conversion from cryptocurrency to cash. With Gnosis Pay, that’s no longer the case.

Gnosis Pay is the world’s first on-chain spending account with a Visa Debit Card linked to a self-custodial blockchain wallet, and thanks to Monerium, users with EURe, or GBPe stablecoins can now spend their currency anywhere where Visa is accepted, with a series of on-chain transactions taking place in the background. However, if a user leaves stablecoins sitting in their wallet, they’re not only missing out on yield farming but also on any capital appreciation they expect in other crypto assets.

Instead of simply having customers sit with idle capital on their Gnosis Pay account, Qantura wanted to offer users the opportunity to earn yield and spend that yield on whatever they liked. Qantura teamed up with Zeal and Gnosis Pay, to build a unique feature: allow customers to switch stablecoins to yield-bearing tokens in order to capture such yield, while still being able to spend money on real-world transactions.

While that sounds simple in theory, the devil was in the details. In order for all this to work, Qantura “needed a flexible system that worked for swapping any ERC20 token and that ensured users got competitive prices” says a member of Qantura’s team. Additionally, because most of their system is based on smart contracts, they needed a protocol that worked with ERC1271 orders. This allowed them to have their smart contract sign the intent to trade transactions whenever the user actually tapped the card on a payment terminal.

Based on all these requirements, the team needed a solution that offered smart contract orders that could be customised to suit what they were building. So they turned to CoW Protocol.

Working with CoW

The team were already familiar with CoW DAO’s suite of products and services, and had been regular users of CoW Swap already.

“CoW Protocol offered the flexibility we needed as far as token breadth goes via ERC1271 orders, and its off-chain solver competition did it for us in terms of offering a mechanism that incentivised competitive pricing in rebalancing trades.”

Qantura systems use ERC-1271 smart contract signature verification for order placement. This means that when the user account is deployed, (aka the user wants to earn yield on the funds sitting on their Gnosis Pay card), the yield token is immediately approved on the CoW Protocol settlement contract.

This means that now, any third party can create an order as long as it satisfies the wallet’s isValidSignature() function, which in this case would be “Swap my yield token to EURe/GBPe with the best price you can find so that the user can rebalance their card after paying for the coffee bill”. For this to happen, the system places the order via CoW Protocol’s orderbook, which is eventually forwarded to solvers as part of the batch auction process.

While monitoring performance, Qantura analyzed nearly 4,000 trades and compared their settled sDAI/EURe prices with a proxy oracle. There’s no oracle in Gnosis chain for sDAI/EURe, so they built a sDAI/EURe proxy oracle instead.

CoW Swap’s unique solver system delivered the most competitive prices than any other venue, and was on par to the comparison model. cow-protocol-case-study-qantura.jpeg

The graph above highlights Cow Swap’s performance against the price oracle. The median percentage difference between the price of the proxy oracle and CoW Protocol´s found price was just 9 basis points, meaning users typically paid just 0.09% more than the oracle. In the figure, the blue outliers are small amounts of around 1 sDAI.

The solution

The finished product? Recharge. Built in partnership with Zeal Wallet and Gnosis Pay, it allows users to spend yield-bearing tokens via Gnosis Chain in the real world with a Visa card. In the backend, meanwhile, a complex rebalancing takes place to ensure assets are able to be converted for a competitive price and moved to the right places at the right time. It’s a unique showcase of what happens when TradFi meets DeFi composability.

Where does CoW Protocol feature in this unique solution? CoW Protocol was integral to ensuring that when rebalancing happens, the execution cost is as low as possible and the best price is achieved.

How does Recharge work? Let’s look at an example. But before you do, we need to clarify a few terms:

  • EURe - this is the first fully authorized and regulated euro stablecoin.

  • sDAI - or Savings DAI is a token that allows users to earn yield from holding DAI.

  • Recharge Smart Contracts - Recharge is a feature that allows Zeal wallet users to maintain a minimum amount of a given currency at any time via the Coordinator. When the amount drops below a threshold, the wallet automatically rebalances itself by swapping one currency for another. In this example, we’ll be using sDAI and EURe. The Coordinator is a smart contract that starts the rebalance once a threshold has been reached.

Let’s take a closer look at an example:

Screenshot 2024-10-25 at 8.39.00 AM.png

  • (1) Alice pays 5 EURe with her Gnosis Pay card. Before that, Alice had set up rebalance with sDAI and EURe.

  • (2) Prior to the transaction at the coffee shop, Alice had 1,000 EURe in her Gnosis Pay safe account.

  • (3) She had also set up her Coordinator smart contract to top up whenever her wallet dropped below 1,000 EURe.

  • (4a) Qantura's automation service detects Alice’s setup and notices that the new balance of the account is 995 EURe. This takes her below the threshold.

  • (4b) The service sees that Alice holds 5K sDAI, enough to top up the account.

  • (4c) The bot drafts the rebalance order, making sure that it meets all conditions specified by the sDAI account including that the order is:

  • Selling sDAI

  • Buying EURe

  • Issuing a buy order for 5 EURe

  • Sending the funds to the intended receiver; i.e., the user’s Gnosis Pay Safe

  • (4d) A bot posts the order to CoW Protocol’s orderbook.

  • (5) The order is forwarded to all solvers as part of the auction process, where they compete to provide the best possible price at the lowest execution cost.

  • (6) CoW Protocol executes the winning solution, sending 5 EURe to the Gnosis Pay Safe and pulling the sDAI from Alice's sDAI account. The amount pulled is determined by the auction.

  • (7) Alice's Gnosis Pay Safe is now balanced again.

CoW Protocol is instrumental in allowing this to happen smoothly. CoW Protocol´s competition pushes solvers to get as much surplus as possible. In the case of Alice, solvers will submit a solution that gets 5 EURe for the least amount of sDAI.

The result

Since Recharge launched, more than $100,000 USD has been settled. At the time of writing, there is more than 300k USD generating yield for users. You can follow live metrics on Qantura's Recharge Dashboard.

Qantura is revolutionizing the payments industry by allowing users to remain capital-efficient in a self-custodial setup. That’s a tall order. But then again, CoW DAO is the place people go to build big things.

CTA

Want to get in touch with Qantura for more details about their solution powered by CoW Swap? Get in touch with Qantura.

Want to work with CoW DAO’s class-leading suite of products? Head this way.