Here for the API?Start building with us today

Learn about DeCommas API
Introducing DeCommas Price Service
Price Service
October 27, 2023

Introducing DeCommas Price Service

It has been 4 months since introducing DeCommas Mission Control API. Since then, we’ve been busy building and developing the API,now supporting 13 networks and 16 endpoints. And we’re just getting started!

As a logical next step, we’re introducing DeCommas Price Service, a fast and robust price service for fetching accurate and highly updated price data.

DeCommas Price Service Explanation

If you have used any web3 app to check crypto rates, then you are halfway acquainted with Price Service. This service aims to provide the current market rates to any supported tokens presented on the web3 app. Tracking the actual price is often a long process with the low liquidity tokens, and DeCommas dissolves that into a better and faster process.

DeCommas Price Service provides a comprehensive overview of ERC-20 price calculations, using on-chain data from multiple decentralized exchanges pools. First version of Price Service currently provides data on Ethereum Mainnet on Uniswap v2 and v3. You can expect frequent updates on coverage in the coming weeks for the following networks:

  • Arbitrum
  • Arbitrum Nova
  • Avalanche
  • Optimism
  • BSC (Binance Smart Chain)
  • Fantom
  • Gnosis
  • Polygon
  • Polygon zkEVM
  • Base
  • opBNB
  • Linea

Here’s how our system processes the data to provide you with accurate price information. Examples are relevant to the mainnet EVM network.

An In-Depth price explanation

So how does Price Service work? Let’s take a look at the diagram below:

DeCommas Price Service scheme of requested data

The ERC-20 tokens the user has requested are processed through the DeCommas Price Service, backed by decentralized exchange pools. These pools are filled with on-chain data. So this way, we get the data from one source. To expand it beyond, DeCommas uses other sources as well. For example, as a project within the 3Commas ecosystem, we use their data simultaneously. We utilize the 3Commas Ticker API. This API aggregates prices for native coins from centralized exchanges. By combining these two methods, we can provide more accurate and comprehensive token price information.

Decentralized exchanges pools

Coming back again to Decentralized exchanged pools, these pools are where the requested ERC-20 tokens are paired either with a trusted asset or with WETH (wrapped native coin for a related EVM network). We use WETH as it is in the ERC-20 network and Uniswap works with ERC-20 by default.

All observed pools have sufficient reserves in trusted assets (greater than 1 ETH on the mainnet) to contribute to the pricing of the ERC-20 token.

To calculate the reserves in trusted assets, we rely on trusted pools.

Trusted pools

There are decentralized exchange pools that include high-liquidity trusted assets along with WETH. They are utilized by DeCommas Price Service to calculate prices for each of these trusted assets. To ensure accuracy, we calculate the value of USDC, USDT, and DAI in relation to WETH, and then multiply it by the current price of WETH from CEXes.

Trusted pools

As a result, we got the visualization of two combined methods here, where requested tokens refer to trusted pools.

Virtual Pool

Virtual pool is composed of ERC-20 token reserves gathered from various pools, where this token and trusted assets contribute, while WETH reserves are included from those trusted assets reserves with the assistance of trusted pools for price determination.

Composite pool, using the formula x * y = k at its core.

Centralized exchanges

There are centralized exchanges that provide frequently updated fresh prices in USD for ETH (native coin for a related EVM network). We are fetching aggregated ETH prices from multiple sources to ensure we get precise ETH prices to help calculate ERC-20 token prices mostly traded on Uniswap against ETH (in WETH form). With such an approach, even though we fetch new ERC-20 data from the chain every block (meaning there are a few seconds of limbo states between the blocks on the Mainnet), we’re also accounting for what happens with ERC-20 token price in USD terms between the blocks.

Summary of price explanation

To display the price of the requested ERC-20 token through the DeCommas Price Service, users will receive information about both the token’s native currency and its equivalent in USD to obtain the most accurate results.

To summarize the above ideas, let’s check this bulleted list of how the DeCommas Price Service functions:

  • DeCommas Price Service processes ERC-20 tokens using decentralized pools and data from 3Commas Ticker API to provide accurate pricing.
  • Tokens are paired with trusted assets or WETH in these pools, ensuring sufficient reserves for pricing with the help of trusted pools.
  • DeCommas uses decentralized pools with trusted assets to calculate prices. They relate USDC, USDT, and DAI to WETH values from CEXes.
  • Virtual Pool: This combines ERC-20 token reserves from various pools, including WETH reserves from trusted assets, with the assistance of trusted pools for price determination.
  • Centralized Exchange Data: DeCommas aggregates real-time USD prices for ETH from centralized exchanges to calculate ERC-20 token prices, accounting for updates during Mainnet block transitions.

Advantages and Functionalities of Price Service

Now that we understand the fundamental concepts behind DeCommas Price Service, let’s zoom in on the unique advantages and functionalities these bring:

  • DeCommas Price Service Speed

Usually, it takes up to 15–30 secs to update token prices, while DeCommas Price Service speeds up this time to 1–3 secs.

Now, most projects face the problem of Current Price Update Frequency (Price Freshness), which stands at roughly ±1 minute for all the 4000+ tokens verified by Competitor API. Seeing this as an area for potential growth and development, we took this as an opportunity.

An example of where Price Service is used

In order to resolve the problem of overwhelming tokens on the market and longer uploading time, DeCommas team introduced a solution: We have created our own Price Service that enables us to reduce the Price Freshness from 1 minute to an impressive 1–3 seconds while covering 20,000+ tokens. It creates a unique offering in the market.

DeCommas ERC-20 tokens coverage vs Competitor API

We track ALL Uniswap pools, in total over 260k tokens. After that we filter complete spam, non-existent liquidity and rugged tokens, providing data for those that still have at least 1 ETH in LP (Liquidity Pools).

Turning our attention to the other issues resolved by DeCommas Price Service, we made adjustments to:

  • Seamless Transition

Additionally, our API outputs closely align with the format of other APIs, ensuring a smooth and consistent experience.

  • Price freshness comparison

DeCommas Price Service API updates prices with a higher sample rate compared to other competitors. Price freshness on our side is block-to-block, meaning that price changes every new block validated on-chain.

AIMBA token Price Comparison

MASK Price Comparison

BABYSHIB Price Comparison

What’s next?

After launching the Price Service and its Get Price and Get Prices endpoints, we plan to gradually expand our supported networks as soon as possible. Currently, the Price Service offers ERC-20 token price data on the Ethereum Mainnet (Uniswap v2 and v3). In the following few months, we want to add support for the next networks:

  • Arbitrum
  • Arbitrum Nova
  • Avalanche
  • Optimism
  • BSC (Binance Smart Chain)
  • Fantom
  • Gnosis
  • Polygon
  • Polygon zkEVM
  • Base
  • opBNB
  • Linea

In developing our Price Service, we emphasize your feedback and value the opinions of our users. Please share your thoughts and suggestions on our Discord.

Getting Access is easy

Let’s wrap it up and show some final magic of DeCommas Price Service:

  • Estimations are done every block. Don’t miss a tick.
  • Taking into account all pools with >1 ETH in liquidity (for 20K+ tokens)
  • Service is written from scratch in Rust to ensure speed and efficiency.

Want to start using DeCommas Price Service? Head out here https://build.decommas.io or email us [email protected]. For more updates regarding our developments stay in the loop by following our Twitter(X).