Case Study: MathWallet using The Graph to create Uniswap Ranking

thegraph

The Graph provides a very convenient data index that, enables MathWallet to develop corresponding data applications in a flexible manner, adjust accordingly with user needs, and give users a better wallet experience.

Need Analysis

With the increasing number of token listing on Uniswap, many MathWallet users inquired about an Uniswap ranking overview, to facilitate the analysis and selection of token in different aspects such as liquidity, price changes, and listing time, etc.

After careful review of this request, the MathWallet team found that by following the traditional way of trying to retrieve blockchains data, we needed to fully capture and re-index the data on the chain. This was not only time-consuming, but also it does not cannot guarantee the data would be updated on time or stably.

After studying the Uniswap Subgraph provided by The Graph, we found that we can easily implement this function using The Graph’s subgraphs.

Development Process

First, we periodically obtain the required data based on Uniswap’s Subgraph:

https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2

Because the main data structure of trading pairs has been abstracted from their subgraph, we only need to add the index accordingly and update the data regularly.

Product Delivery

After only two weeks of development, we were able to successfully launch the Uniswap Ranking.

It not only supports the ranking in several important categories, but also supports the display of detailed information of the trading pair, helping users to fully understand the information of the trading pair when it comes to the decision making.


In addition, it also supports the search function based on the Pair contract and the Token contract.

After the product went live, it quickly became one of the top must-have functions for many MathWallet users.

Future Outlook

The Graph has completed multi-chain support, greatly facilitates MathWallet to migrate the product to other chains.

About MATH

MATH is a multi-chain and cross-chain blockchain assets hub, and its products including: MathWallet (supported 60+ blockchains including BTC, ETH, Polkadot, Filecoin, Solana, BinanceChain etc and 2M users), MathVault, MathDAppStore, MathStaking, MathCustody, MathNFT, MathChain, MathHub, MathDEX, MathID, MathPay etc. Our investors includes Fenbushi Capital, Alameda Research, Binance Labs, FundamentalLabs, Multicoin Capital, NGC Ventures.

More information, please visit: mathwallet.org.

About The Graph

The Graph is the indexing and query layer of the decentralized web. Developers build and publish open APIs, called subgraphs, that applications can query using GraphQL. The Graph currently supports indexing data from Ethereum, IPFS, and PoA with more networks coming soon. To date, over 16,000 subgraphs have been deployed by ~20,000 developers for applications, such as Uniswap, Synthetix, Aragon, Gnosis, Balancer, Livepeer, DAOstack, AAVE, Decentraland, and many others.

If you are a developer building an application or Web3 application, you can use subgraphs for indexing and querying data from blockchains. The Graph allows applications to efficiently and performantly present data in a UI and allows other developers to use your subgraph too! You can deploy a subgraph or query existing subgraphs that are in the Graph Explorer. The Graph would love to welcome you to be IndexersCurators and/or Delegators on The Graph’s mainnet. Join The Graph community by introducing yourself in The Graph Discord for technical discussions, join The Graph’s Telegram chat, or follow The Graph on Twitter! The Graph’s developers and members of the community are always eager to chat with you, and The Graph ecosystem has a growing community of developers who support each other.

The Graph Foundation oversees The Graph Network. The Graph Foundation is overseen by the Technical CouncilEdge & Node is one of the many organizations within The Graph ecosystem.