Crypto News

  • What is Ethereum 2.0?

    Ethereum was birthed out of the idea that blockchains could power more than just decentralized money. Blockchains could, more expansively, power an entire decentralized economy. Seven years after this idea was conceived and five years after going live, Ethereum hosts tens of thousands of applications, over $100 billion in assets, and will settle nearly $1 trillion transactions in 2020. It underpins a burgeoning decentralized financial system as well as the majority of all stablecoin activity. But with Ethereum’s resounding success has come a problem: it is only capable of handing a mere 15 transactions per second. Under its current architecture, it is unable to scale as the world’s decentralized financial infrastructure. Enter Ethereum 2.0 Ethereum 2.0 is a major network upgrade, years in the making, that will increase Ethereum’s scalability, security, and energy efficiency without compromising on accessibility or decentralization. It is also a major upgrade to Ethereum’s native asset: ETH. Ethereum 2.0 will transform ETH as an asset, providing it with attributes of each of the three asset superclasses: Capital Assets Commodities Stores of Value ETH 2.0 will also fundamentally alter Ethereum’s monetary policy, potentially reducing its annual inflation rate to well below 1%. When is this happening? As Vitalik said in a recent AMA, Ethereum is going to be an ecosystem under rapid transformation for the next ~2 years. While that transition is already underway, it will kick into high gear once 16,384 validators stake a minimum 32 ETH to a deposit contact tied to Ethereum's new Proof of Stake chain. This will trigger the launch of Phase 0 and the Beacon Chain; the first major step towards the transition to Proof-of-Stake, and eventually sharding. In our upcoming report, Wilson Withiam and Ryan Watkins of the Messari research team outline the philosophy behind ETH 2.0, its multi-year road to implementation, the implications for users, investors, builders, and researchers, as well as the impact for ETH. Plus, commentary from eth2 infrastructure pioneer, Bison Trails. Register here to receive the report as soon as it's ready. Register here for our live ETH 2.0 event on December 2nd, featuring the teams and developers making ETH 2.0 a reality.
    Source: — Published: 2020-11-20T19:00:00Z

  • AMM Braindump

    This post is intended for: Ethereum DApp devs, DeFi traders, crypto product managers, Messari devs... and you! (we're hiring golang/react devs) It is the result of notes taken while integrating Uniswap into Messari's market data infrastructure and writing a Uniswap/Sushiswap arbitrage bot. -- AMM, DEX, Uniswap, Curve, Bancor, Balancer, xy=k, constant product, liquidity mining, yield farming. What do these words mean? And why should you care? Because AMMs are popular and understanding their various quirks will make you money (or help you avoid getting REKT from slippage). ELI5: They are apps or techniques involved with creating and participating in markets on Ethereum. Layman TL;DR: They are apps or techniques for creating financial incentives that enable self sustaining markets under the constraints of Ethereum. Academic TL;DR (Simon de la Rouviere voice): They are apps or techniques with"new novel signals to curate information". (this red curve is a result of the "constant product" function, xy=k, which is how Uniswap prices are defined) If you haven't personally used Uniswap yet. Try it. It will feel scary because it's almost too easy to use. You'll need an Ethereum wallet (Metamask) and some Ether (buy from any exchange, Coinbase, Binance, etc.). Transfer the Ether to your new Metamask wallet. Then use Uniswap to buy $1 of USDC using Ether. Hurray! You now have USDC! Then trade your USDC back for Ether. Each trade will probably cost ~$3 USD equivalent worth of gas, and the trading fees are 0.3%. Uniswap is an Ethereum app. The core functionality is based on the design of a "constant product" style of automated market maker (AMM). Automated market maker (AMM) is a generic term for a simple algo (aka bonding curve aka mathematical curve) that enable the equivalent of a stock exchange "market order" on a blockchain (Uniswap being the latest example). This means the "price" is a point on a mathematical curve (e.g. xy=k, see, it's simple!) as opposed to orders buyers and sellers have placed. They're a building block (think: stdlib) of DeFi because they're a clean solution for solving a generic problem: creating markets without an order book (aka price discovery). Why can't we use an order book? We can, but they don't make as much sense as an AMM that was designed to function under the constraints of the Ethereum blockchain (too slow and expensive to write limit orders). But AMMs aren't necessarily better than "order books". See SBF's (who advocates for an Ethereum alternative called Solana) argument for order books over AMMs here. His basis is that AMMs are only recently popular because of transient demand for "liquidity mining" (aka yield farming). Only history will tell if SBF (also the CEO of a centralized crypto exchange) is correct. And see a Dan Robinson tweet clarifying a common misunderstanding that Uniswap (constant product AMM) LPs lose money. Are AMMs just a blockchain-safe substitute for conventional "order books"? No, they're more abstractly a way to incentivize behavior and thus far a "good enough" alternative to order books. That means they're not just a "stock exchange market order" equivalent but rather a tool to incentivize behavior needed to sustain a use case. But that shouldn't be surprising since, again, it's just an algo. For example: Uniswap's "constant product" AMM design creates a sustainable ERC-20 exchange by incentivizing LPs with trading fees Bancor's AMM original "smart token" aka "bonding curve" design creates a sustainable organization (think ICO) by limiting how much of a token the founding team can sell Gnosis LMSR AMM design enables prediction markets (which have high "outcome space") hybrid AMM design enables a stablecoin exchange with less slippage than Uniswap's design In other words, AMM is a fancy term for an arbitrary function that returns a price based on the reserves of the staked tokens typically according to some mathematical curve picked for its ability to minimize price fluctuation for the intended use cases. That sentence is a mouthful... so just read it slowly. If you're a DeFi developer studying AMMs, I consider the following articles, must reads: (2018-12-03) Bonding Curves In Depth (explains the original "Bancor formula") (2018-12-11) Compares Bancor's "smart token" to Simon de la Rouviere's "bonding curve" (2020-01-03) Understanding Uniswap's "constant product curve" (2020-05-12) Andrew Kang Tweet on AMMs (2020-06-29) Weaknesses of current AMM designs and reducing them with oracles (2020-09-03) Academic paper explaining the most common AMM math designs (CP,CS,LMSR) What you should be thinking about while reading those is what happens at the limits of any particular design (where the price fluctuates aggressively). For example, with Uniswap's "constant product" design, the price approaches infinity as the reserves for either of the underlying tokens approaches zero. The limit or edge cases of the curves are interesting because most users never see it, but DeFi devs need to know how their systems perform under stress, and arbitrageurs need to know how to calculate profitable trades (based on curve behavior). What does Uniswap's data structure look like? { token0Reserves, token1Reserves } (yes, it's that simple) What methods? Essentially: Swap(), AddLiquidity(), RemoveLiquidity() How do we calculate a Uniswap price? By calculating ratio of token0Reserves to token1Reserves. If our hypothetical Uniswap pool has 400 units of USDC and 1 unit of ΞEther. The ratio of token0Reserves to token1Reserves is 400/1, or 400 units of USDC per unit of Ether (aka the price of ether in terms of USDC). The inverse ratio is 1/400, or 0.0025 units of Ether per unit of USDC (aka the price of USDC in terms of Ether). What happens "at the limit" (when 80% of Eth reserves are bought)? If our hypothetical example now has 0.2 units of Ether, that would mean it has 2000 units of USDC in order to preserve the "constant product" formula xy=k (k in this case being 400, which was defined at the last liquidity addition/removal by multiplying the reserves) - i.e. 400/0.2 = 2000. If the token0Reserves are now 2000 units of USDC, that means the price is now the ratio, or 2000/0.2 = $10,000 per unit of Eth!!! (even though there's only 0.2 Eth left in the reserves). In practice these limits are only reached by arbitrageurs or adversarial economic attackers since Uniswap has max slippage safety checks. What is Impermanent Loss? It applies to Uniswap LPs (liquidity providers are users who have deposited/staked their tokens into Uniswap to allow others to buy/sell that pair). It refers to the scenario where you're making less money as a Uniswap LP than you would simply holding the token you staked. Which leads people to ask why they ever staked in the first place. (collecting trading fees). It happens dramatically if the price of either token goes below -50% for either of the 2 tokens in the pool, use this tool to see for yourself (see how quickly the impermanent loss increases as the price change goes below -50%). What it literally means is the pool is being drained of the valuable token (perhaps Ether or a stablecoin) and what remains is an increasing supply of the valueless token. Ergo, be wary of adding liquidity to a pool where one of the tokens in the pool can dip in value by 50%. Come work with us! We're currently using Kubernetes, Golang, Postgres, InfluxDB, React (w/GraphQL). See our open roles for frontend and backend engineers and drop us a line at -J. Otto
    Source: Jonathan Otto — Published: 2020-11-16T15:00:00Z

  • Where Does Gold Come From?

    From the Messari daily newsletter: Subscribe In Bitcoin’s latest high profile adulation, famed investor Stan Druckenmiller stated, "frankly, if the gold bet works, the bitcoin bet will probably work better." If you’re in this space, you’re no stranger to comparisons between bitcoin and gold. Both are scarce, highly divisible, transferable, expensive to mine, and have supplies that cannot be tampered with, particularly by any government or institution. That’s where the similarities end. Bitcoin is a purely digital creation that exists only as entries in a ledger shared across a distributed network of computers. Its scarcity comes from code that dictates a supply of 21 million. The cost to mine it comes from the electricity expended in a global competition amongst computers (miners) racing to guess an arbitrary number. Gold on the other hand is a metal that we pull out of the ground. But if bitcoin was created by a pseudonymous programmer, then that begs the question… One of the fringe benefits of crypto is that it forces you to take a deeper look into how the rest of the world works. At the end of the day, most of what you see in this industry is simply the recreation of things that already exist, but in a purely digital environment. For example, want to understand what an automated market maker (AMM) like Uniswap is? First you need to understand what a market maker is. Turns out it's a basic function in finance that’s been around for as long as there have been markets. Thousands of years ago there was some guy in Mesopotamia with a big stockpile of wheat and barley who, for a small fee, was always willing to trade wheat for barley or vice versa to keep the market moving. Swap the wheat and barley for YAM and ETH and automate it on Ethereum and there you go. Uniswap. Want to understand what digital gold is and why it's valuable? Start with its physical analog and go down that rabbithole. You’ll end up in space a couple billion years ago before the earth was even formed. Disclaimer: getting a bit weird for your Friday; regular scheduled program resumes Monday Gold: the extra-terrestrial There’s a reason the Winklevii told David Portnoy that Elon Musk was going to make gold rain down from space, making it as plentiful as sand. Gold does originate from space, but that’s not the interesting part. The interesting part is how it gets created by a collapsing star and a cataclysmic explosion called a supernova. Quick primer on stars The familiar example of a star is “The Sun” - the big ball of gas that our planet revolves around and sets the rhythms of our days, seasons, and years. While it’s a big deal for us, from a cosmic perspective our sun is a dime a dozen. As ole Carl Sagan once said: “The total number of stars in the universe is greater than all the grains of sand on all the beaches of the planet Earth.” So in short, stars are big balls of gas and there’s a whole lot of them out there. What’s happening inside the star is what ultimately produces gold. The recipe for gold To understand this next part, we have to go back to high school chem class and revisit the lightest element on our periodic table: hydrogen. Stars are made up mostly of hydrogen gas. Since stars are so massive, gravity creates tremendous pressure at the star’s core. This pressure causes hydrogen atoms to bang into each other, which creates helium and gives off tremendous energy through a process called nuclear fusion. Nuclear fusion is what makes stars both hot and shiny. So nuclear fusion creates energy and turns hydrogen into helium, which is a slightly heavier element than hydrogen. Once nuclear fusion creates enough helium, that same process starts creating carbon, which is slightly heavier still. Next comes oxygen, then iron, then nickel, which are each slightly heavier than its predecessor. So as the hydrogen atoms at the core of a star bash into each other over the course of millions of years, creating other heavier elements, the star’s hydrogen slowly depletes. Once the star’s core runs out of hydrogen, the star collapses on itself. Boom. A supernova. A rare cosmic event that happens a few times a century. This collapse creates a ton of pressure which jams protons into electrons, forming neutrons. All of the heavier elements that had been formed by the star like iron and nickel combine with these neutrons and that’s the process that creates gold as well as silver, lead, and uranium - the heavy metals. Supposedly, this all happens in seconds. So if you’re still reading, heavier elements get formed through nuclear fusion over millions of years. In the rare event in which a star collapses and goes supernovae, heavy metals like gold and silver get formed in an instant. Ok, but how did gold find its way to Earth? How It Got Here Well the star that exploded propelled all of the elements it’d cooked up throughout the universe, so there’s a bunch of gas and stardust just kind of floating around. After enough time, gravity does its thing and all of that gas and dust starts to coalesce, forming planets. When the Earth was forming, a bunch of gold dust got thrown into the mix. Over the course of a few billion years, the Earth’s molten core caused that gold dust to clump together in the form we can expensively extract from the ground today. It’s estimated that from this entire process, we’ve mined just enough gold to fill three olympic sized swimming pools. With that limited supply, we’ve created money, jewelry, electronics, dentistry fillings, and Peter Schiff’s favorite hard asset class. Wrapping it up So there you have it. Stars turned a bunch of hydrogen into heavier elements over the course of millions of years before exploding and instantaneously creating heavy metals that got propelled through space, some of which made their way to Earth where a bunch of monkeys dug it out of the ground to create money and jewelry and an asset to argue about on the internet. The reason gold is scarce is because, while there is a ton of it just floating around the universe, for us humans it’s not so easy to recreate the cosmic process that forged it. That same process produced a metal that's pretty, malleable, and divisible. All qualities that, for one reason or another, we find valuable. Some of these qualities Satoshi imbued into Bitcoin. Mainly its scarcity and divisibility. He also added some qualities that make it much more transferable and verifiable. And that, my friends, is why our favorite magic internet money draws comparisons to a shiny space metal we pulled out of the ground. From the Messari daily newsletter: Subscribe
    Source: Connor Dempsey — Published: 2020-11-13T15:30:00Z

  • Running an Ethereum Node on Kubernetes is Easy

    People who were running an outdated version of Geth or were reliant on a vendor (Infura in this case) experienced a forked Ethereum (similar to a server going offline) Nov. 11, 2020, see the post mortem. No need to fear, having a properly updated Ethereum node is a lot easier than people think using "the cloud". Kubernetes is a "container orchestration platform", that's a fancy word for keeping docker containers running - and despite whatever complaints you've heard, it makes running and upgrading software like Ethereum painless. Just update version in the yaml file and apply it. You'll just need a big enough machine to run the Geth client, currently ~650GB of disk (and growing, so at least 1TB), and I'd recommend at least 8GB of RAM. You can get this from Digital Ocean for $80/mo - memory optimized 16GB instance. Then another $100/mo for the 1TB of disk. AWS and GCP might be slightly more expensive (they charge for the Kubernetes cluster). You can expect Geth to finish an initial quick sync in a few hours, then the rest of the data will be backfilled over days/weeks. If you don't have a Kubernetes cluster/instance/whatever, setting one up is usually "one-click" from Digital Ocean, AWS, or GCP, but it may take a few minutes before the system comes online. On your local machine (e.g. laptop) you'll install the kubectl command-line tool, and then authenticate with the cluster. Most tutorials look daunting but it really is this easy. you'll be running this command any time after updating geth.yaml (Kubernetes keeps state on the server so it knows, based on the type and name whether this "object" needs to be created or updated after running the apply command): kubectl apply -f geth.yaml where the contents of geth.yaml (it should be human-readable) are: apiVersion: apps/v1 kind: StatefulSet metadata: name: geth-mainnet-full spec: serviceName: geth-mainnet-full replicas: 1 selector: matchLabels: app: geth-mainnet-full template: metadata: labels: app: geth-mainnet-full spec: containers: name: geth-mainnet-full image: ethereum/client-go:v1.9.23 args: [ "--http", "--http.addr=", "--http.vhosts=geth-mainnet-full", "--http.api=eth,net,web3,txpool", "--ws", "--ws.addr=", "--datadir=/data", ] env: ports: containerPort: 8545 name: gethrpc containerPort: 30303 name: gethdiscovery volumeMounts: name: data mountPath: "/data" resources: limits: memory: 12000Mi requests: memory: 10000Mi volumeClaimTemplates: metadata: name: data spec: accessModes: ["ReadWriteOnce"] storageClassName: do-block-storage resources: requests: storage: 1000Gi To view geth logs in Kubernetes Run: kubectl get pods to see it running, get the name of the pod from the first column and paste it into the following command (remove the variable) kubectl logs $NAMEOFPOD To upgrade Simply edit (using your favorite text editor) the image field where it says 1.9.23 to whatever version you need. Then run: kubectl apply -f geth.yaml or edit it live on Kubernetes: EDITOR=vim kubectl edit statefulset geth-mainnet-full (applying a file or editing live updates the "state" and will trigger a reboot) To reboot (if for whatever reason the instance is unresponsive) kubectl rollout restart statefulset geth-mainnet-full To "ssh in" kubectl exec -it geth-mainnet-full-0 -- sh To proxy to your local machine (laptop) kubectl port-forward statefulset/geth-mainnet-full 8545:8545 If you prefer a GUI to monitor your Kubernetes cluster status and tail logs, see Or... if you're a dev looking to sling some code for the front page of crypto, you can work with us at Messari. -J. Otto
    Source: Jonathan Otto — Published: 2020-11-12T16:30:00Z

  • Understanding the Bitcoin Cash Hardfork and How Exchanges are Preparing for the Split

    It is all but inevitable that Bitcoin Cash will hard fork on Nov. 15, 2020. The first rumblings of a potential fork arose in late July of this year after a fracture formed between the two lead development teams for Bitcoin Cash over the implementation of a difficulty adjustment algorithm. The Bitcoin ABC (ABC) and Bitcoin Cash Node (BCHN) teams found themself in a standoff after leading ABC developer Amuary Sechet proposed implementing a difficulty adjustment algorithm labeled Grasberg. Grasberg was designed to solve three problems on the bitcoin cash network: Block production consistency Stabilize profit margins for miners Predictable emissions of coins. This proposal itself was not what caused the rift between the two development teams. Rather it was the fact that the ABC team made clear their intentions to unilaterally implement this algorithm without consent or agreement of the Bitcoin Cash Node team. A short time later, the groups held a meeting to attempt to resolve this conflict. While initially there was hope that cooler heads would prevail, the meeting quickly turned sour with multiple participants walking out. The ABC Team would go on to scrap the Grasberg Difficulty Adjustment Algorithm in favor of the Aserti3-2d (Asert) algorithm, but the die had already been cast and a split from the Bitcoin ABC development team from the Bitcoin Cash network was as good as done. Realizing a fork was likely the Bitcoin ABC team decided to double down on their attempt to independently control the Bitcoin Cash network, and shared their plans to implement a restructuring of the coinbase rewards to fund future development by ABC. This proposed change labeled IFP (Infrastructure Funding Proposal) would funnel 8% of the reward from newly mined blocks to an ABC owned address to fund development on the network. Bitcoin ABC previously attempted to implement this IFP in the May 15, 2020, network upgrade but failed to meet consensus requirements needed for it to be included in the upgrade. A restructuring of the coinbase reward is no small change, it is a complete shift of the incentives and security designed to protect the network. Unsurprisingly, the change was not met with the support of network miners. BCHN (the non-IFP implementation) is currently receiving 84.7% of support, signaled from miners, and will be the dominant chain after the fork barring any significant changes to the hash rate of the network. To understand the context around the restructuring of the coinbase reward you have to understand the context of the development of Bitcoin and Bitcoin-forks. Bitcoin does not change often and developers and supporters are hesitant to see any change no matter its size within the network. Even changes that could be considered upgrades often fail to get implemented. In the eyes of Bitcoiners, any new software or change to the network opens up a new attack vector for malicious actors to exploit or the opportunity for unforeseen network failures to be introduced. These reasons are why people can have confidence that the current design of the network and its current parameters, including the 21 million coin supply cap and fixed issuance schedule will not change. For a development group to independently restructure the Bitcoin Cash network to divert the block reward to a single address owned by a central entity is all but unthinkable. It is quite likely the ABC team and lead developer Amuary Sechet understands this and it is quite reasonable to assume that the implementation of this reward structuring would be a decision that leads to a hard fork of the network. After all, this fork was not caused by any singular change or proposed improvement but by the decisions of the ABC team to forgo achieving consensus on proposed improvements and unilaterally implement changes to the network. Bitcoin Cash is a network quite familiar with hard forks after all it is the most prominent Bitcoin fork and is currently the fifth-largest network by market cap. Every six months the network undergoes an upgrade. Taking place every May 15 and November 15, these upgrades open the possibility for dissenting opinions and plans for upgrades. We saw this play out in late 2018 when Bitcoin Satoshi Vision (BSV) hard forked from Bitcoin Cash on Nov 15, 2018, with its supporters wanting to implement larger block sizes and reduced transaction fees. A majority of exchanges and services providers have stated their intent to support BCHN as the dominant Bitcoin Cash network with some supporting ABC dependent on the consensus and user demand following the fork. The complete list of service providers and their positions on the fork can be found at the bottom of this post. List of service providers and their positions on the Nov. 15, 2020 BCH Hardfork Binance: Will suspend BCH deposits and withdrawals on Nov. 15, 2020. Will credit users holding BCH with both forks at a 1:1 ration based on a snapshot of BCH balance on Nov. 15, 2020. Bitgo: Is currently running BCHN nodes and expects it to be the dominant chain post-fork, all BCH services will be paused at 00:00 am UTC on Nov. 15, 2020. Bitmex: Will be following the fork closely and will decide which chain to support for Bitmex products following the fork. Bitfinex: Bitfinex will suspend deposits and withdrawals of BCH at 10:00 am UTC on Nov. 15, 2020. Bitfinex will take a snapshot of BCH balances at 12:00 UTC and BCH balances will be credited in equal amounts ABC and BCHN. Coinbase: Coinbase will run BCHN nodes and expects it to be the dominant chain post-fork. BCH ABC sends and receives will not be supported. FTX: BCH futures on FTX will settle to a single BCH index of the majority chain and any minority chain will not be included in the BCH index. For Spot markets and balance FTX will pause BCH deposits and withdrawals at 11:00 am UTC Nov. 15, 2020. FTX will credit users with the BCH from the chain with the most work done, if the minority chain is able to maintain 10% of the hashrate, FTX will enable users to withdraw coins from the minority chain based on a snapshot of BCH balances taken on 12:00 pm UTC. Houbi: Houbi will suspend all BCH trading pairs, deposits, withdrawals, and loan services before the fork before taking a snapshot of BCH assets as the basis for distribution of coins following the fork. Following the fork Houbi will open trading services for both ABC and BCHN. Kraken: Will support BCHN regardless of the outcome of the fork, may support ABC if the hash power on the ABC network is at least 10% of the hashpower of the BCHN network. If Kraken supports ABC they will provide its clients with an equal amount of ABC forked coins based on a snapshot of BCH balances at the time of the fork. Ledger: Ledger will suspend Bitcoin Cash services at 7:00 UTC on Nov. 12, 2020. The ledger will then monitor post-fork activity and decide if and when which network they will support. Ledger does not a timetable on when Bitcoin Cash services will be restored. Trezor: Will continue to support Bitcoin ABC implementation following fork but will consider changing to BCHN depending on customer interests. Will not be distributing coins from the split and users who wish to take part in the fork should transfer their BCH balances to a different wallet provider.
    Source: Aidan Mott — Published: 2020-11-09T19:00:00Z

  • Arbitraging Uniswap and SushiSwap in Node.js

    The fourth in a series from our engineering team focused on the intersection of money and technology. See our previous from J. Otto on why Bitcoin is easier for payments than Stripe. Check out our open engineering roles here. Uniswap and SushiSwap are like stock exchanges, but on the Ethereum blockchain. Arbitrage in this case means buying something on one exchange and immediately selling it elsewhere for a profit. There are many arbitrage opportunities on Ethereum, but this particular example is easy to explain in a short blog post because SushiSwap is a fork of Uniswap which means their APIs are the same. You’ll need node.js and an Ethereum node to follow along (either run your own or use Infura/Etherscan). The business logic for this bot will be: Monitor latest prices on Uniswap and SushiSwap Decide whether to trade Execute trade Can profit be made here? Maybe. This post will help you hit the ground running, and then give some ideas at the end for how to be competitive and maybe profit. Here's the high-level pseudo code of how we’ll architect this bot: subscribeTo(uniswap, "usdc", "eth", (latestTrade) = { latestUniPrice = latestTrade.price; if (profitableArb(latestUniPrice, latestSushiPrice)) { executeTrade("usdc", "eth"); } }); subscribeTo(sushiswap, "usdc", "eth", (latestTrade) = { latestSushiPrice = latestTrade.price; if (profitableArb(latestSushiPrice, latestUniPrice)) { executeTrade("usdc", "eth"); } }); In practice, we’d do this for the intersection of all markets on both Uniswap (Uniswap currently has ~19,000 markets) and SushiSwap (currently has ~220 markets), but this blog post will focus on USDC/ETH alone. First, we’ll cover subscribing to the latest trades from Uniswap and SushiSwap. Monitoring latest prices See these ~60 lines of node.js code to copy and paste to see the price of Ethereum quoted in USDC every time there’s a trade on Uniswap (you’ll need to connect to an Ethereum node) To make it work for SushiSwap you only need to change one variable: the address of the smart contract to subscribe to (each market for Uniswap and SushiSwap is a separate smart contract). In this case, change the uniswapUsdtWethExchange variable on line 5 to 0x397ff1542f962076d0bfe58ea045ffa2d347aca0. Where did I get that address? I grabbed it from here: but it also be found directly from the getPair method on the SushiSwap factory contract here: To scale this up for the intersection of all markets, you can use the allPairs() + getPair() methods from the Uniswap and SushiSwap “factory” smart contracts. (The Uniswap platform is made up of 3 components: “factory”, “router” and N “pair’s”) Decide whether to trade So now you’re monitoring the price for USDC/ETH on both Uniswap and SushiSwap. How do you know if a trade is profitable or not? There are 3 (math) factors: the Uniswap and SushiSwap trade fee (0.3% on each) the Ethereum transaction fee (approximately $4 USD at time of writing). Slippage on the Uniswap market and slippage on the SushiSwap market The first one is the most important: the price difference after a trade fee: function estimateProfitAfterTradingFees(uniswapPrice, sushiswapPrice) { const diff = Math.abs(sushiswapPrice - uniswapPrice); const diffRatio = diff / Math.max(sushiswapPrice, uniswapPrice); // multiply by 2 because we trade 2 times // (once on Uniswap and once on SushiSwap) const fees = UNISWAPFEE 2; return diffRatio - fees; } If the profit after trading fees is greater than $0.01 USD equivalent, should we do the trade? No, because the Ethereum transaction fee (gas) will probably cost $4 USD equivalent. OK, what if the profit was $4.01, should we do it then? Yes, if the amount we’re buying doesn’t move the price. OK, how do I know if it moves the price? You calculate the slippage, which can be derived from the size of both “reserves” (liquidity). Uniswap and SushiSwap are “AMM’s” - a fancy term for an object that looks like this: { token0Reserves: 400, token1Reserves: 1 } With 3 methods: depositLiquidity, withdrawLiquidity, swap. Notice the actual data in the object: 2 numbers, 1 for each token (400 and 1). Those numbers represent the number of tokens in this smart contract, the liquidity. Notice that if you multiply those reserve numbers, the result is 400. This is referred to as the “product” (mathematical product) and is defined by the initial depositor into the smart contract based on the size of their deposits of each token (it’s an arbitrary number but it never changes after inception, so that means we can treat it as a mathematical relationship) To get the price of token1 simply find the ratio: 400/1 or 400. To get the price of token0, take the inverse of the ratio: 1/400 or 0.0025. These AMMs are 2-way: a user can buy token0 selling token1, or buy token1 selling token0. Back to the point, how do we calculate the slippage? We’ll use the relationship between the constant product of 400 and reserve sizes to see prices at various percentages of the supply of token1 reserves. For example, to calculate price of token1 after buying 50% of token1’s supply, we’ll solve for how many units of token0 would need to exist to maintain the constant product of 400 if only 0.5 units (50% of the original quantity of 1) of token1 exist. constant product = token0 reserves token1 reserves; 400 = token0Reserves (10.5) Solve for token0Reserves: 400 = 0.5 token0Reserves 400/0.5 = 800 That means there will be 800 units of token0 and 0.5 units of token1 in the reserves after buying 50% of token1. Thus the new price (ratio) will be 800/0.5 = $1,600. Does that mean it costs $1,600 to buy 50% of the supply here? No, the actual cost paid is somewhere between the original price of $400 and final price of $1,600. In this case we received 0.5 units for increasing the token0 reserves by 400 units (800-400)/0.5 = 800. That’s an average price of 800 token0 for 1 unit of token1. (a 100% price increase). Don’t be fooled, it’s not a linear relationship, buying 80% of the supply would cost an average price of 1333 units of token0 per 1 unit of token1 (233% price increase). Note this exponential relationship because you’ll see it often in liquidity pools where small orders can move the price significantly. I recommend this for further reading on Uniswap. With slippage, we can augment our estimateProfitAfterTradingFees function with another function, findMaxBet, to decide how many units of token0 we can buy before the price moves past our break even point: const profitRate = estimateProfitAfterTradingFees(uniPrice, sushiPrice); const maxBet = findMaxBet(profitRate, uniReserves, sushiReserves); const expectedProfit = maxBet profitRate; if (expectedProfit 0) { executeTrade(maxBet); } BUT this trade will fail to complete 100% of the time. Why? Because either a competing arb bot will make the trade for less profit, or a generic front running bot will clone your transaction with a higher gas price. A naive solution would simply allocate 100% of estimatedProfit to gas and then reduce it until transactions start failing (competing bots). function getGasPrice(n = 1) { const fixedFee = 0.0001 n; const gasPrice = (expectedProfit - fixedFee) / ESTIMATEDGASUSAGE; } Executing the trade Before we can execute a "swap" on Uniswap or SushiSwap we need to call the "approve" method on each individual ERC20 you want to trade with each exchange you want to trade. For our scenario, we'll need 4 approvals: const uniswapRouterAddress = "0x7a250d5630b4cf539739df2c5dacb4c659f2488d"; const sushiswapRouterAdress = "0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f"; const usdcErc20Address = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"; const wethErc20Address = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"; // allow Uniswap and Sushiswap to move up to 1000.0 of my units of USDC approveUniswap(usdcErc20Address, 1000.0); approveSushiswap(usdcErc20Address, 1000.0); // allow Uniswap and Sushiswap to move up to 5 of my units of ETH approveUniswap(wethErc20Address, 5.0); approveSushiswap(wethErc20Address, 5.0); const gasPriceGwei = "100"; // in GWEI const gasPriceWei = ethers.utils.parseUnits(gasPriceGwei, "gwei"); const wallet = new ethers.Wallet( Buffer.from( "", // paste your private key from metamask here "hex" ) ); const signer = wallet.connect(provider); function approveUniswap( erc20Address, amountToApproveInNativeUnitFloat ) { const erc20Contract = new ethers.Contract(erc20Address, erc20Abi, signer); return erc20Contract.decimals().then((decimals) = { return erc20Contract .approve( uniswapRouterAddress, ethers.utils.parseUnits( ${amountToApproveInNativeUnitFloat}, decimals ), // manually set gas price since ethers.js can't estimate { gasLimit: 100000, gasPrice: gasPriceWei } ); }); } With the approvals done, we can finally execute a trade: const uniswapRouterAbi = [ "function swapExactTokensForTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)", ]; function buyEthWithUsdc(amountUsdcFloat) { const exchangeContract = new ethers.Contract(uniswapRouterAddress, uniswapRouterAbi, signer) // usdc uses 6 decimals return exchangeContract.swapExactTokensForTokens( ethers.utils.parseUnits(${amountUsdcFloat}, 6), ethers.utils.parseUnits(${amountUsdcFloat}, 6, // this is the expected minimum output [usdcErc20Address, wethErc20Address], // notice the ordering of this array, give usdc, get weth wallet.address, createDeadline(), // Math.floor( / 1000) + 20 createGasOverrides() // { gasLimit: ethers.utils.hexlify(300000), gasPrice: gasPriceWei } ); } // aka sellEthForUsdc function buyUsdcWithEth(amountEthFloat) { const exchangeContract = new ethers.Contract(uniswapRouterAddress, uniswapRouterAbi, signer) // eth uses 18 decimals return exchangeContract.swapExactTokensForTokens( ethers.utils.parseUnits(${amountEthFloat}, 18), 0, [wethErc20Address, usdcErc20Address], // notice the ordering of this array: give weth, get usdc wallet.address, createDeadline(), // Math.floor( / 1000) + 20 createGasOverrides() // { gasLimit: ethers.utils.hexlify(300000), gasPrice: gasPriceWei } ); } Dark Forest Tactics This guide executes 2 separate transactions per trade, but in practice we’d deploy a smart contract that could batch these trades into a single transaction. We’d also attempt* to hide our transactions so as to prevent generic front running bots. -J. Otto Come work with us! If you LOVE to write code and you like Messari, we’re hiring. Check out our open roles for frontend and backend engineers and drop us a line at
    Source: Jonathan Otto — Published: 2020-11-05T16:00:00Z

  • Towards A New Data Marketplace: Ocean Protocol V3 Release

    By now, everyone has heard the refrain “data is the new oil”. This metaphor grows more accurate the deeper you take the metaphor. Data in its raw form, like unrefined oil shares multiple similarities: Both resources are hard to utilize in their unrefined forms Data is costly to manage and store on an ongoing basis, although not as expensive as oil Data and oil require multiple levels of expensive processing. For data, this comes in the form of data cleaning and labeling However, a key difference is that the same data source can be consumed multiple times and combined with other information to provide greater value. Data becomes useful when individuals or entities can connect the dots. Source: David Somerville™ @smrvl How Ocean Protocol is Creating Value-Add Data Ocean protocol is built for data scientists. While data visualizations are often the viral components of a data scientist’s work, the vast majority of a data scientist’s time is spent gathering and cleaning data before analysis. Valuable data requires effort to collect, such as web scraping millions of websites, transcribing audio to text, or other technical and tedious tasks. Data cleaning (labeling, filtering, editing) similarly requires time and methodical effort to parse through. Ocean Protocol recently released V3 of its protocol this week which supports exciting concepts like a data marketplace, datatokens, and initial data offerings (IDOs). These new features enable data scientists and engineers to enhance their work process by creating an open ecosystem for selling or purchasing valuable data. Ocean Protocol’s new datatokens are representations of datasets or data services where one datatoken unlocks access via Ocean smart contracts. Datatokens are ERC-20 tokens that can be listed on exchanges or compatible with DeFi protocols for the purpose of lending, derivatives, or other functions. As the world shifts to tokenizing all types of information, datatokens represent a unique opportunity for commoditizing the value transfer of data and information. However, information that is valuable to companies is usually sensitive. Consumer healthcare information, immigration status, and identification data can be manipulated or abused if shared incorrectly. To this end, Ocean’s “compute-to-data” feature allows data publishers to sell private data while preserving privacy. Additionally, datatokens are publicly tradeable on Ocean Market, a decentralized exchange powered by Balancer where individuals (data curators) are able to identify quality datasets and stake OCEAN tokens on the credibility of the dataset. Source: Ocean Protocol Dataset Liquidity Pools Stakers are paid proportional to the sales volume on the datasets that they claim are credible. However, one of the most exciting features of the V3 Ocean Protocol release is the potential for data token sales. Similar to Balancer's initial token offerings, Ocean Market will support initial data offering (IDOs), whereby datatokens for a corresponding dataset and OCEAN tokens will be issued into a pool. Datasets and respective data tokens can be created by anyone and priced according to the data’s value. However, the more valuable datasets will likely be those with added value, whereby a data scientist or analyst has already processed, labeled, and refining the data. The commoditization of data has yet to be achieved because data is siloed, sensitive, or proprietary. Ocean Protocol is a new solution to create an open marketplace where sensitive data can be shared and proprietary data can be accurately priced and sold. Turning data into tangible data assets (tokens) will unlock value, developing a more robust data ecosystem.
    Source: Mason Nystrom — Published: 2020-10-30T13:23:00Z

  • Stripe is Easy, Bitcoin is Easier

    The third in a series from our engineering team focused on the intersection of money and technology. See our previous from J. Otto on Why Blockchains matter. Check out our open engineering roles here. Most are familiar with Stripe's "achievement" of simplifying online credit card payments for web merchants to 2 Jira tasks: add Stripe's credit card widget to your frontend add an HTTP endpoint to your backend for Stripe to hit (a webhook) But Bitcoin pioneered a new era of "send money to my public key". An abstraction for the idea of money so simple yet effective enough to do what previously required: Stripe - credit card companies - banks - governments. Wanna receive Bitcoin as a web merchant? Generate a keypair, hash the public key, email/text the hash (or QR code) to the customer/payer. No KYC, no 3rd party custodian, no governments, and it can be done offline. Instant settlement bliss. "Come on, all devs and Bitcoin fanatics say that! Talk is cheap! Show me the code!" It's so easy that the only thinking ("brain damage" as the @TwoBitIdiot would say) you'll have to do is how to manage (rotate, and cold storage) your private keys securely (outside the scope of this article). We'll use Node.js and the following NPM packages (NPM being the Node.js package manager du jour): electrum-mnemonic (for parsing a seed phrase created from an Electrum Bitcoin wallet) bitcoinjs-lib (for creating bitcoin addresses from a public key) got (for making HTTP requests) satoshi-bitcoin (for handling Satoshi/Bitcoin strings/numbers) And 2 of our own functions: createBitcoinAddress(), and getBalanceOfAddressInSatoshis() Technically we could receive all money in a single Bitcoin address, but creating addresses per invoice is a “best practice” because it gives us: pseudo-anonymity, and simpler billing business logic (does the expected balance for an account/invoice exist or not). So if we're creating Bitcoin addresses (public keys) at scale, here are 2 options: generate public/private keypair when creating an invoice and persist the keypair to a database use a single "seed phrase" to generate/fetch infinite public/private keys indexed by integer (HD Wallet) We'll use the seed phrase approach for 3 reasons: the ability to monitor all addresses created from that seed phrase in the Electrum desktop wallet app, so we only have to store an index, and so we can inject the production seed phrase via environment variable so the keys aren't in a codebase or database. Here's what it looks like: const bitcoin = require("bitcoinjs-lib"); // Electrum has their own methodology for seed phrases // // But fortunately, someone wrote a library to parse them for us const mn = require("electrum-mnemonic"); function createBitcoinAddress (hdIndex) { // This is the 12 word seed phrase that you can generate when creating a new wallet in the // Electrum wallet app (and many other places) const seedPhrase = process.env.SEEDPHRASE; const seed = mn.mnemonicToSeedSync(seedPhrase, { prefix: mn.PREFIXES.segwit, }); const root = bitcoin.bip32.fromSeed(seed, bitcoin.networks.bitcoin); // // The "derivation path" is where the magic happens (not really), but you need to be // aware of it so you're generating the same addresses (keypairs) that would exist // in the Electrum Wallet desktop app (so you can monitor all your addresses from a GUI) // you see the path format that Electrum uses in its address pane. // Right click any address and click details to see its derivation path. const node = root.derivePath(m/0'/0/${hdIndex}); const bech32Address = bitcoin.payments.p2wpkh({ pubkey: node.publicKey, network: bitcoin.networks.bitcoin, }).address; return bech32Address; }; But what value for the hdIndex parameter should you pass? One simple option is using an auto incrementing serial bigint column from an “invoices” table in a relational database. The database will safely ensure uniqueness of that column so we can use it for creating unique (but retrievable) Bitcoin addresses. In our frontend, we'd present the address returned by this function call: createBitcoinAddress( and an amount due. Our customer can paste that address into their Bitcoin wallet (we can also present this Bitcoin address as a QR code) and enter/paste the appropriate amount to be paid. Now for getBalanceOfAddressInSatoshis(), we'll actually need to read from the Bitcoin network. We could run and query our own Bitcoin node directly, or we can hit a public Bitcoin gateway offered by plenty of vendors competing for YOUR business. 2 examples from the first page of google: Sochain or Blockcypher. const got = require("got"); const sb = require("satoshi-bitcoin"); function getBalanceOfAddressInSatoshis (address) { return got .get(${address}) // this data can come from a Bitcoin node or any Bitcoin gateway service like sochain, blockcypher .json() .then(res = // wait for at least 1 confirmation before considering it ours .then(txs = txs.filter(tx = tx.confirmations 0)) // parse the stringified bitcoin units into numeric satoshi units .then(txs = = sb.toSatoshi(tx.value))) // sum the results, and yes, JavaScript’s Number.MAXSAFEINTEGER 2100000000000000 // which is the total number of Bitcoin satoshi units that will ever exist) .then(txSatoshis = txSatoshis.reduce((memo,s) = memo + s, 0)) } The last part of accepting a payment is the general business logic that would be similar for Stripe and Bitcoin: did I get paid or not?! Here's what that looks like: const sb = require("satoshi-bitcoin"); const bitcoinAddress = createBitcoinAddress(; const balanceOfAddressInSatoshis = await getBalanceOfAddressInSatoshis(bitcoinAddress); const balanceOfAddressInBitcoin = sb.toBitcoin(balanceOfAddressInSatoshis); const paymentDueInBitcoin = 0.01; if (balanceOfAddressInBitcoin = paymentDueInBitcoin) { // 1. update invoices set paidat = now() where id = $1 // 2. deliver value to customer for completed payment // 3. possibly send all or some of this to a cold wallet } That's it! Bitcoin is readily usable in apps and servers with just a few lines of code. Stripe is easy, Bitcoin is easier. -J. Otto Come work with us! If you’re a software engineer interested in helping us contextualize and categorize the world’s crypto data, we’re hiring. Check out our open roles for frontend and backend engineers and drop us a line at
    Source: Jonathan Otto — Published: 2020-10-29T14:40:00Z

  • PoolTogether Launches New No Loss Protocol

    Last week, we wrote about PoolTogether in anticipation of its future V3 launch. Well, that day came sooner than expected and PoolTogether V3 is now live. Check out my full piece to read about the potential of PoolTogether. To refresh your memory, PoolTogether is known for its “no-loss lottery.” This works by putting the proceeds from lotto ticket sales (paid in Dai) to work in a lending protocol like Compound where it earns interest. The winner collects the accrued interest and everyone else gets their contributions refunded. No one loses. To date, PoolTogether has garnered over 12,000 cumulative lottery players which makes it one of the most utilized protocols in DeFi, not including decentralized exchanges. A New Protocol With New Yield This V3 release transforms PoolTogether from a smart contract into a fully-fledged protocol. With this upgrade, PoolTogether is capable of handling bigger prizes, lower gas costs, new asset types, yield sources, and more complex functions. The protocol has launched with just one weekly prize pool using Dai. Once this prize pool grows to a $10,000 weekly prize (which requires ~8 million in deposited funds), there will be a community vote on what the next prize pool will be denominated in. The protocol supports the creation of prize pools using any asset listed on Compound and pools can also use yEarn vaults to earn additional yield. The PoolTogether protocol also has more flexibility to accrue a wider range of governance tokens. From the previous version, PoolTogether has already accrued 15,000 COMP tokens worth ~$1.7 million from allocating Dai ticket sale proceeds to Compound. In V3, they can allocate ticket sale proceeds to protocols like Curve and earn CRV tokens, for example. Progressive Decentralization The V3 release is a step towards full protocol decentralization by implementing the following features: Removes upgradability from the core prize pool contract storing deposits Eliminates the need for a privileged administrator to manage prize awards Removes reliance on the core team for randomness generation Still, the V3 protocol requires management of some parameters and so governance of the protocol is still operated by the PoolTogether company. However, the team plans to decentralize control of the PoolTogether protocol as soon as possible. How or when PoolTogether plans to further decentralize is still TBD. One likely scenario is that the team will eventually release some form of governance token - potentially underpinned by fees - that oversees the protocol. The team behind PoolTogether already discovered a worthwhile use case and established product-market fit. Some key metrics to watch moving forward are how quickly the PoolTogether team reaches its ~$8M TVL target, and which assets are added into new pools. The DeFi ecosystem continues to build a chest of money legos and it’s exciting to see how they are pooled and pieced together.
    Source: Mason Nystrom — Published: 2020-10-23T13:15:00Z

  • Q3 2020 Web3 Review: NFTs Surge While The Foundation for Community Tokens is Paved

    Read the full report Use the offer code NFTQ3 for a free month of Messari Pro! In the world of Web3, Q3 was defined by the growth of non-fungible tokens (NFTs) and the rise of community tokens. Cumulative lifetime NFT sales volume exceeded $130million. This was sparked by the various implementations of NFT liquidity mining and renewed interest in digital ownership. Alongside the rise of NFTs, the top community tokens - which are tokens issued by an individual or group - surged to a combined fully diluted market capitalization of over $150 million with no signs of slowing down. Our Q3 Web 3 Review breaks down and reviews what NFTs and community tokens will have to offer going forward.
    Source: Mason Nystrom — Published: 2020-10-20T14:00:00Z

  • Q3 2020 DeFi Review: DeFi Reaches Peak Exuberance Before Coming Back Down to Earth

    _Read the full report_ Use the offer code DEFIQ3 to get a free month of Messari Pro! It was the best of times, it was the worst of times. In Q3, liquidity mining drove both DeFi usage and token prices to all-time highs as the space was flooded with increased capital and attention. DEXs that were trading in the single-digit millions at the start of the year surpassed $1 billion in a single day. Projects with names like Yam.Finance and Spaghetti Money were spun up in a matter of days and managed to lock up nine figures of value as mercenary capital flowed from one yield farm to the next. AMMs shined and we saw the emergence of Andre Cronje’s Fast follower forks were coming out of the woodwork and the sheer variety of profitable on-chain opportunities sent Ethereum gas fees and congestion to unprecedented levels. Eventually the music stopped, sending most DeFi tokens down over 50%. Fast follower forks faded into irrelevance, while Uniswap maintained its dominance following a brazen vampire attack. Throughout it all, Maker and Aave loan activity gained steam while VCs placed bets on the next wave of DeFi derivatives platforms, and Bitcoin’s migration to Ethereum accelerated. For all the nonsensical food tokens that came and went, Q3 saw an equal number of innovative experiments play out in real time. Experiments that could fundamentally alter how early stage networks are bootstrapped, how users are rewarded for their time and money, and most importantly, how our financial system could look one day if it were built on open, permissionless, censorship-free infrastructure that prioritizes inclusion, transparency, and fairness.
    Source: Jack Purdy — Published: 2020-10-19T14:30:00Z

  • Dreams of DCEP-tion

    This week, 10 million DCEP worth about $1.5 million was airdropped to 50,000 randomly selected people. While that sentence reads like a 2017 CoinDesk byline, DCEP is not your run of the mill shitcoin; it’s China’s digital currency (DCEP stands for Digital Currency - Electronic Payment). To dish out these fresh digital bills, the government held a lottery in the city of Shenzen, where according to officials, nearly two million residents registered to enter. Winners were able to claim their prize, amounting to about $30 USD, by downloading a digital wallet through a state run app. From there, they could spend it at 3,800 designated outlets. So if you’re like me, you're reading this and asking yourself, “what is this thing?” How exactly does DCEP work? Once I set out to answer that question, I soon realized that the CCP has been stingy with releasing any official documentation for our reading pleasure. Most reports seem to cite comments made by Chinese officials in the wake of Facebook’s Libra announcement. (The Block’s mammoth CBDC report and Boxming are each solid resources.) DCEP is issued by the People’s Bank of China (PBOC), pegged 1:1 with the Chinese Yuan and backed by PBOC reserves. As you can probably guess, China’s digital currency won’t have all of the hallmarks of your typical cryptocurrency. For one, there won’t be a publicly auditable ledger or an underlying distributed network of rational economic actors maintaining it. The CCP will handle that part through a two-tier system of databases in cooperation with commercial banks. Reports do seem to suggest that DCEP is made out of some of the same “stuff” as bitcoin and its brethren. Specifically, asymmetric cryptography (public & private keys) and some level of a UTXO transaction model. These elements will allow DCEP to mimic the peer-to-peer nature of bitcoin, but with full traceability and without any of that pesky pseudo-anonymity. While details will likely continue to trickle out about its specific design, at this point it's clear that China’s DCEP is a different kind of beast when compared to your typical government issued fiat currency. China’s Motivations There’s a lot of reasons why China has been barrelling ahead with a digital currency. From a government perspective, the ability to inject money into select populations comes with its benefits. For example, if certain regions need aid during a pandemic, officials can essentially press a button and deliver funds just as efficiently as delivering lotto winnings. In general, DCEP should give the Chinese precision control over its monetary policy. Another commonly cited motivation for China’s DCEP is to claw back some of the power from the duopoly of WeChat Pay and AliPay - the dominant means of payment in China. Additionally, where WeChat Pay and AliPay are difficult to access without a Chinese bank account, DECEP will be accessible to anyone who downloads the government’s digital wallet. This should make the Yuan more accessible to outsiders, which is very much in China’s interests. China has also made no secret of its ambitions to be the world’s dominant superpower. To achieve that, it helps to have your currency be dominant in all forms of trade. China believes the way to break the global monopoly of the US dollar is by building a better product. Where the good ole USD is running on decade old infrastructure, DCEP has been built for the digital age. As China’s Belt and Road Initiative seeks to better connect Asia with Africa and Europe through economic cooperation, it’s in China’s best interest that trade can be conducted without the US dollar. Just as the CCP can spark economic activity in Shenzen by instructing people to download an app, they’ll likely look to implement similar measures at the commercial level. Global Response It’s hard to discuss DCEP without mentioning its potential to be an Orwellian nightmare. Patents filed by the PBOC cite, “controlled anonymity”, as a key feature. This will allow two parties to transact anonymously with one another, while giving the central bank access to all transactional information. If you’re a Western power, you’re likely less concerned about potential privacy issues and more concerned with this new payment system’s ability to bypass the Western-dominated SWIFT system for international payments altogether. This would make anyone using the new system impervious to any form of economic sanctions - a compelling draw for the Russians, Irans, and Venezuelas of the world. The heat is on for Western powers to ramp up their efforts to modernize their financial systems, or risk being leapfrogged by a new one. Look for central banks around the world to accelerate their efforts to fully digitize. -CD Article initially appeared in Messari's Unqualified Opinion's newsletter. Subscribe here.
    Source: Connor Dempsey — Published: 2020-10-16T15:00:00Z

  • Why Blockchains Matter

    The second in a series from our engineering team focused on the intersection of money and technology. Check out Part I from Diran on Messari's Uniswap integration here. Check out our open engineering roles here. Bitcoin not Blockchain. Or Blockchain not Bitcoin? It wasn't until the summer DeFi craze of 2020 that I finally, viscerally, understood the abstract use case for blockchains. It occurred to me while nervously depositing money (in the form of a stablecoin) into a Yearn Finance vault. Suddenly, I felt the weight of moving my own "real" USD money into a black box. There is no recourse here, no real-world laws or courts to protect me. But the value of an open computing platform like Ethereum finally hit me. This wasn’t a black box. I could manually inspect the exact source code of the app I was interacting with. This means I didn't need to trust a company or a government to save me. If I was confident the code worked, then I could be confident that my money was safe. This is why blockchains matter. I don't need to trust a third- party human or organization. Instead I trust code that I can read. Blockchains aren’t magical; they’re trusted computing platforms. They’re a building block for the information age and should be evaluated as such. Evaluating Blockchains Once I saw Ethereum abstractly as a trusted computing platform, and Bitcoin as a limited (not turing complete) trusted computing platform, I felt comfortable acknowledging their strengths and weaknesses in search of a better blockchain. My mental focus shifted from “which chain is hot right now” to “which one has the desired properties and tradeoffs for a particular use case”. With this subtle mindset shift, blockchains felt like utility rather than magic, and all use cases in finance suddenly felt like software engineering problems. But since we're examining things coldly and objectively, we must also distinguish user growth from the underlying technology trade-offs. For example, Bitcoin grew despite handicapping its transaction throughput in favor of decentralization. Ethereum grew despite an early fork that questioned their ability to maintain "code as law". Thus, Bitcoin and Ethereum's growth may be more attributed toward their community, narratives/stories, culture, and/or religious zeal. This means we shouldn't assume that their current technology attributes are desirable. Besides, if technology really mattered, Zcash would be beating Bitcoin in usage and marketcap. (editor's note, TBI did not write this). This observation does not mean we should be satisfied with the status quo. It’s a warning that we need to correct our preference for hearing stories over picking the right technology. In the end we cannot compromise on having a cheap, fast, private, secure, decentralized trustable compute platform. All of those features will be necessary to survive the failure of the nation state. So if you can evaluate blockchain technology objectively, then you can see it’s possible to engineer a blockchain network with whatever properties we need to replace legacy assets from first principles (see Ampleforth’s engineered supply for price stability). For example, should we create a synthetic gold instrument or should we engineer something with the exact properties we need to get the desired portfolio diversification (perhaps there’s something better than gold)? The question is not: “is crypto asset $XYZ correlated with stocks?”. The right question is “is crypto asset $XYZ engineered tobe correlated with stocks?”. The difference is acknowledging that blockchains obviate laws, police, and courts and then embracing the potential of reimaging money and finance from first principles. -J. Otto Come work with us! If you’re an all-star engineer interested in helping us contextualize and categorize the world’s crypto data, we’re hiring. Check out our open roles for frontend and backend engineers and drop us a line at
    Source: Jonathan Otto — Published: 2020-10-12T14:26:00Z

  • Square's Bitcoin Investment Thesis

    On Thursday, October 8th, the next number for bitcoin’s institutional bull market narrative bingo was drawn. It started back in May when billionaire hedge fund pioneer Paul Tudor Jones predicted that bitcoin would be the “fastest horse” in an economy primed for inflation amidst unprecedented monetary expansion. Next, MicroStrategy CEO Michael Saylor yolo’d nearly all of the publicly traded company’s $500M balance sheet into BTC. It continued when Jack Dorsey’s Square announced a $50M investment into the digital currency. Square’s Bitcoin Investment Thesis As Fidelity Digital Asset’s Ria Bhutoria pointed out, Square’s rationale for the move differed from that of MicroStrategy, as well Paul Tudor Jones. Where each institutional predecessor was drawn to Bitcoin due to its potential to appreciate in value and its track record as a dependable store of value, Square’s motivations were more mission driven. In the announcement, Square cited that it, “believes that cryptocurrency is an instrument of economic empowerment and provides a way for the world to participate in a global monetary system, which aligns with the company’s purpose.” Square CFO, Amrita Ahuja, added, “We believe that bitcoin has the potential to be a more ubiquitous currency in the future. For a company that is building products based on a more inclusive future, this investment is a step on that journey.” While the Paul Tudor Jones and MicroStrategy announcements came seemingly out of left field, Square’s was less of a surprise. Jack Dorsey is arguably Bitcoin’s most public proponent who’s long said he believes that the internet needs a native currency and that currency will be bitcoin. Square’s Cash App is one of the main ways for new users to first acquire bitcoin and Square Crypto exists to support Bitcoin and open-source initiatives. What was interesting about Square’s move was that along with the announcement, Jack released something for the benefit of corporate treasurers and CFO’s around the world. Jack’s Blueprint Shortly after Square’s announcement, Dorsey tweeted out a white-paper to his 4.7M followers to, “clearly articulate the process behind the execution of our purchase as others consider similar moves.” The document lays out how Square executed the trade and custodied the BTC, as well as provides resources for insuring and accounting for the asset. Like any good crypto-resource, it was punctuated with, “NOT INVESTMENT ADVICE.” Broader Implications As TBI and Watkins each commented immediately following the news, this is a big deal, particularly coming from a company of Square’s caliber. While MicroStrategy’s $425M allocation was orders of magnitude larger than Square’s, critics were quick to point out MSTR’s lackluster performance over the last five years, calling it a desperation move. Square on the other hand, is one of the most respected tech companies in the world, whose stock is trading at all-time highs and has more than 10x’d since its 2015 IPO. Jack Dorsey is one of the world’s most reputable CEOs whose lead will be easier for other CEOs/CFOs to follow (not to mention they have a clean and simple blueprint to do it). Square’s allocation also clocks in at a meme-friendly 1% of their balance sheet. As any Bitcoin hopium addict knows, a 1% allocation from all institutional investors is the recipe for $50,000 BTC. In an environment where company treasuries will likely lose over 2% to inflation due to the Fed’s money printer, in a chaotic year in which Bitcoin has outperformed virtually every other macro asset class, is that so crazy? Time will tell. -CD Article originally appeared in the Messari Daily Newsletter: Subscribe
    Source: Connor Dempsey — Published: 2020-10-09T14:30:00Z

  • Retrieving Uniswap trades using The Graph

    With the rise of Uniswap, Messari was presented with the challenge of providing real-time and historical data for this thriving AMM (automated market-maker). While data reporting infrastructure around centralized exchanges is relatively mature, the same is not the case for decentralized exchanges. To solve this issue, we turned to The Graph, which is a decentralized querying protocol that interfaces with Ethereum. Here's how we did it. Background Retrieving real-time and historical trade data from Uniswap can be challenging. One way to retrieve trade data is parse out the Swap events emitted from the ERC20 contract: event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); A trade event like this DAI-ETH swap looks as follows: Notice amount0In is 35000000000000000000, that is a whole lot of DAI! Similarly amount1Out of 103496165542782070 wETH? Am I rich?! Actually, parsing DAI and wETH smart contracts we find that both ERC20 tokens are specified using 18 decimals: This means we have to divide by 10^18 in order to retrieve the actual amount0In of 35 DAI swapped for amount1Out 0.1034 ETH, dang I’m not rich! Hence in order to retrieve a single trade on the Uniswap contract, we performed the following: connect to an Ethereum node and listen to the Swap event from the Uniswap contract retrieve the raw amount0In, amount1Out values from the event retrieve the DAI and wETH smart contracts associated to In and Out and parse out the decimal values convert raw amounts into actual DAI and wETH token amounts by dividing the decimal values Now imagine we needed to retrieve all DAI-ETH trades since the inception of Uniswap, we’d have to replay all Ethereum blocks from the start of Uniswap’s inception and perform the above steps on all DAI-ETH swap events. This requires an in-depth ETL infrastructure investment. The Graph The Graph provides a GraphQL abstraction on top of the Ethereum network, allowing consumers to retrieve normalized trades from Uniswap. The same DAI-ETH pair can be retrieved using the following query inside the playground: query swaps{ swaps(where:{transaction:"0x5ed0ee8ff25e0a368519ba10822d2f1d4261ca8cf3fe42b4f5806a515865d88f"}) { id timestamp amount0In amount1In amount0Out amount1Out sender to pair { token0 { id symbol } token1 { id symbol } } } } Notice the normalized amount0In of 35 DAI swapped for amount1Out 0.1034 ETH gets returned! This means we no longer have to retrieve the individual Swap events and extrapolate the relevant with the referencing DAI and wETH smart contracts. Additionally, the above query returns the id and symbol of the tokens that have been swapped, within the pair sub-object. This provides a handy visual reference and allows us to audit the normalization process. Under the hood As mentioned earlier, The Graph uses GraphQL to interface with the Ethereum network. For folks who aren’t familiar, GraphQL is a query framework mapping a user query to one or more backend queries, allowing the user to work on a higher level of abstraction without knowing the internals of the underlying system. Contrast the above single GraphQL query swaps(where:{transaction:"..."}) to the four step process in monitoring the on-chain Swap (indextopic1 address sender, uint256 amount0In, ...) event. This mapping is maintained within the Uniswap V2 Subgraph repository by the Uniswap team. Where the mapping dictates which events from the ERC20 contract should be extracted, transformed, and stored. It also provides a clear and concise abstraction for the user to query the stored data and consume it in a useful way. In fact, is powered by this subgraph using this exact abstraction. Historical Data To retrieve historical DAI-ETH data, we can specify the number of historical trades we want via first: 150, starting at a given block via block: {number:11009390} ordered descending by the time traded via orderBy: timestamp, orderDirection: desc query trades{ swaps(where:{pair: "0xa478c2975ab1ea89e8196811f51a7b7ade33eb11"}, orderBy: timestamp, orderDirection: desc, first:150, block: {number:11009390}) { id timestamp amount0In amount1In amount0Out amount1Out pair { token0 { id symbol } token1 { id symbol } } transaction { blockNumber } } } Real-Time Data To get real-time DAI-ETH trades, change query to subscription. Under the hood this uses a websocket connection to push new trades to the consumer when a swap has happened on-chain: subscription swaps{ swaps(orderBy: timestamp, orderDirection: desc, where:{pair: "0xa478c2975ab1ea89e8196811f51a7b7ade33eb11"}) { id timestamp amount0In amount1In amount0Out amount1Out pair { token0 { id symbol } token1 { id symbol } } } } Messari At Messari we use The Graph extensively to populate Uniswap markets like this one. If you would like to build with us, visit us at or shoot us an email at
    Source: Diran Li — Published: 2020-10-08T15:24:00Z

  • Wrapped Bitcoin Continues its Rapid Growth Surpassing $1 billion Outstanding

    The total value of Wrapped Bitcoin (WBTC) has surpassed the billion-dollar mark as the demand for bitcoin Ethereum continues to surge. The BitGo-custodied tokens have exploded over the last few months as bitcoin holders look to put their assets to productive use in the ever-expanding world of DeFi. Users looking to acquire WBTC can do so on DEXs and when the price rises above spot, qualified merchants can mint more to profit off of the difference. Most of the mints are from familiar faces in DeFi investing such as Alameda Research and Three Arrows Capital. Once they are minted, most WBTC quickly finds its way into DeFi protocols so users can earn fees whether from loan interest, trading fees, or yield farming. Source: Messari WBTC Dashboard WBTC has solidified its dominance among centrally issued tokenized bitcoin, however, more trustless alternatives pose a looming threat by removing the single point of failure. renBTC has passed $250 million outstanding (although it is still maintained by a team multi-sig but plans to transfer control soon), while its closest competitor tBTC recently re-launched. Whether or not these alternatives will threaten WBTC's dominance will depend on users desiring the emergent properties of decentralization and are willing to sacrifice capital efficiency in order to see this vision through.
    Source: Jack Purdy — Published: 2020-10-05T21:00:00Z

  • NFT's & Crypto's High-End Art Market

    With DeFi markets sputtering earlier this week, crypto twitter seemed to suddenly shift its attention to the next shiny new thing this week: NFTs, or non-fungible tokens. But NFTs aren’t new. In crypto, the concept has been around for over 5 years. However, this market cycle, they are inherently more interesting. Today, I’ll briefly sum up what NFTs are and dig into one fascinating aspect of this market: high-end crypto art. What are NFTs Items that are fungible can be replaced with another identical item without anyone caring. For example, any $5 bill can buy a hotdog just as effectively as any other. Bitcoin, ether and pretty much any crypto asset you see on fall into the “fungible” bucket. Items that are non-fungible are unique and can’t be exchanged 1 to 1. The simplest example being art. Try asking the people at the Louvre to swap your 5 year-old’s crudely painted hand-turkey with the Mona Lisa and you’ll experience true non-fungibility. So in the crypto world, NFTs are simply tokens that represent something unique. Unsurprisingly, NFTs attached to unique pieces of purely digital artwork are gaining steam. Crypto’s Art Scene In many ways, much of crypto is simply the recreation of existing human behaviors in a purely digital environment. Markets. Trading. Lending. Borrowing. Speculation. As such, it should be no surprise that markets have formed around trading and speculating on works of digital art. Like NFTs, crypto art markets have been around for years. As with NFTs and DeFi as a whole, the underlying technology is much more mature this cycle. Add in the fact that there’s a ton of freshly created wealth in the space from DeFi’s casino summer, and you get a crypto art market that’s heating up. After all, investors need to park all those DeFi gains somewhere. Nowhere is this combination of technological sophistication and wealth on display than in this piece from Matt Kane titled, “Right Place - Right Time” that sold for almost $100K on a platform called Async Art. Right Place - Right Time If you look at the above screenshot of Matt Kane’s work, it just looks like a cool piece of Bitcoin art. What’s under the hood is what makes it interesting. Kane wrote an algorithm that’s tied into a BTC pricing feed. Every 12 hours, the algorithm updates the piece based on Bitcoin’s volatility from that day, which you can see on display in this GIF. In addition to being an evolving work of art, there are a few other components that make this interesting. For one, Kane has retained an ownership token that allows him to fine-tune the piece over time - a novel aspect of NFT based artwork that allows the artist to retain some level of control over the work. Artwork no longer has to remain static, and instead, can adapt and evolve as an artist builds upon their work over time. Secondly, as this piece responds to the rhythms of bitcoin volatility, it will mint 210 individual NFTs based on significant days of movement. For example, say BTC hit’s $20K, a new NFT will be minted and sold based on what the piece looks like on that day. Whoever buys that NFT will have the ability to claim a physical print version. The next point of interest are the rights baked into the sale. The work was purchased by a collector going by the name of TokenAngels. As the piece generates and sells new NFTs, TokenAngels will receive 21% of each new sale. So in addition to the potential for the work to increase in value, it’s also a productive asset. Again, something fundamentally new, all codified into the underlying work A Shift in the Balance Traditional art is a $65 Billion dollar market, with the balance of power firmly in the hands of wealthy collectors. There was an infamous contemporary art sale in the 1970’s by a collector named Robert Scull. Scull bought up works from living artists around the world from $600-$10,000 and then sold them at auction for many multiples of his purchasing price. All-in-all, Scull’s total collection sold for an unheard of $2.2M ($14.7 million adjusted for inflation today). While this auction is credited for the birth of the highly speculative contemporary art market, Scull was criticized for how little of the windfall went to the actual artists. For example, Scull bought a piece from an artist named Robert Rauschenberg called, “Thaw” for $900 and sold it for $85,000. Rauschenberg didn’t see a dime in royalties. NFTs come with the benefit of more artist-friendly terms, leading to a shift in the balance of power between artist and collector. Note that TokenAngels receives 21% of the residual NFT sales from Matt Kane’s piece, not 100%. Similarly, an NFT art marketplace called SuperRare bakes a 10% creator royalty commission into all secondary sales - something Robert Rauschenberg would have appreciated in 1973. A New Frontier More artist-friendly terms along with curated marketplaces like SuperRare and Async Art are attracting a flood of new artists into the space. For a profession that’s notoriously impoverished, the allure of large amounts of money sloshing around these markets make crypto art even harder to ignore. In addition to Matt Kane, we’re already seeing early signs of a new breed of artists. Another name gaining steam is an artist that goes by the name of Pak. In true crypto fashion, Pak is completely anonymous and there’s speculation over whether their art is the product of one person or of artificial-intelligence produced by a collective of engineers. Pak has over 140K twitter followers and has sold over $350K in NFT artwork, including this piece that recently went for around $10K. Given that this is crypto, it’s also worth noting just how ripe these markets are for manipulation. Imagine how easy it would be for a whale to purchase a work of crypto art for $10K, sell it to a friend for $25K, buy it back for $50K and then sell it to an unsuspecting speculator for $100K. Wash trading has already become problematic on a platform called Rarible and undoubtedly is taking place. (Rarible has recently introduced platform fees in order to disincentivize wash trading, although it likely won’t be a bullet-proof solution to the problem). What’s Next Wash trading aside, all of this speaks to the fact that the NFT hype isn’t without merit. These are new behaviors uniquely made possible through new marketplaces primarily built on Ethereum. And crypto art is only the beginning. NFTs can and will be used to represent other non-fungible items. The obvious being other forms of creative outputs like music. Less obvious but equally intriguing are financial contracts like insurance. Imagine taking out a policy on your work of art that insures against loss of the work’s private keys. The integration of DeFi primitives into the NFT space is accelerating rapidly. For example, using a platform called NFTfi, you can now post your NFT as collateral and take out an ETH denominated loan. Another platform, Niftex enables NFT holders to fractionalize their assets into multiple tradeable tokens. While these applications are new, it’s not hard to see them taking off alongside the rest of the crypto art and NFT market. In a few decades, the rise of Ethereum art markets might be comparable to Robert Scull’s introduction of the speculative contemporary art market. The key difference is that this time, artists will be well compensated for their work. Perhaps the masterpieces of the future will be on display in galleries held in metaverses like Decentraland, each insured by NFT policies, on loan from the collector with the original artists still collecting royalties on their work years after inception. Stay up on all-things NFT Mason is our source for all-things Web 3 and NFTs, so give him a follow on twitter, and check out all of his coverage so far: The Cure for Starving Artists: NFT Royalty Fees Rarible &The War for NFT Supremacy Crypto Gaming Meets Governance: Examining Axie Infinity Whale Token & The Rise of Non-Fungible Liquidity Mining War of the Virtual Worlds: A Look at Metaverse Economies NFT Meets DeFi: The Emergence of NFT Loans Subscribe to the Messari's Unqualified Opinions for more NFT updates!
    Source: Connor Dempsey — Published: 2020-09-25T17:00:00Z

  • MicroStrategy's Bitcoin Investment Thesis

    Amidst all of the DeFi volatility, drama and excitement, Bitcoin has started to seem rather boring. Its price is more or less flat to where it was a year ago and you can’t even farm Yams with it. While some have started to view Bitcoin as a useless digital rock, someone did find an interesting use case for it. This week, more details surfaced around how MicroStrategy CEO Michael Saylor convinced the board of a publicly traded company to allocate nearly all of the company’s $500M cash position to bitcoin. Michael Saylor Saylor graduated from MIT in 1987 and founded Microstrategy at the age of 24. MicroStrategy is a “Business Intelligence” company, which basically creates software that allows companies to use their own data to drive decision making. Interesting side note - Saylor, like any good 90’s internet entrepreneur, also bought a bunch of internet domains and was the guy who ultimately sold to Block.One (EOS) for $30M. MicroStrategy’s’ $500M Problem To most people, having $500 million in cash doesn’t sound like a problem. Up until recently, it wasn’t for large corporations either. There was a time before the ‘08 financial crisis when the risk free rate of return on cash was 5% a year. This means a company could sit on $500M, earn $25M a year for doing nothing, and have cash on hand for a rainy day. Fast forward to today, when the risk free rate of return has plummeted to 0.69% due to loose fiscal policies (money printer go BRRRR) alongside inflating asset prices, and it’s a different story. In Saylor’s own words, “we just had the awful realization that we were sitting on top of a $500 million ice cube that’s melting.” Cash is Trash So what’s a corporation to do with a $500M melting ice cube? It turns out it’s not that easy to unload half a billion dollars in a short amount of time. You could buy back half a billion of your own company’s shares. For a company like MSTR, Saylor estimated that would take 4 years. Time MiscroStrategy didn’t have. You could buy real estate. However, commercial real estate prices have collapsed post COVID while property owners still believe their assets are worth what they were in January. In other words, good luck getting a fair market price. You could buy blue chip equities. Amazon, Apple, Google, Facebook. However, your risk is symmetric. They can each fall 50% just as easily as they can go up 50%. That left Saylor with silver, gold, Bitcoin, and other alternative assets. A move the company announced it was exploring on a July earnings call. A Bold Purchase Saylor ultimately wanted something that could either get cut in half, or go up by a factor of 10. An investment akin to what buying Amazon or Apple in 2012 was. In other words, asymmetric risk. As a student of technological history, Saylor observed that the winning strategy over the last ten years has been to find some kind of “digitally dominant network” that dematerializes something fundamental to society. Apple dematerialized mobile communications. Amazon dematerialized commerce. Google dematerialized the process of gathering information. Something Saylor noted was common to all recent 10X opportunities is buying when they’ve achieved $100B+ marketcaps and are ten times the size of their next biggest competitor. As Bitcoin is the dominant digital network dematerializing money that’s 10x the size of any cryptocurrency competing to be a store-of-value (not counting ETH here), it fit the bill. Making the purchase With the thesis in place, the next thing Saylor had to do was get everyone at MicroStrategy to sign-off on the unorthodox decision. To do this, he simply made everyone go down the same Bitcoin rabbithole that most people in the industry have gone down. He made everyone at the company watch Andreas Antonopoulous videos, read The Bitcoin Standard, watch Eric Vorhees debate Peter Schiff and listen to Pomp and NLW podcasts. With no strong detractors, MicroStrategy turned to execution. They first put $250M to work purchasing 21,454 BTC in August and another $175M (16,796 BTC) in September for a total $425M and 38,250 BTC. What’s fascinating is that MicroStrategy was able to open such a large position without really moving the market or anyone even taking notice. This speaks to just how liquid of an asset BTC has become. To acquire the September tranche of BTC, Saylor disclosed that they traded continuously for 74 hours, executing 88,617 trades of .19 BTC every 3 seconds. One for the history books Skeptics noted that shares of MSTR have been on the downtrend since 2013, which is the real reason behind MicroStrategy’s bold move. Regardless, the move has interesting implications for the company’s shareholders. As TBI observed, MicroStrategy is now both a software company and with ⅓ of its marketcap in Bitcoin, a pseudo Bitcoin ETF. At the time of writing, MSTR is up 20% on the week. Only time will tell if history looks back on this move as a brilliant strategic decision or a massive corporate blunder. In the short term, it scores a massive win for Bitcoin’s digital gold investment thesis. Billionaire hedge fund manager Paul Tudor Jones is in. A publicly traded corporation has made Bitcoin it’s primary treasury asset. As CFOs and fund managers around the world undoubtedly take notice, one has to wonder, who’s next? PS - I based a lot of this article on Pomp’s interview with Michael Saylor, which I recommend giving a listen. This initially appeared in the Messari daily newsletter: subcribe here
    Source: Connor Dempsey — Published: 2020-09-18T14:40:00Z

  • The Sushi Chronicles

    From the Messari Daily Newsletter: subscribe It’s been described as the world’s first legal billion dollar heist. However, it wasn’t a bag of cash that was stolen. It was liquidity. The SushiSwap drama has all of the makings of a Michael Lewis novel, featuring a sci-fi corporate takeover that would make T. Boone Pickens blush. In typical crypto fashion, it all played out at breakneck speed full of twists and turns featuring cartoon Pandas and 11th hour heroics. Even for many deep in the DeFi weeds, the whole sage is difficult to follow. Here, I’ll aim to unpack what went down as simply as possible. From Compound to YFI, to Sushi This all kicked off when Compound Finance launched its liquidity mining program back in June. In exchange for lending and borrowing assets on Compound, and bootstrapping Compound’s money markets users received COMP tokens. Total value locked in Compound skyrocketed along with the price of COMP and people took notice. The next phase came after Yearn Finance introduced the idea of a “fair launch” to liquidity mining. Where Compound was VC backed with early tokens going to the team and early investors, Yearn creator Andre Cronje allowed anyone to earn YFI tokens by locking capital into Yearn. No tokens were allocated to himself or outside investors and all tokens were distributed to users who farmed YFI. Backed by this clear, community first mindset, YFI’s market cap went from $0 to $1B in six weeks. Next came the memecoins. Yam.Finance, Ham.Finance, Spaghetti Money. Like YFI, these protocols all conducted “fair launches” that yielded governance tokens in exchange for staking certain assets in their contracts. Unlike Compound and YFI, which put user’s capital to productive use by provisioning liquidity, these memecoin protocols didn’t actually do anything useful. They were mainly zero-sum games where early participants who could acquire the tokens for free via liquidity mining, hype them up and then dump them on suckers on the open market before the bottom fell out. When SushiSwap was announced, it sounded like just another useless memecoin. In the two weeks following, it would prove to be much more. Forking Uniswap We’ve referred to memecoins like Yam.Finance as frankenstein coins because they’re created by forking elements of different protocols. Copy and paste some code from YFI and a complex stablecoin called Ampleforth and you get a ponzi-scheme like digital vegetable. SushiSwap however, made waves when it announced in late August that it would be forking Uniswap: the decentralized exchange at the heart of the DeFi craze. SushiSwap’s announcement detailed plans for essentially copying and pasting Uniswap’s code and adding a token on top of it: SUSHI token. The idea being to create a more community owned Uniswap that rewarded early liquidity providers for their crucial role in bootstrapping the exchange. While SushiSwap followed the standard memecoin playbook (fork protocol + add meme token), it came with an interesting wrinkle: a planned “liquidity migration” that would send shockwaves throughout the DeFi community over the ensuing two weeks. The AMM King The script becomes difficult to follow without understanding the basics of Uniswap. Uniswap is a specific type of decentralized exchange (DEX) called an automated market maker (AMM). Where other DEXs like 0x employ an orderbook model that matches buyers with sellers, AMMs use pools of liquidity that are always willing to buy or sell a pair of assets. For example, if you have some DAI and ETH lying around, you can commit it to a Uniswap DAI/ETH pool. In return, Uniswap gives you an LP token (liquidity provider token). As Uniswap users exchange ETH for DAI and vice versa in the ETH/DAI pool, your LP tokens allow you to collect trading fees. Those same LP tokens also allow you to redeem your liquidity whenever you want. Uniswap has thrived in an environment where new tokens are coming out of the woodwork. Where centralized exchanges require deep interest and liquidity to support a new token, Uniswap’s model can support a long tail of assets. They simply need a handful of liquidity providers willing to commit those tokens to a Uniswap liquidity pool. The beauty of Uniswap is that no one needs to ask anyone’s permission to participate and add tokens to Uniswap liquidity pools. While its LP tokens are essential for Uniswap to function, it has no overarching governance token. In an industry full of useless tokens designed to enrich founders and early investors, Uniswap had long been celebrated for this tokenless model. In the new DeFi wild west, this would prove to be an attack vector. The Panda Chef Drinks Your Milkshake The person behind SushiSwap came in the form of a pseudonymous PandaChef going by the name Chef Nomi. Chef Nomi and SushiSwaps’ plan hinged on copying and pasting Uniswap’s code and adding stronger incentives for liquidity providers via a governance token ($SUSHI). Where Uniswap paid a .30% fee solely to liquidity providers, SushiSwap would pay .25% fee to liquidity providers with the remaining .5% would then be converted into $SUSHI and distributed back to existing SUSHI holders. The idea being to reward early liquidity providers for their role in building out SushiSwap’s liquidity. Additionally, 10% of every SUSHI distribution would be put aside in a “development fund” (this fund becomes key later on). The way you acquire SUSHI? Take your Uniswap LP tokens and stake them to a SushiSwap contract. So if you took the LP tokens you received from committing your DAI/ETH to Uniswap and staked it to SushiSwap, you’d be rewarded with SUSHI tokens. Uniswap LPs answered the call and staked $1.6B Uniswap LP tokens to SushiSwap. This actually had the effect of bringing more liquidity to Uniswap as people committed capital to Uniswap in order to receive LP tokens they could stake on SushiSwap to receive more SUSHI. This is where the liquidity migration comes into play. Recall that LP tokens represent underlying liquidity on Uniswap - DAI/ETH in our example. Up to this point, your DAI/ETH still sits on Uniswap while our LP tokens are locked into SushiSwap, yielding SUSHI tokens. When Chef Nomi’s liquidity migration kicked in, your LP token would be redeemed for the underlying ETH/DAI on Uniswap and migrated to SushiSwap. In other words, this was a clever way for SushiSwap to essentially drink Uniswap’s milkshake. The Panda Chef pulls the rug Chef Nomi’s plan was in motion and DeFi alchemy was on full display as newly incepted SUSHI tokens went from $0 to over $10. SUSHI token was even listed by centralized exchanges Binance and FTX. Early participants were able to make millions by selling their SUSHI tokens to speculators on the open market. Then, as DeFi token prices started to plummet heading into Labor Day Weekend, Chef Nomi threw in a plot twist. Remember that development fund where 10% of newly minted SUSHI was placed? Chef Nomi was in sole control of it and on September 5th, he sold $14M of it for ETH and then pocketed it. The price of SUSHI tanked 70%. Chef Nomi claimed he was doing it for the good of the community and that by dumping his SUSHI, price would no longer be a distraction and he could concentrate on the migration. The newly formed Sushi community were not having any of it and twitter was ablaze with outrage. Enter SBF Many thought this spelled the end of the SushiSwap experiment. But regardless of SUSHI’s plummeting price, there was over a billion dollars of value locked into SUSHI and a ton of vested interest. The problem was that Chef Nomi was in sole control of SushiSwap's code. From the chaos emerged Sam Bankman-Fried: CEO of trading firm Alameda Research and FTX, which is one of the exchanges that listed SUSHI. Sam took to Twitter and laid out a plan for Chef Nomi to hand over his keys to the Sushi kingdom so the migration could continue as planned. While Sam didn’t outright suggest Nomi hand the keys directly to him, that’s exactly what the Panda chef did. On September 6th, Chef Nomi transferred the admin keys to Sam and faded back into obscurity (or so it seemed). Since having the admin keys in the hands of one person is what landed SushiSwap into trouble in the first place, Sam’s plan was to put the keys into a multi-sig contract. Multi-sig contracts require multiple people to sign-off before making changes. This would prevent say, one person from dumping the entire SUSHI development fund on the open market. To determine who would be able to have access to the multi-signature contract, an election was held via popular vote by SUSHI holders. In addition to Sam, Compound Finance founder Robert Leschner, The Block’s Larry Cermak, and CMS Holdings (prop trading firm) were elected among others. Crisis was averted and the Sushi community had successfully shook off Chef Nomi’s betrayal. The migration was on. Game On On September 9th, the migration went into effect. Anyone staking Uniswap LP tokens on SushiSwap would have their token’s underlying liquidity redeemed and migrated over to SushiSwap. Returning to our example, with the migration live your Uniswap LP tokens would be redeemed for the underlying ETH/DAI and moved off Uniswap to SushiSwap. You’d then be given SushiSwap LP tokens and continue collecting trading fees plus new SUSHI token. Simple right? This mechanism drained half of Uniswap’s liquidity. SushiSwap went from having $810M Uniswap LP tokens staked to $1.2B in total value locked across multiple pools of liquidity. A good portion of Uniswap’s milkshake had been consumed. Source DeFi Pulse SushiSwap TVL post liquidity migration: Source: SushiSwap Protocol Analytics The Liquidity Wars are here This whole saga didn’t spell any real disaster by Uniswap by any means. As Cami Russo pointed out (who’s Defiant newsletter coverage I leaned on a lot here), the amount of liquidity in Uniswap actually grew throughout the entire fiasco. It does showcase a new kind of battlefront that’s only possible in the world of open source code and composability. Uniswap is the product of four years of work as well as a healthy amount of venture funding. In this new frontier, a cartoon panda and a community backed by mercenary capital can commandeer a billion dollars worth of hard earned liquidity with some clever token incentives. Liquidity is not a moat when capital can move at the speed of the internet. Welcome to the wild wild west that is DeFi. PS - In yet another plot twist, as we were writing this, Chef Nomi returned all of the ETH, now worth $14M to the Sushi treasury in an effort to rejoin the community. You can’t make this stuff up.
    Source: Connor Dempsey — Published: 2020-09-11T18:00:00Z

  • An Inside Look at US Crypto Exchange Listings

    With the markets running hot, crypto exchange listings have seemingly become a catalyst for price movements. It’s almost 2017 all over again. The trend is readily apparent when looking at Coinbase’s most recent additions. Nearly every new listing has seen a substantial boost in price on the day Coinbase announced it was opening its digital doors and turning on the frothy faucets of sweet liquidity. NMR tripled and COMP doubled on their announcement days. Even ALGO’s intraday increase of 21% was nothing to sneeze at. The lone exception was Coinbase’s most recent addition, UMA, as it fell alongside the rest of the market over the last few days. Onlookers should also note that UMA was up 230% in the week leading up to its announcement, which may have been a byproduct of its coincidental involvement in SushiSwap. The real beneficiary Token projects aren’t the only ones that benefit from these listings. The exchanges often see a boost in trading volume (where they make their money) and user accounts. New coins open the doors to new crypto tribes communities that otherwise can’t see the world outside of their bags. Exchanges can also boost their own portfolios and offer themselves an avenue to liquidity should they have a crypto-focused venture arm. Coinbase, in particular, has taken advantage of its proximity to specific projects. Four of the last six Coinbase listings have been in Coinbase Venture’s portfolio. Coinbase isn’t the only exchange that has capitalized on this DeFi-inspired market. The other major US exchanges, Kraken and Binance.US, have picked up their rate of new listings, adding six and twelve new assets since June, respectively. Even Gemini, the most conservative of the bunch, has increased its offerings by 75% this year. All are on pace to best their total listings from 2019. This trend will likely continue, especially if the market doesn’t cool down anytime soon, and assets on the waiting list could present an enticing investment opportunity. While investors can’t know what asset a crypto exchange will list next (ignoring insider trading), there are some signals amidst the noise. Fortunately, fellow Messari analyst Mason has already analyzed how to wade through the crypto content swamp to pinpoint potential opportunities. He also compiled the liquid portfolios for these exchanges (where applicable) and their listing considerations: Coinbase Ventures portfolio Coinbase listing considerations Coinbase Custody supported assets Binance Labs portfolio Gemini Custody supported assets One should also monitor the assets in exchange portfolios that aren’t trading yet under the assumption exchanges will support them soon after launch. It took Coinbase only a few months to list COMP and CELO after these tokens became transferable. Coinbase Ventures’ illiquid assets that are closing in on a mainnet or token launch include Near Protocol (in pretend mainnet), Coda (mainnet launch due at the end of 2020), The Graph, BloXroute, and Spacemesh (mainnet launch expected in 2021). Deja vu? In some ways, this year’s “Exchange Pump Phenomenon” resembles that of 2017. Like the last bull run, international exchanges have beaten US-based exchanges to the punch by mass listing DeFi tokens. Legal ramifications aside, US exchanges are missing out on a potential opportunity by not supporting tokens like YFI that boast a highly dedicated community. Generating early liquidity is critical as it can often determine whether an exchange becomes the preferred destination for traders. Listings have the potential to bring this liquidity. But waiting to act can jeopardize one’s future market share. In the case of YFI, Binance has risen to the pole position and now holds nearly 15% of the total YFI supply. Since roughly 70% of YFI supply is actively staking, the limited amount remaining might make Binance difficult to unseat. Source: Nansen Despite the mild similarities to 2017, this time around is decidedly different. Crypto exchanges are no longer competing amongst themselves. The rise of Uniswap and similar protocols have made decentralized exchanges (DEXs) an actual threat to current dominance shared by centralized exchanges (CEXs). CEXs were previously the primary destination for crypto users. They’ve now increasingly become a simple on-ramp for DeFi applications. More efficient crypto gateways could further disrupt their already dwindling dominance.
    Source: Wilson Withiam — Published: 2020-09-04T14:30:00Z