WorkflowCredmark Logo

It’s Time to Decentralize Crypto Prices

Credmark’s prices do just that

Paul Murphy

2022/10/27

Resources to check-out:

  • Read more about Credmark's solution for deriving prices off of DEXes
  • How to install and run the Model Framework

Token prices are the base layer of just about every economic activity in the crypto universe. How much are your tokens worth? How well has your portfolio performed? Is this a good trade? Does staking this token make sense?

Without prices, we can’t answer those questions. Without accurate prices, we might not make the right decisions.

Prices matter, a lot. And since they matter so much, we should ask ourselves a few questions.

CEX-derived Prices Rule

Where do Prices Come From?

Token prices almost always come from centralized exchanges (CEXes). Sometimes synthetic prices are created by blending prices from multiple exchanges.

For traders using those exchanges, these price sources make sense. Those are, after all, the prices they have or could have gotten.

DeFi smart contracts get their prices from an oracle. And where do oracles get their prices? Mostly from CEXes, which is odd since decentralized exchanges (DEXes) are a fundamental part of DeFi.

When a developer uses CoinGecko’s API to retrieve prices, can they know the sources of those prices? No. According to their documentation the data comes from “various exchanges”¹. DeFi Llama recently officially stated² that the prices their API returns are from CoinGecko and “enhanced” with DeFi derived prices. And one of DeFi’s cornerstones, Dune Analytics, gets their prices from Coinpaprika, who derive their prices from their partners’, Crypto Runner and Binance.

How are Prices Computed?

There’s nothing wrong with synthetic prices. In traditional finance many firms exist for the sole purpose of creating synthetic prices from exchange feeds. Most publish how they produce those prices. If they didn’t, people wouldn’t buy them.

In crypto we haven’t gotten that far. Synthetic prices come out of black boxes. I’ve read documentation that claims they’re “volume weighted” or “liquidity weighted”, without any indication of how or where they acquired the volume or liquidity data.

And are any of the algorithms that produce these prices made public? Unfortunately not.

When it comes to crypto price production, we are in the dark. We don’t know the inputs and we don’t know what the black box does.

It’s time for DEX-derived Prices

All of this makes no sense from a Web3 perspective. In fact it’s anti-Web3.

Web3 is about decentralization and transparency.

CEXes are centralized by definition, and they aren’t transparent. DEXes, in large part because they are completely transparent, are less prone to manipulation than centralized exchanges.

Over time, liquidity has been moving from CEXes to DEXes. Some tokens, e.g., stETH, can’t even be traded on centralized exchanges.

Given all this, why should DeFi depend on CEX-derived prices? It shouldn’t.

Finally, an Alternative

Until recently there were no good sources of DeFi-derived prices. At Credmark we thought this would be an easy thing to fix. We were wrong. It was hard. It took us six months to:

  1. develop the algorithms that produce these prices,
  2. modify our infrastructure to compute and store historical prices, and finally
  3. spin up enough hardware to produce prices for the top 150 tokens for every block.
  4. The result was well worth the effort.

Transparent Prices

DeFi prices should be derived from DeFi data, the only transparent source of crypto data. It’s on-chain and verifiable.

Unfortunately, a developer can’t make a Web3 call to retrieve a price, because prices themselves aren’t stored on-chain. Luckily, all of the data necessary to derive accurate prices is available on-chain.

Credmark uses this data to produce historical and current token prices that are DeFi-native. We use liquidity and swap data from three of the largest DEXes (Uniswap v2, Uniswap v3, and SushiSwap). This data is verifiable. The algorithm³ we use to derive these prices is published on our platform as a model. Anyone can download the source code.

The output of this pricing model is available directly from our platform using a command line utility, calling the model directly via API⁴, or from our Token API⁵.

These prices are completely transparent, just like the DEXes that produce the raw data we use to compute them.

Democratic prices

These prices are also democratic. By that I mean that they are prices at which any DeFi user can trade.

Centralized exchange order books are opaque and the data is often questionable. Price manipulation can happen using fake trades, for example. The lack of transparency is problematic. Decentralized exchanges are much more difficult to manipulate. The liquidity in a pool determines price, nothing else.

Put simply, DeFi prices are more fair.

What’s Next

It’s ironic that the best DeFi prices are not available to smart contracts. It would be too expensive for them to produce prices from scratch, so they have to rely on oracles that get most of their data from centralized sources.

We look forward to seeing the emergence of other DeFi-native price providers so that we can collectively publish transparent, DEX-derived prices.

We also look forward to adding more DEXes to our raw data sources.

DEXes are growing faster than CEXes. In the future, decentralized exchanges will process more trading volume than centralized exchanges. This is inevitable.

CEX-derived price feeds will continue to matter to traders who use those exchanges. It’s time for DeFi to move on. It’s time for developers to start giving their users more reliable, transparent prices.

Footnote

  1. https://www.coingecko.com/en/methodology
  2. https://twitter.com/defillama/status/1571215888933699584?s=12
  3. Described in this post: https://credmark.com/blog/credmarks-dex-pricing-model
  4. https://gateway.credmark.com/api/#/DeFi%20API/ModelRunnerController_runModel
  5. https://gateway.credmark.com/api/#/Token%20API/TokenApiController_getPrice

About Credmark

Credmark runs a financial modeling platform powered by reliable on-chain data. We curate and manages DeFi data making it available via API and the Snowflake Marketplace around the globe and across industries.

Our community of quants, developers, and modelers actively build models for the DeFi community by leveraging our data API and tools. Join the growing community and together we will advance the next-generation financial system.

copy to clipboard

Sign up for our newsletter for the latest product updates, partnerships, and more.

Ready to get started?

Sign up for our free Token API

Get the latest news

Footer

Credmark logo
DiscordDiscord iconTwitterTelegramTelegram iconYoutubeYouTube iconGitHub

© 2023 Credmark Labs, Inc. All rights reserved.

Products

  • All Products
  • Token API
  • Portfolio API
  • DeFi API
  • Raw Data

Documentation

  • Token API Reference
  • Portfolio API Reference
  • DeFi API Reference
  • Transformation Reference
  • Framework Reference

Resources

  • FAQ
  • Blog
  • Reports
  • Media

About

  • Careers
  • About us
  • Community

Support

  • Status
  • Contact us