# Ocean Data Farming Examples

## Worked examples to help understand OCEAN rewards and APYs

This post gives worked examples to help stakers (liquidity providers) understand potential earnings via the Ocean Data Farming (DF) program.

For full context, please ensure that you’ve read Ocean Data Farming is Launching first.

This piece will first review the Reward Function formula. Then, it will cover each of the following scenarios as worked examples.

1. One LP, smaller stake, hits the APY cap of 125%
2. One LP, larger stake, hits the weekly OCEAN_budget cap
3. Two LPs, same data consume volume (DCV), same returns
4. Two LPs, different data consume volume, different returns

This post is not intended to cover all possible scenarios. Rather, it gives a few simple scenarios and shows a path by which the reader may do their own reasoning and logic in other scenarios.

# Reward Function Formula

Here’s the Reward Function formula. The post Ocean Data Farming is Launching explains its details more, as well as the specific meaning of each term.

RFᵢⱼ = stakeᵢⱼ * DCVⱼ = (stake of LP i on pool j) * (DCV on pool j)

RFₜₒₜₐₗ = sum across all RFᵢⱼ

Pro-rata RF for LP i and pool j: RFᵢⱼ_ₙₒᵣₘ = RFᵢⱼ / RFₜₒₜₐₗ

Subject to APY <= 125% per LP per pool. An annual percent yield (APY) of 125% means a weekly percent yield (WPY) of 1.57171%.

# Scenario 1

Setup:

• 1 pool
• 1 LP (staker), of 100K OCEAN
• 1 consume. Price on consume was 1.0 OCEAN / datatoken
• 10K OCEAN rewarded (= weekly budget for DF alpha phase)

Q: How much does the LP earn in one week? What’s the APY?

First, calculate the pro-rata RF value for the LP:

• LP 0’s stake in pool 0 (i=0, j=0): stake₀,₀ = 100K OCEAN
• Data consume volume for pool 0 (j=0): DCV₀ = 1 consume * (1 OCEAN / datatoken) = 1 OCEAN
• Reward function value for LP 0 on pool 0 (i=0, j=0): RF₀,₀ = stake₀,₀ * DCV₀ = 100K * 1 = 100K
• RFₜₒₜₐₗ = sum across all LPs and pools = RF₀,₀ = 100K
• RF₀,₀_ₙₒᵣₘ = RF₀,₀ / RFₜₒₜₐₗ = 100K / 100K = 1.0. The value of 1.0 means that this LP gets all the reward.

Now, calculate the rewards going to the LP:

• OCEAN_budget = 10K OCEAN
• total_OCEAN_rewards = min(OCEAN_budget, total_staked * WPY) = min(10K, 100K * 0.015717) = min(10K, 1571.7)= 1571.7 OCEAN
• LP 0’s rewards (i=0): rewards₀ = RF₀,₀_ₙₒᵣₘ * total_OCEAN_rewards = 1.0 * 1571.7 = 1571.7 OCEAN. That is, LP 0 gets all the rewards because they’re the only LP.

Finally, calculate APY:

• LP 0’s weekly percent yield: WPY₀ = rewards₀ / stake₀,₀ = 1571.7 / 100K = 0.015717 = 1.5717%
• LP’s 0’s annual percent yield: APY= (1 + WPY₀)⁵² — 1.0 = (1 + 0.015717)⁵² — 1.0 = 1.25 = 125%. This is the predicted yield for the year, if every week had the given WPY and it compounded.
• We can confirm APY this by observing that total_OCEAN_rewards calculated value was bounded by the APY term (total_staked * WPY), not the budget term (OCEAN_budget).

Discussion: APY was maxed out to 125% because stake was sufficiently low.

Summary: LP’s rewards were 1571.7 OCEAN, and APY was 125%

# Scenario 2

Setup:

The setup is like scenario 1 but stake = 1M OCEAN (not 1000 OCEAN). That is:

• 1 pool
• 1 LP (staker), of 1M OCEAN
• 1 consume. Price on consume was 1.0 OCEAN / datatoken
• 10K OCEAN rewarded

Below, bold = different than scenario 1.

Q: How much does the staker earn in one week? What’s APY?

First, calculate the pro-rata RF value for the LP:

• stake₀,₀ = 1M OCEAN
• DCV₀ = 1 OCEAN
• RF₀,₀ = stake₀,₀ * DCV₀ = 1M * 1 = 1M
• RFₜₒₜₐₗ = RF₀,₀ = 1M
• RF₀,₀_ₙₒᵣₘ = RF₀,₀ / RFₜₒₜₐₗ = 1M/1M = 1.0

Now, calculate the rewards going to the LP:

• OCEAN_budget = 10K OCEAN
• total_OCEAN_rewards = min(OCEAN_budget, total_staked * WPY) = min(10K, 1M * 0.0157171) = min(10K, 15717.1) = 10K OCEAN
• LP 0’s rewards: rewards₀ = RF₀,₀_ₙₒᵣₘ * total_OCEAN_rewards = 1.0 * 10K = 10K OCEAN

Finally, calculate APY:

• WPY₀ = rewards₀ / stake₀,₀ =10K / 1M = 0.01 = 1.0%
• APY₀ = (1 + WPY)⁵² — 1.0 = (1 + 0.01)⁵² — 1.0 = 0.678 = 67.8%.

Discussion:

• In scenario 1, reward was bounded by the APY, so we saw (a) max APY and (b) rewards given was less than the weekly budget.
• Here, in scenario 2, reward was bounded by the weekly budget, so we saw (a) APY less than max (b) rewards hitting their cap of the weekly budget.

Summary: LP’s rewards were 10K OCEAN, and APY was 67.8%

# Scenario 3

Setup:

This is a bit like scenario 2 but with two pools, and two LPs, each with equal stake and consume volume. That is:

• LP 0 stakes 1M OCEAN into pool 0. Pool 0 has 1 consume, price 1.0 OCEAN
• LP 1 stakes 1M OCEAN into pool 1. Pool 1 has 1 consume, price 1.0 OCEAN
• 10K OCEAN rewarded

Below, bold = different than scenario 2.

Q: How much does the staker earn in one week? What’s APY?

First, calculate the pro-rata RF value for the LP:

• stake₀,₀ = 1M OCEAN
• stake₁,₁ = 1M OCEAN
• DCV₀ = 1 OCEAN
• DCV₁ = 1 OCEAN
• RF₀,₀ = stake₀,₀ * DCV₀ = 1M * 1 = 1M
• RF₁,₁ = stake₁,₁ * DCV₁ = 1M * 1 = 1M
• RFₜₒₜₐₗ = RF₀,₀ + RF₁,₁ = 1M + 1M = 2M OCEAN
• RF₀,₀_ₙₒᵣₘ = RF₀,₀ / RFₜₒₜₐₗ = 1M/2M = 0.5
• RF₁,₁_ₙₒᵣₘ = RFi₁,₁ / RFₜₒₜₐₗ = 1M/2M = 0.5

Now, calculate the rewards going to the LP:

• OCEAN_budget = 10K OCEAN
• total_OCEAN_rewards = min(OCEAN_budget, total_staked * WPY) = min(10K, 2M * 0.0157171) = min(10K, 31434.2) = 10K OCEAN
• LP 0’s rewards: rewards₀ = RF₀,₀_ₙₒᵣₘ * total_OCEAN_rewards = 0.5 * 10K = 5K OCEAN
• LP 1’s rewards: rewards₁ = RF₁,₁_ₙₒᵣₘ * total_OCEAN_rewards = 0.5 * 10K = 5K OCEAN

Finally, calculate APY:

• WPY₀ = rewards₀ / stake₀,₀ = 5K / 1M = 0.005 = 0.5%
• WPY₁ = rewards₁ / stake₁,₁ = 5K / 1M = 0.005 = 0.5%
• APY₀ = APY₁ = (1 + WPY)⁵² — 1.0 = (1 + 0.005)⁵² — 1.0 = 0.296 = 29.6%

Discussion: this is a simple scenario of two identical LPs getting identical rewards

Summary: each LP had 5K OCEAN rewards, and APY of 29.6%

# Scenario 4

Setup:

This is like scenario 3, but pool 1 has 9x more consumes. That is:

• LP 0 stakes 1M OCEAN into pool 0. Pool 0 has 1 consume, price 1.0 OCEAN
• LP 1 stakes 1M OCEAN into pool 1. Pool 1 has 9 consumes, price 1.0 OCEAN
• 10K OCEAN rewarded

Q: How much does the staker earn in one week? What’s APY?

First, calculate the pro-rata RF value for the LP:

• stake₀,₀ = 1M OCEAN
• stake₁,₁ = 1M OCEAN
• DCV₀ = 1 consume * (1 OCEAN / datatoken) = 1 OCEAN
• DCV₁ = 9 consumes * (1 OCEAN / datatoken) = 9 OCEAN
• RF₀,₀ = stake₀,₀ * DCV₀ = 1M * 1 = 1M
• RF₁,₁ = stake₁,₁ * DCV₁ = 1M * 9 = 9M
• RFₜₒₜₐₗ = RF₀,₀ + RF₁,₁ = 1M + 9M = 10M OCEAN
• RF₀,₀_ₙₒᵣₘ = RF₀,₀ / RFₜₒₜₐₗ = 1M/10M = 0.1
• RF₁,₁_ₙₒᵣₘ = RFi₁,₁ / RFₜₒₜₐₗ = 9M/10M = 0.9

Now, calculate the rewards going to the LP:

• OCEAN_budget = 10K OCEAN
• total_OCEAN_rewards = min(OCEAN_budget, total_staked * WPY) = min(10K, 10M * 0.0157171) = min(10K, 157171) = 10K OCEAN
• LP 0’s rewards: rewards₀ = RF₀,₀_ₙₒᵣₘ * total_OCEAN_rewards = 0.1 *10K = 1K OCEAN
• LP 1’s rewards: rewards₁ = RF₁,₁_ₙₒᵣₘ * total_OCEAN_rewards = 0.9 *10K = 9K OCEAN

Finally, calculate APY:

• WPY₀ = rewards₀ / stake₀,₀ = 1K / 1M = 0.001 = 0.1%
• WPY₁ = rewards₁ / stake₁,₁ = 9K / 1M = 0.009 = 0.9%
• APY₀ = (1 + WPY₀)⁵² — 1.0 = (1 + 0.001)⁵² — 1.0 = 0.296 = 0.0533 = 5.33%
• APY₁ = (1 + WPY₁)⁵² — 1.0 = (1 + 0.009)⁵² — 1.0 = 0.5934 = 59.34%

Discussion: With everything identical except 9x DCV, LP 1 gets 9x the rewards of LP 0. As a staker, it really matters where you stake!

Summary: LP 0 had 1K OCEAN rewards and APY of 5.33%. LP 1 had 9K OCEAN rewards and APY of 59.34%.

# Conclusion

This post described worked examples to help stakers understand DF earnings.

The first two scenarios had just one LP (on one pool). Scenario 1 showed how APY could be the bounding factor, and scenario 2 showed how OCEAN_budget could be.

The next two scenarios had two LPs, each on its own pool, with identical stake. Scenario 3 had identical DCV, leading to identical reward for each LP. In scenario 4, one pool had 9x the DCV which led to 9x the rewards.

AI/ML

Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot