Skip to content

Dont attribute new revenue if user exceeds 30d max volume and deprecate AffiliateWhitelist (Backport) (backport #3189)#3192

Merged
jusbar23 merged 1 commit intorelease/indexer/v9.xfrom
mergify/bp/release/indexer/v9.x/pr-3189
Oct 23, 2025
Merged

Dont attribute new revenue if user exceeds 30d max volume and deprecate AffiliateWhitelist (Backport) (backport #3189)#3192
jusbar23 merged 1 commit intorelease/indexer/v9.xfrom
mergify/bp/release/indexer/v9.x/pr-3189

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Oct 23, 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).
This is an automatic backport of pull request #3189 done by [Mergify](https://mergify.com).

…te AffiliateWhitelist (Backport) (#3189)

(cherry picked from commit 3e9b8ac)

# Conflicts:
#	protocol/x/clob/keeper/process_single_match_isolated_insurance_fund_test.go
@mergify mergify bot requested a review from a team as a code owner October 23, 2025 16:20
@mergify mergify bot added the conflicts label Oct 23, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Oct 23, 2025

Cherry-pick of 3e9b8ac has failed:

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

You are currently cherry-picking commit 3e9b8ac3.
  (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/app/testdata/default_genesis_state.json
	modified:   protocol/mocks/ClobKeeper.go
	modified:   protocol/mocks/MemClobKeeper.go
	modified:   protocol/scripts/affiliates/update_affiliate_parameters.py
	modified:   protocol/scripts/genesis/sample_pregenesis.json
	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/keeper/keeper.go
	modified:   protocol/x/affiliates/keeper/keeper_test.go
	modified:   protocol/x/affiliates/types/constants.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/revshare/keeper/revshare_test.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)
	deleted by us:   protocol/x/clob/keeper/process_single_match_isolated_insurance_fund_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 23, 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.

@jusbar23 jusbar23 merged commit 6978376 into release/indexer/v9.x Oct 23, 2025
42 of 47 checks passed
@jusbar23 jusbar23 deleted the mergify/bp/release/indexer/v9.x/pr-3189 branch October 23, 2025 16:20
jusbar23 added a commit that referenced this pull request Oct 24, 2025
… deprecate AffiliateWhitelist (Backport) (backport #3189) (#3192)"

This reverts commit 6978376.
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.

1 participant