Inspiration

Central & Southern Asia and Oceania (CSAO) is the third largest cryptocurrency market in our index this year, with citizens of CSAO countries receiving $932 billion in cryptocurrency value from July 2021 to June 2022.

Middle East & North Africa (MENA) may be one of the smaller crypto markets in the 2022 Global Crypto Adoption Index, but it’s also the fastest growing. MENA-based users received $566 billion in cryptocurrency from July 2021 to June 2022, 48% more than they received the year prior.

Latin America is the seventh largest cryptocurrency market in our index this year, with citizens of Latin America countries receiving $562.0 billion in crypto from July 2021 to June 2022. This represents a 40% growth over last year’s total. Latin America is also home to five of the top thirty countries in this year’s crypto index: Brazil (7), Argentina (13), Colombia (15), Ecuador (18), and Mexico (28).

Sub-saharan Africa accounts for the least cryptocurrency transaction volume of any region we study, with $100.6 billion in on-chain volume received between July 2021 and June 2022, which represents 2% of global activity, and 16% growth over the year prior. Not only has Africa’s cryptocurrency market grown over 1200% by value received in the last year, but the region also has some of the highest grassroots adoption in the world, with Kenya, Nigeria, South Africa, and Tanzania all ranking in the top 20 of our Global Crypto Adoption Index. In addition to being the third-fastest growing cryptocurrency economy, Africa also has a bigger share of its overall transaction volume made up of retail-sized transfers than any other region at just over 7%, versus the global average of 5.5%

However, there is a difficult adoption of DeFi and cryptocurrencies in emerging markets for 2 main reasons: -Ease of use & Ease of access: it is extremely completed for people living in emerging markets to acquire cryptocurrencies because of complex procedures on Centralized Exchanges requiring KYC checks and difficult registration steps, excluding people without formal ID documents. Moreover, the issue of mismanagement of users' funds leads to the loss of their assets. Decentralized Exchanges (DEX) have expensive gas fees, slippage, transaction fees, and impermanent loss, current DEXs are not built for small retail traders. And most traders in Africa and emerging markets are small retail traders doing P2P with small transaction amounts, exposed to scams on P2P exchange platforms such as Paxful, on which I have been scammed for $600. The core insight behind our product’s design is that, counterintuitively, more liquidity can be bad for retail traders. In general, Most AMMs want as much liquidity as possible because it means less slippage. But after a certain point, more liquidity doesn't have any material benefit for small trades; it only continues to reduce slippage on large trades. Put another way, the slippage on a $1,000 or $500 trade is virtually the same with a $100m or $50m pool and a $1b pool. Even worse, more liquidity can be counterproductive! That's because the more liquidity in an AMM, the more the AMM needs to charge traders fees to attract such large amounts of liquidity. This ends up better for large traders but will make for worse prices for smaller trades. Consequently, on most DEXs retail traders end up subsidizing whales! And + $10 Billion USD is lost in transaction processing due to scams, transaction fees, slippage, and gas fees.

What it does

eruSwap also called eSwap (abbreviation) is a cross-chain decentralized multi-token trading platform connecting fiat-to-crypto and crypto-to-fiat, providing a protocol for trading and automated liquidity provision for the self-made retail crypto trader in emerging markets powered by AXELAR. We are on a mission to make superior trading products with efficient execution available to anyone. eruSwap is a cross-chain decentralized exchange (DEX) built for self-made traders in emerging markets, not hedge funds or whales. eruSwap is designed to have the lowest per-transaction costs for smaller trades on the most popular crypto-assets. This is accomplished through a novel architecture and a series of design tradeoffs that sacrifice price competitiveness on large trades for better prices for smaller trades.

How we built it

Frontend: On the frontend part, we have used React with JavaScript as a fundamental technology. Webapp built in React with TypeScript language. For the UI we used the Chakra UI library and Tailwind CSS to create a visually pleasing web interface for users to interact with the contracts.

For the connection to the Blockchain and the backend process, we have used our built-in synchronizer and its functionality. We use ether.js the make the transactions with the Blockchain; We use Infura and Ankr for RPC Requests, Query API, and Token API.

Backend/Blockchain: The whole power of the app lies in our smart contract, which we built with the use of Solidity, and Chainlink Oracles. We built smart contracts with Solidity and the Hardhat framework. We use Axelar for cross-chain functionality. We are building cross-chain from day one. Thanks to Axelar, we are able to build on the following chains: Aurora – Avalanche – Binance – Ethereum – Fantom – Moonbeam – Polygon – Celo We are already connected to the Axelar Network, precisely our cross-chain bridges, and our cross-chain router is powered by Axelar. The Cross-Chain Bridges are a foundation block of eruSwap powered by Axelar: A Bridge allows an asset on one chain to be 'sent' to another chain. The Cross-Chain Router: Enables any assets to be transferred between multiple chains, no matter if they are native or created with eruSwap's Bridge powered by Axelar.

Chainlink: Data Feeds Oracles for getting tokens / USD prize (for calculating the balances in USD and for getting the amount distribution when supplying into liquidity pools, for supplying the same amount of USD between the 2 assets) We used Chainlink’s contract library and oracles to request off-chain and on-chain data. We used Hardhat to deploy and test. We build it as a team of three with frequent meetings and a scheduled workflow.

eruSwap was designed to give traders the best prices anywhere (including fees, slippage, and gas) for their small trades.

  • One of the main differentiators between eruSwap and other decentralized trading platforms is that our users trade without any unpredictable slippage. Not 0.01%. Zero. eruSwap Minimizes Slippage with (a) a new invariant that slips less than a Constant Product Market Maker and (b) a consolidated liquidity pool for any number of N assets, which is far more capital efficient than fragmenting liquidity across traditional two-asset pools. This design means eruSwap has remarkably low slippage relative to its pool size.
  • eruSwap's Mainnet architecture was painstakingly engineered to have some of the lowest gas fees available. Traders can expect total fees of between 80k and 110k gas when using eruSwap on Mainnet, depending on the assets they choose and hold. We've found that eruSwap could use about 20-25% less gas than UniswapV3 on equivalent trades, which can mean savings of $2 to $20 per transaction, depending on gas and ETH prices. On other L2s such as Polygon, eruSwap uses a custom compressed _ calldata_ representation to lower gas costs.
  • eruSwap minimizes Fees by maintaining the size of the pool. Because there is less capital in the pool, these small fees ($) are still enough to provide a sufficient yield (%) to attract the necessary liquidity. The result is that, mathematically, on trades that are small relative to the pool size, lower fees outweigh higher slippage so trade prices are better than other DEXs. Conversely, on trades that are large relative to the pool size, the higher slippage will outweigh lower fees so the total price will tend to be less competitive than other DEXs. There is no “magic” here, but rather intentionality in design that provides better pricing for small trades at the expense of worse pricing for larger trades. eruSwap's builders made this trade-off because eruSwap is built specifically for small trades. -In addition to the familiar functionality of swapping one token for another, eruSwap allows users to perform cross-chain multiple token trades, all in one transaction. Trade one token for a portfolio of tokens or several tokens on the same chain or from one chain to another chain. What’s important for us to highlight, however, is that your network fees for a cross-chain multi-token trade on eruSwap are significantly lower than if you were to submit each of these transactions individually. You’re not paying for A to X and then again for B to X and so on… You’re paying one gas fee for the bundled trade of ABC to X, which is notably less than the cumulative gas fees for one-to-one transactions. And in addition to saving money, it’s efficient! Our users are able to quickly enter or exit multiple positions “in one go”, which can be especially important in fast-moving markets. Think of some potential use cases for a cross-chain multi-token trade: -Exit multiple positions, all at once. You hold a number of investments in tokens from different networks that you know you want to exit ASAP — why pay gas fees over and over again and waste time when you can do it in one go? -Swap a portfolio of tokens into a stablecoin from one chain to another chain or on the same chain. You need some USDC and have your investments split across a number of different tokens from one chain to another chain or on the same chain. Bundle them! -Consolidate multiple small positions (such as airdrops) into something more meaningful. Got spare “change”? If you have $5 of APE, it makes zero sense to pay $15 in gas fees just to trade it into another token. Lump together up to seven positions in one trade so that your gas fee is worth it. -Create or rebalance a portfolio in one move. Know exactly what you want to buy? Get exposure to an assortment of tokens all in a single trade! Hopefully, you get the point. Now you’re probably wondering just how much you can actually save by utilizing this function on eruSwap. Depending on gas price fluctuations and how many tokens you’re trading, this varies. But generally, our team has found that you save about 78% in gas fees per pair when conducting a seven-to-one or one-to-seven trade on eruSwap -eruSwap MoMs uni-asset pools are composed of fiat Assets pegged to Mobile Wallets mostly and frequently used in emerging markets to enable and offer seamless onramps and offramps fiat-to-crypto and crypto-to-fiat transactions and are maintained at the ideal size for small trades. eruSwap MoMs allow users to connect directly to the DEX with their mobile wallets to execute their trade.

As a uniquely designed cross-chain multi-token trading DEX, eruSwap removes the intricacies that are associated with trading cryptos, fiat-to-crypto, and crypto-to-fiat transactions.

Unlike its peers, eruSwap utilizes single-asset liquidity pools through which most of the initiated swaps are made.

The protocol’s operation revolves around its different major components which include:

1-Liquidity Providing: eruSwap has two unique structures for providing liquidity and collecting yield: eruSwap Pools and eruSwap MoMs. eruSwap Pools are uni-asset liquidity pools containing one Pot Asset. Pools are maintained at the ideal volume for small trades. They enable the trading of any asset through eruSwap. eruSwap MoMs are uni-asset liquidity pools composed of Pot Assets linked to mobile wallets. Pot Assets are cryptocurrencies that are offered initially and natively through eruSwap and makeup eruSwap’s initial liquidity pools.

2-Cross-chain messaging: AXELAR generic messaging protocol is used as a cross-chain messaging solution in eruSwap protocol, wherein eruSwap sends a message containing information to complete the cross-chain swap on the destination chain when the user initiates their swap from the initial sender chain. 4-User interface 5-Cross-chain router: The Cross-Chain Router: Enables any assets to be transferred between multiple chains, no matter if they are native or created with eruSwap's Bridge powered by Axelar and Wormhole. -Cross-chain bridge: The Cross-Chain Bridges are a foundation block of eruSwap: A Bridge allows an asset on one chain to be 'sent' to another chain.

The infrastructure of eruSwap’s is based on a microservices structure where each service runs on its own and has its own purpose.

Architecture eruSwap's novel DEX design was created to optimize prices on trades below $10K. eruSwap's FMM Architecture eruSwap is implemented using a Formula Market Maker (FMM). FMMs are a combination of on- and off-chain architecture - you can think of them as a hybrid between opaque off-chain RFQ systems, and entirely on-chain automated market makers (AMMs). Optimization for EVM and Layer-2 chains Layer-2 chains and EVM are different because they are not entirely separate chains. Rather, it anchors its data back to Ethereum. That means every transaction on a Layer-2 chain and EVM has a small fee in Ethereum which goes to the Ethereum network. Basically, the existence of the transaction on Layer-2 is recorded on Ethereum. This happens by recording the input _ calldata_ of every transaction on Layer-2 chains. Of course, gas is very expensive on Ethereum and so a transaction with bloated _ calldata_ could cost several dollars, even on Layer-2 chains. eruSwap is laser-focused on retail traders, which means minimizing costs is very important! A few dollars can make a big difference on a small trade. To handle this, we wrote custom methods that used compressed _ calldata_ - reducing eruSwap transaction costs by about 50%. This will help eruSwap have by far the best prices for small trades on Layer-2 chains such as Polygon.

Challenges we ran into

We face the following challenges: -Accurate data feeds -Pools management for small retail traders -Challenge to provide transactions with zero slippage, zero gas fees on Ethereum, and reduced impermanent loss -Challenge to develop cross-chain multi-token trading

We didn’t like the backend products related to blockchain that there is the market out there, so we decided to build our own built-in synchronizer that keeps syncing the blockchain data, with the backend, with the front. This is very useful and made work way simpler for us. Is useful for giving a better UI/UX to the user, explaining what is happening in each transaction, and updating his balances in the dashboard. The front was hard to accomplish, given the complexity of the UI/UX, but we are happy with how it ended up. For us, time was a huge limitation. The tight window of the hackathon meant we had to work more hours than usual. Additionally, we learned to prioritize, as the few weeks did not lend enough time for us to make every part of our project as perfect as we would like before the deadline.

Accomplishments that we're proud of

-Effective accurate data feeds for cross-chain swaps -Transactions with zero slippage and zero gas fees on Ethereum -Cross-chain Multi-token trading with accurate data feeds -Our team has found that you save about 78% in gas fees per pair when conducting a seven-to-one or one-to-seven trade on eruSwap. We could deliver a good product that satisfies our expectations. Also, we improved a lot our dev tools and the tech we use, so it makes it easy to develop with them. Now we can develop products faster and also scaling is easier for us too. We began with just an observation, followed by a roughly formulated idea. We never expected to be able to bring it to reality in a mere few weeks—but it turns out that all it took was passion, efficient teamwork, and lots of overtime. We’re very grateful to our team members, as well as Chainlink for this amazing experience and competition.

What we learned

-How to effectively integrate chainlink for accurate data feeds for cross-chain protocols -Building a simple and effective UI/UX for the seamless adoption of our products -How to better design liquidity pools to serve small retail traders -The method and process to build multi-token trading swaps We learned A LOT about building in web3: creating and testing smart contracts, UI/UX, the integration of the contract with the off-chain and on-chain, and what Chainlink has to offer us. We learned how difficult, powerful, and exciting building in web3 is. We learned how to use Chainlink contract libraries and oracles to fetch off-chain and on-chain data. As team members, we learned how to work together as optimally as possible – prioritizing team members’ productivity is just as important as prioritizing your own. When a team member needed assistance, we always hurry to offer assistance.

We had to use different programming languages, different testing frameworks, and different technologies Anyway, probably the most valuable lesson we have learned is that if you really want to achieve something, and if you have a good team, you can do that. And this is amazing for us! One of the most important lessons where topics related to Chainlink nodes, adapters, the configuration of the Chainlink Data Feeds, and many other related topics.

What's next for eruSwap

-Release the Alpha Testnet on January 2022 -Security audit of smart contracts -Release the Beta Mainnet -Pools model optimization -Reach $10M Total Value Locked on eruSwap protocol for Quarter 1 - 2023 -Oracle expansion

                                                         -----------------------------

Built With

Share this project:

Updates