Paul Murphy
2022/10/27
Resources to check-out:
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.
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.
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.
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.
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:
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.
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.
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.
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.
Sign up for our newsletter for the latest product updates, partnerships, and more.