Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove timestamp argument from RewardRatePool query functions #47

Merged
merged 4 commits into from
Jul 4, 2024

Conversation

jagerman
Copy link
Member

Requiring the timestamp here causes problems with oxend because it means we can't realistically pre-fetch rewards amounts until we get the timestamp from oxen.

That's a problem because we can't pre-fetch the reward data for verification (because it needs the timestamp that goes into the block), which means in order to validate blocks we'd have to stop during block processing and make (and wait for) a contract call to come back.

Removing the timestamp makes this a lot easier because it lets us query the reward rate in advance by only querying every few minutes (at predefined height intervals the network agrees on) and because it now depends on the block timestamp, the value will be the same for anyone fetching it.

(This is based on top of #43; only the last commit here is the intended part of this commit).

I found the "interest" term a little confusing as the pool doesn't
earn/pay interest, but rather pays a portion of its princpal.

(No logic changes.)
Our announced reward payout is 14% annually of the pool, which works out
to ~15.1% when compounded regularly.

This updates the amount, and adds documentation of how that value is
derived from the 14% target.
Tests the the compounding effect on the simple payout rate achieves
(within reasonable error) the intended 14% target when compounded daily
or monthly.
Requiring the timestamp here causes problems with oxend because it means
we can't realistically pre-fetch rewards amounts until we get the
timestamp from oxen.

That's a problem because we can't pre-fetch the reward data for
verification (because it needs the timestamp that goes into the block),
which means in order to validate blocks we'd have to stop during block
processing and make (and wait for) a contract call to come back.

Removing the timestamp makes this a lot easier because it lets us query
the reward rate in advance by only querying every few minutes (at
predefined height intervals the network agrees on) and because it now
depends on the block timestamp, the value will be the same for anyone
fetching it.
@Doy-lee
Copy link
Collaborator

Doy-lee commented Jul 4, 2024

LGTM.

@Doy-lee Doy-lee changed the base branch from master to integration July 4, 2024 06:23
@Doy-lee Doy-lee merged commit fb139e3 into oxen-io:integration Jul 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants