DF81 Completes and DF82 Launches

Stakers can claim DF81 rewards. DF82 runs Mar 21— Mar 28, 2024. Bug fix in Volume DF reward calculation; 5x Predictoor Boost

Ocean Protocol Team
Ocean Protocol

--

1. Overview

Ocean Data Farming (DF) is Ocean’s incentives program. In DF, you can earn OCEAN rewards by locking OCEAN, curating data, and making predictions via Predictoor.

👉 This week, we discovered and fixed a bug in Volume DF. It applied DCV bounds too loosely, which over-rewarded each individual account. We have fixed the bug. Accounts doing Volume DF should expect reduced rewards from DF81 payouts onwards. Section 5 has details; the Appendix has a complementary explainer. UPDATE [one day later]: we have introduced 5x Predictoor Boost, which restores Volume DF reward levels.

DF81 was the first round of DF Main 2. In it, OCEAN rewards doubled to 300,000 OCEAN/week. This breaks down as follows. Passive DF & Active DF now get 150K OCEAN/week. Within Active DF, Volume DF budget is 112.5K OCEAN/week and Predictoor DF gets 37.5K OCEAN/week. ROSE rewards continue at 20K ROSE/week.

Data Farming Round 81 (DF81) has completed. 300K OCEAN + 20K ROSE was budgeted for rewards. Rewards counting started 12:01am March 14, 2024 and ended 12:01 am March 21. You can claim rewards at the DF dapp Claim Portal.

DF82 is live today, March 21. It concludes on March 28. 300K OCEAN and 20K ROSE are budgeted in total for rewards.

This post is organized as follows:

  • Section 2: DF structure
  • Section 3: How to earn rewards, and claim them
  • Section 4: Specific parameters for DF82
  • Section 5: Bug Fixed in Volume DF
  • Appendix: Complementary Bug Fix Explainer

2. DF structure

  • Passive DF. As a veOCEAN holder, you get passive rewards by default.
  • Active DF has two substreams.
    Volume DF. Actively curate data by allocating veOCEAN towards data assets with high Data Consume Volume (DCV), to earn more.
    Predictoor DF. Actively predict crypto prices by submitting a price prediction and staking OCEAN to slash competitors and earn.

3. How to Earn Rewards, and Claim Them

There are three ways to earn and claim rewards: Passive DF, Active DF : Volume DF, and Predictoor DF.

4. Specific Parameters for DF82

This round is part of DF Main, phase 2.

Budget. This round has 300,000 OCEAN + 20,000 ROSE rewards total. That OCEAN and ROSE is allocated as follows:

  • Passive DF: 150K OCEAN (50% of rewards)
  • Active DF: 150K OCEAN (50% of rewards). To each substream:
    – Volume DF: 112.5K OCEAN
    – Predictoor DF: 37.5K OCEAN + 20K ROSE

Networks. Passive DF applies to OCEAN locked on Ethereum mainnet. Predictoor DF applies to activity on Oasis Sapphire. Volume DF applies to data assets published on Ethereum Mainnet, Polygon, BSC, EWC, and Moonriver. Here is more information about Ocean deployments to networks.

Volume DF rewards are calculated as follows:

  • First, distribute OCEAN across each asset based on rank: highest-DCV asset gets most OCEAN, etc.
  • Then, for each asset and each veOCEAN holder:
    – If the holder is a publisher, 2x the effective stake
    – Baseline rewards = (% stake in asset) * (OCEAN for asset)
    – Bound rewards to the asset by 125% APY
    – Bound rewards by asset’s DCV * (% stake in asset) *DCV_multiplier. This prevents wash consume. The value DCV_multiplier is 20.1% for Predictoor feeds, and 0.1% otherwise.

Any OCEAN budgeted for Volume DF that wasn’t rewarded goes back into the DF pot for future DF rounds.

Predictoor DF rewards are calculated as follows:

  • First, DF Buyer agent purchases Predictoor feeds using OCEAN throughout the week to evenly distribute these rewards.
  • Then, ROSE is distributed at the end of the week to active Predictoors that have been claiming their rewards.

Expect further evolution in Active DF: tuning substreams and budget adjustments among substreams. What remains constant is passive DF, and the total OCEAN rewards emission schedule.

Updates are always announced at the beginning of a round, if not sooner.

5. Bug Fixed in Volume DF

5.1 Summary

This week, we discovered and fixed a bug in Volume DF. It applied DCV bounds too loosely. We’ve fixed it now. Accounts doing Volume DF should expect reduced rewards from DF81 payouts onwards.

5.2 Status Quo Behavior

df-py is the GitHub repo implementing DF rewards formulae. The issue is in df-py issue #821; we bring relevant info here

Here is the main formula for Volume DF rewards, before the fix. It’s from df-py’s reward_calculator.py.

R[i, j] = min(
perc_at_j * perc_at_ij * self.OCEAN_avail,
ocean_locked_ij * TARGET_WPY, # bound rewards by max APY
DCV_OCEAN_j * multiplier, # bound rewards by DCV
)

R[i,j] is the reward amount in OCEAN, for user i and asset j.

Inside the min() function, the first term is the baseline reward amount. The second & third terms bound by max APY and DCV respectively. The problem is in the third term with DCV_OCEAN_j.

If DCV is sufficiently low that Volume DF rewards should be bounded it (typical), and if Alice splits her veOCEAN across 2 accounts, then Alice will get more rewards compared to if a single account. This is incorrect behavior.

We can tell that this happens in the DCV_OCEAN_j line, because it’s only a function of j and not of i as well.

5.3 Problem with Status Quo Behavior

The # rewards that Alice gets should only be a function of how much veOCEAN Alice has, not whether she has one account or two (or 100).

The bug exposed Volume DF to Sybil attacks: Alice got 2x more reward than she was supposed to for having 2 accounts. If she had 100 accounts, she would have got 100x more (up to where the asset-level DCV bounds kicked in). In other words, Volume DF over-rewarded each individual address.

It also meant that each account got over-rewarded, since they were only bounded by DCV of the asset, not by their pro-rata stake in the asset.

This was the case since asset-level DCV bounds were introduced: DF23 on Feb 2, 2023.

5.4 Reproducing the Problem

The following code exposes the issue, in test form. The first test is for one account; the second is for two accounts. It should have rewarded the same total OCEAN (50) whether there was one account, or two.

def test_bound_by_DCV_1nft_1accounts():
DCV_OCEAN = 100.0

stakes = {chain1_id: {nft1_addr: {user1_addr: 1e6}}}
nftvols = {chain1_id: {OCEAN_addr: {nft1_addr: DCV_OCEAN}}}
OCEAN_avail = 10000.0

with patch("df_py.volume.reward_calculator.calc_dcv_multiplier") as mock_dcv:
mock_dcv.return_value = 0.5
rewards_per_user, _ = _calc_rewards(stakes, nftvols, OCEAN_avail)
assert rewards_per_user == {user1_addr: 50.0}

def test_bound_by_DCV_1nft_2accounts():
DCV_OCEAN = 100.0

stakes = {chain1_id: {nft1_addr: {user1_addr: 0.5e6, user2_addr: 0.5e6}}}
nftvols = {chain1_id: {OCEAN_addr: {nft1_addr: DCV_OCEAN}}}
OCEAN_avail = 10000.0

with patch("df_py.volume.reward_calculator.calc_dcv_multiplier") as mock_dcv:
mock_dcv.return_value = 0.5
rewards_per_user, _ = _calc_rewards(stakes, nftvols, OCEAN_avail)
assert rewards_per_user == {user1_addr: 25.0, user2_addr: 25.0}

We had the first test before, and it passed. Whereas the newly-introduced second test failed. In it, of the two accounts got 50 OCEAN, for 50+50 = 100 OCEAN total. Correct would have been 25+25 = 50 OCEAN total.

This is good news: we had reproduced the issue in reproducible tests. Here’s the PR; the code shown is modified slightly for readability.

5.5 The Fix to the Problem

Here’s the change in code. The “before” line in red didn’t properly bound rewards. The “after” line in green does. The main fix was just one line. (Here’s the PR.)

Red = before the fix, green = after the fix. DCV bounds are now scaled by the user’s proportion of rewards, perc_at_ij.

The specific fix is: the DCV bounds need to also scale by the account’s proportion of stake in the asset, perc_at_ij. Like all proportions, 0 <=perc_at_ij ≤ 1.

With the fix in place, the previously-failing test now passed. Great!

5.6 How does this affect users going forward?

In previous rounds, accounts were being over-rewarded in Volume DF because it wasn’t properly bounding on DCV.

Accounts can expect the proper amount of reward now, from DF81 payouts onwards. It is almost certainly less than before.

Here’s why one should expect less rewards in Volume DF. The additional term perc_at_ij in the rewards line has value between 0 and 1, and is rarely 1 because one user rarely has all the stake.

In other words, there’s an OCEAN reward allocated for a given asset (based on its DCV compared to other assets), and that reward is spread among different accounts (based on their relative stakes in the asset).

5.7 Final Clarifications

Just to say it: we won’t retroactively reduce any rewards. For starters, even trying would be pretty uncool! Second, it’s not very pragmatic to implement.

Also, this only affects Volume DF rewards. There is no change to Passive DF Rewards, or to Predictoor DF Rewards.

It’s also not a security vulnerability. Yes it was a Sybil attack, but in this case it means that a person could Sybil-attack to take comparatively more rewards for themselves. Emphatically, it was not a security bug: there were no funds at risk, and there were no funds stolen.

UPDATE: one day after we published this post, we have introduced 5x Predictoor Boost to restore Volume DF reward levels.

Appendix: Bug Fix Explainer

This subsection describes the bug fix changes end-to-end, in a different voice.

You may see see a significant drop in your Volume DF rewards this week. This is indeed the correct behavior after the bug fix.

Let’s elaborate. We discovered a bug that gave more rewards payout for Volume DF than the design intent. We fixed the bug within hours of discovery. With the bug fixed, users will see a sizeable drop in Volume DF payout compared to previous weeks. Although this drop is large, the code is updated with the correct functionality that Volume DF rewards were supposed to have all along.

Here’s that rewards logic:

  • asset X generates data consume volume DCV.
  • then, Volume DF rewards for asset X are either DCV_multiplier= 20.1% (Predictoor feeds) or 0.1% other assets).
  • those asset rewards for are divided among veOCEAN holders who allocated veOCEAN to this asset, according to their stake. This is where delegations get counted too.

Then, repeat the above for each of the assets.

Realistically, there is only volume on Predictoor feeds. So DCV is basically the Predictoor DF rewards of 37,500 OCEAN. Multiplying the 37,500 OCEAN times 20.1% for Predictoor feeds means about 7,500 OCEAN. The remaining 37,500–7,500=30,000 OCEAN that was budgeted for Volume DF goes back into the Data Farming pot for future DF rounds.

Appendix: Further Reading

The Data Farming docs provide all key info, guides on how to earn, and detailed info about reward schedule, APYs, and the like.

The Data Farming Series blog post is a thorough listing of all DF articles in one place.

About Ocean, DF and Predictoor

Ocean was founded to level the playing field for AI and data. Ocean tools enable people to privately & securely publish, exchange, and consume data. Follow Ocean on Twitter or TG, and chat in Discord.

In Predictoor, people run AI-powered prediction bots or trading bots on crypto price feeds to earn $. Follow Predictoor on Twitter.

Data Farming is Ocean’s incentives program. In DF, you can earn OCEAN rewards by locking OCEAN, curating data, and making predictions.

--

--