On Staking on Data in Ocean Market

Earning Opportunities — and Risks — in Ocean’s Community Marketplace

Trent McConaghy
Ocean Protocol

--

Ocean Workers. [Image: AIMS, CC-BY-3.0 AU]

Summary

The upcoming Ocean Market app enables people and organizations to earn by staking / curating on data and by selling data. This article focuses on staking on data. (This one focuses on selling.)

In staking, you earn a cut of the transaction fees as a liquidity provider (LP). Staking is a curation signal tending towards higher quality datasets. Stakers will earn additional rewards from Ocean Data Farming program, when it launches.

Staking incurs these risks, which cannot be ignored.

  • Staking incurs the risk of impermanent loss (IL) — when the pool’s ratio of OCEAN to datatokens changes, compared to when you initially staked.
  • Staking also has the risk of a rug pull. This is is typically when a datatoken publisher pulls out their stake, in OCEAN. Therefore, remaining stakers’ OCEAN holdings in the pool drops, causing a loss.

The rest of this post elaborates.

Datatokens & Ocean Market

Each data service gets its own Ocean datatoken. A datatoken is an ERC20 token that wraps access to a dataset or a compute-to-data service. This blog introduces Ocean datatokens.

The Ocean Market app makes it easy to create a datatoken for a given data service, and to consume a datatoken to access that service. This blog introduces Ocean Market.

Automated Market Makers (AMMs)

An Automated Market Maker (AMM) is a robot that’s always ready to buy or sell. An AMM is a pool holding two assets, let’s say TOK1 and TOK2 tokens. Anyone can add TOK1 or TOK2 tokens to this pool. If you buy TOK1 tokens from the pool, its price (in terms of TOK2) is the based on the ratio of # TOK1 : # TOK2 tokens. And, vice versa for buying TOK2.

AMMs are the heart of modern decentralized exchanges (DEXes) like Balancer and Uniswap. To learn more about AMMs, here’s a start.

OCEAN-Datatoken Pools

Pricing data is traditionally hard; automated price discovery promises to make this easier.

  • An order book approach to auto-pricing requires many actors to place bids and asks, which would not be feasible when launching a new data asset.
  • AMMs also do auto-pricing. Unlike order books, they don’t require many actors to function well. Due to this, Ocean Market uses AMMs to auto-price datasets.

Ocean Market makes it easy to create an OCEAN-datatoken AMM pool, and to buy and sell datatokens for OCEAN. True to form, the AMM auto-adjusts the price as datatokens are bought and sold.

Staking in Ocean with OCEAN-Datatoken Pools

OCEAN-datatoken pools are the basis for staking in Ocean:

OCEAN staking is the act of adding liquidity to an OCEAN-datatoken AMM pool. By staking, you become a liquidity provider (LP).

Staking Rewards from Transaction Fees

When you stake on a datatoken pool, you earn staking rewards:

  1. From transaction fees for sales (buying & selling datatokens) in that pool
  2. From Ocean Data Farming rewards (when it launches).

This section elaborates on (1); the next section on (2).

The creator of the OCEAN-datatoken pool sets the transaction fee going to stakers. This fee is a percentage of sales volume. The higher the sales volume, the more you earn. The default fee is 0.1%, but it could be 1% or 5% or more.

Stakers get paid proportional to how much liquidity they have provided, compared to other stakers.

For more revenue, a good strategy is to stake on data assets with high sales volume, especially “undiscovered gems” with little stake so far by others. This will give you a greater cut of the transaction fee revenue.

Staking rewards from transaction fees flow immediately into the pool. Therefore all the pool’s stakers collectively get more OCEAN liquidity with each sale.

You can always increase or decrease the total amount staked in a pool, via the “add liquidity” and “remove liquidity” actions. You can un-stake anytime; the funds enter your wallet immediately. Withdrawal includes the portion of staking rewards.

Staking Rewards from Data Farming

Ocean Data Farming is an upcoming program to reward stakers further. The amount of rewards will be a function of stake in the pool, amount of consumption of a data asset, and likely more factors. Time is a possible factor. We will release more information when the program launch nears.

Risk: Impermanent Loss

Staking in OCEAN-datatoken AMMs has potential to earn transaction fees and data farming rewards. However, like all AMMs, there is also the risk of impermanent loss (IL). IL occurs whenever the ratio of (# OCEAN) : (# datatokens) diverges from when you initially staked (value of 1.0).

So, if OCEAN goes up relative to the datatoken value, or if the datatoken goes up compared to the OCEAN value, then you have impermanent loss.

The image below illustrates.

  • The blue curve is the value of your holdings in the OCEAN-datatoken AMM, as a function of price ratio.
  • The orange curve is the value of your holdings if you simply held OCEAN and datatoken separately, without them being in AMMs. (With all else being equal, and with zero fees and rewards.)
[Image: University of Orleans]

The loss is called impermanent because if the ratio reverts to 1.0, then IL = 0.0. But don’t let this lull you into a false sense of security: that 1.0 ratio may never come back, and loss becomes permanent as soon as you withdraw.

Rug Pulls

A rug pull is an attack that results in stakers losing funds. Here are some ways it might happen:

  • A pool publisher creates a pool and adds initial liquidity (thereby having 100% initial stake), waits for others to stake in OCEAN, then withdraws their stake as OCEAN.
  • A pool exists and many have staked OCEAN into it. The publisher mints a lot more datatokens into the pool, thereby gaining a much larger % stake, then withdraws their stake as OCEAN.

Here’s the mechanics.

  • If one stakes just in datatokens, part of those datatokens are swapped for OCEAN already in the pool. Similar for OCEAN: if one stakes just in OCEAN, part of that OCEAN is swapped for datatokens already in the pool. The pool maintains its weight ratio (e.g. 10% OCEAN - 90% datatokens or 50%-50%).
  • In both cases, the staker receives BPT tokens, which represent % stake in the pool’s holdings (of datatokens and OCEAN). BPT tokens don’t represent % stake in just OCEAN or just datatokens; they represent stake in both according to the pool’s weight ratio.
  • It’s the publisher who tends to have more supply of datatokens (at first, as well as the potential to mint more later). Others only initially start with OCEAN because they have to purchase datatokens, or stake into the pool to get both. But when they stake, they get BPTs which represent ownership in both tokens.

A Quirk of OCEAN-Datatoken Pools

This is a quirk that is neither good nor bad, but useful to understand. When an OCEAN-datatoken pool is first created, the only person able to add datatoken liquidity to the pool will be the publisher of the datatoken. Anyone else can then add OCEAN. For the non-publisher to add liquidity, someone needs to first buy the datatoken and then they be able to add liquidity for that datatoken.

This means that we can expect that when a new OCEAN-datatoken pool is first released, with OCEAN staked by others, the price of the datatoken will go up at first (as denominated in OCEAN).

On Being Profitable

To put it all together:

profit = (transaction fees) + (farming rewards) - (impermanent loss) - (rug pull loss)

Rug pulls can be viewed as a special case of IL, but to make the risk more clear, we provide it as a separate term. Risk of rug pull is real.

We want profit to be >0, of course. What can help is to increase transaction fees, and to reduce IL. Let’s explore each further.

Here are tactics to increase transaction fees:

  • Choose OCEAN-datatoken pools to maximize (# sales transactions) * (% fee in pool). This means finding ways to increase sales transactions, or simply increasing % fee. For the latter, fees that are too high may hurt transaction volume; but we do not yet know the sensitivity of fee to volume.

Here are key tactics to reduce impermanent loss (IL) and rug pulls:

  • First, improve your understanding of AMMs, IL, and rug pull mechanics. This will help you to better understand the risk-reward tradeoff and tactics. We link to some starting points below.
  • Second, avoid OCEAN-datatoken pools with a high chance of rug pull. You need to use your own judgement on this. Reputation is a key factor. Higher-reputation parties may be less likely to do a rug pull because they’ll want to maintain their reputation. Pseudonymous accounts will be less trustworthy and will need to build up a reputation over time. There are opportunities for the Ocean community to collectively build up knowledge of actors’ behavior over time and make assessments of reputation, to help in decisions of where to stake.
  • Another tactic to address IL is to monitor the price ratio, then pull out if the ratio changes by more than 10% or so. The exact number depends on the tradeoff to earning potential by transaction fees.

Here are a couple more things.

  • OCEAN-datatoken pools are powered by Balancer tech. This tech only lets LPs withdraw 1/3 of liquidity in any given transaction. This softens potential rug pull effects, but only a bit since an attacker could do several transactions in a row to remove most liquidity.
  • Finally, builders of AMM technology are working on various mechanisms to reduce the ill effects of impermanent loss. Balancer V2, Bancor V2, Uniswap V3 and others will have mechanisms to help. These will be released in coming months.

Everyone using this technology must understand that they are using it at their own risk. And there are risks. Some may be uncomfortable adding liquidity due to the risk of impermanent loss or rug pulls. That’s ok. There’s definitely a risk-reward tradeoff. For those who with lower risk tolerance, another way to earn in Ocean is by finding and selling data itself. Here’s more info. Second, we anticipate that tools and monitoring will improve over time, to make staking easier and less risky.

Learning More

To learn more about AMM pools, here are a couple places to start:

  • Balancer documentation on AMMs here.
  • Uniswap documentation on AMMs here.

To drill more into impermanent loss, these references are useful:

  • “What is Impermanent Loss?” video at finematics.com, here.
  • Cointelegraph article here.
  • Bancor article here.

Finally, there’s nothing like actually using the tools to gain intuition. We encourage you to play with adding liquidity on Balancer and Uniswap, e.g. to add and remove liquidity on OCEAN-ETH pools. Pay particular attention to the transaction fees earned, the liquidity mining earnings (BAL via Balancer’s program, UNI via Uniswap’s), and the Impermanent Loss.

Conclusion

This brief post described how staking in Ocean Market: balancing the earning opportunities with the risks towards profitability.

AMMs are powerful tools with pros and cons. We can expect that the pros and cons will emerge for OCEAN-datatoken pools too. We encourage everyone to take the time to understand AMMs, IL, and rug pulls. And, as always, take responsibility for their own funds.

NOTE: none of the above writing is to be taken as financial advice. Please treat it as information, no more and no less.

Updates

Here are updates since the original publication on Oct 22, 2020.

  • Oct 30, 2020. Revised “rug pulls” section for clarity

Related Posts

  • Article introducing Ocean Market: “Ocean Market: An Open-Source Community Marketplace for Data. Featuring OCEAN Staking, Automated Market Makers, and Initial Data Offerings”, Sep. 24, 2020 [link]
  • Ocean Protocol homepage will link to Ocean Market, upon release (by end of Oct 2020)
  • “Ocean Protocol V3 Posts: Links to all V3-Related Stories” [link]

Follow Ocean Protocol via our Newsletter and Twitter; chat with us on Telegram or Discord; and build on Ocean starting at our docs.

--

--