Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Oct 22, 2025

Changelist

  • Update protocol to use overrides instead of whitelist
  • Don't attribute new revenue if user exceeds 30d max revenue
  • Add overrides to automatically set tier to max

Test Plan

  • Test cases

Side Effects:

  • Affilliate whitelist will no longer be recognized, only affiliate overrides

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Summary by CodeRabbit

  • New Features

    • Stats now record per-fill affiliate fees and per-user affiliate revenue; stats expiration hooks enforce a 30-day rolling window and adjust attributed volumes.
    • Affiliate overrides (per-address) replace the previous whitelist behavior.
    • New API to retrieve user-specific stats.
  • Changes

    • Top affiliate tier taker fee share increased to 25% (from 20%).
    • Rev-share and match processing now propagate affiliate revenue/override data; attribution caps applied and updated on expiration.
  • Documentation

    • Clarified that global and user stats represent a 30-day rolling window.
  • Chores

    • Affiliate CLI reads client config and uses renamed parameters.

This is an automatic backport of pull request #3109 done by [Mergify](https://mergify.com).

…te AffiliateWhitelist (#3109)

(cherry picked from commit c29eea2)

# Conflicts:
#	protocol/app/testdata/default_genesis_state.json
#	protocol/scripts/affiliates/update_affiliate_parameters.py
#	protocol/scripts/genesis/sample_pregenesis.json
#	protocol/x/affiliates/keeper/keeper.go
#	protocol/x/affiliates/keeper/keeper_test.go
#	protocol/x/affiliates/types/constants.go
#	protocol/x/revshare/keeper/revshare_test.go
@mergify mergify bot requested a review from a team as a code owner October 22, 2025 19:35
@mergify mergify bot added the conflicts label Oct 22, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Oct 22, 2025

Cherry-pick of c29eea2 has failed:

On branch mergify/bp/release/protocol/v9.x/pr-3109
Your branch is up to date with 'origin/release/protocol/v9.x'.

You are currently cherry-picking commit c29eea29.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   indexer/packages/v4-protos/src/codegen/dydxprotocol/stats/stats.ts
	modified:   proto/dydxprotocol/stats/stats.proto
	modified:   protocol/app/app.go
	modified:   protocol/mocks/ClobKeeper.go
	modified:   protocol/mocks/MemClobKeeper.go
	modified:   protocol/testing/testnet/genesis.json
	modified:   protocol/testutil/memclob/keeper.go
	modified:   protocol/x/affiliates/keeper/grpc_query.go
	modified:   protocol/x/affiliates/keeper/grpc_query_test.go
	modified:   protocol/x/affiliates/types/errors.go
	modified:   protocol/x/affiliates/types/expected_keepers.go
	modified:   protocol/x/affiliates/types/keys.go
	modified:   protocol/x/clob/keeper/process_operations.go
	modified:   protocol/x/clob/keeper/process_single_match.go
	modified:   protocol/x/clob/memclob/memclob.go
	modified:   protocol/x/clob/types/clob_keeper.go
	modified:   protocol/x/clob/types/expected_keepers.go
	modified:   protocol/x/clob/types/mem_clob_keeper.go
	modified:   protocol/x/revshare/keeper/revshare.go
	modified:   protocol/x/stats/keeper/keeper.go
	modified:   protocol/x/stats/keeper/keeper_test.go
	modified:   protocol/x/stats/types/expected_keepers.go
	modified:   protocol/x/stats/types/stats.pb.go

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   protocol/app/testdata/default_genesis_state.json
	deleted by us:   protocol/scripts/affiliates/update_affiliate_parameters.py
	both modified:   protocol/scripts/genesis/sample_pregenesis.json
	both modified:   protocol/x/affiliates/keeper/keeper.go
	both modified:   protocol/x/affiliates/keeper/keeper_test.go
	both modified:   protocol/x/affiliates/types/constants.go
	both modified:   protocol/x/revshare/keeper/revshare_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Added logic to check for affiliate address overrides and set tier accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants