Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Oct 22, 2025

Changelist

  • Don't attribute any more revenue if user has exceeded the 30d cap
  • Use the new 30d affiliate volume window to calculate tier
  • Interpret overrides as being the highest tier

Test Plan

  • Unit tests

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

    • Affiliate info now includes 30-day rolling referred volume.
    • Fees respect a referee minimum fee tier override from affiliate parameters.
    • Enforced 30-day caps on affiliate revenue/volume attribution per referred user.
    • Affiliate parameters are included in genesis and exposed via queries.
  • Chores

    • Renamed affiliate parameter fields to quote-quantum terminology across APIs and schemas; updated testnet defaults.
    • Updated protobufs and indexer codegen to match new fields.
    • Revised affiliate-parameters CLI script: new args/defaults and payload keys.

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

(cherry picked from commit 1b53602)

# Conflicts:
#	indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/affiliates.ts
#	indexer/packages/v4-protos/src/codegen/dydxprotocol/stats/stats.ts
#	proto/dydxprotocol/affiliates/affiliates.proto
#	proto/dydxprotocol/stats/stats.proto
#	protocol/scripts/affiliates/update_affiliate_parameters.py
#	protocol/scripts/genesis/sample_pregenesis.json
#	protocol/testing/testnet/genesis.json
#	protocol/x/affiliates/keeper/grpc_query_test.go
#	protocol/x/affiliates/keeper/keeper.go
#	protocol/x/affiliates/keeper/keeper_test.go
#	protocol/x/affiliates/types/affiliates.pb.go
#	protocol/x/affiliates/types/constants.go
#	protocol/x/affiliates/types/expected_keepers.go
#	protocol/x/affiliates/types/keys.go
#	protocol/x/affiliates/types/query.pb.go
#	protocol/x/revshare/keeper/revshare.go
#	protocol/x/revshare/keeper/revshare_test.go
#	protocol/x/stats/keeper/keeper.go
#	protocol/x/stats/types/stats.pb.go
@mergify mergify bot requested a review from a team as a code owner October 22, 2025 19:36
@mergify mergify bot added the conflicts label Oct 22, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Oct 22, 2025

Cherry-pick of 1b53602 has failed:

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

You are currently cherry-picking commit 1b536022.
  (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/affiliates/genesis.ts
	modified:   indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/query.ts
	modified:   proto/dydxprotocol/affiliates/genesis.proto
	modified:   proto/dydxprotocol/affiliates/query.proto
	modified:   protocol/app/app.go
	modified:   protocol/app/testdata/default_genesis_state.json
	modified:   protocol/testutil/keeper/assets.go
	modified:   protocol/testutil/keeper/clob.go
	modified:   protocol/testutil/keeper/listing.go
	modified:   protocol/testutil/keeper/perpetuals.go
	modified:   protocol/testutil/keeper/prices.go
	modified:   protocol/testutil/keeper/revshare.go
	modified:   protocol/testutil/keeper/rewards.go
	modified:   protocol/testutil/keeper/sending.go
	modified:   protocol/testutil/keeper/subaccounts.go
	modified:   protocol/x/affiliates/genesis.go
	modified:   protocol/x/affiliates/keeper/grpc_query.go
	modified:   protocol/x/affiliates/types/genesis.go
	modified:   protocol/x/affiliates/types/genesis.pb.go
	modified:   protocol/x/clob/keeper/mev.go
	modified:   protocol/x/clob/keeper/orders.go
	modified:   protocol/x/clob/keeper/process_single_match.go
	modified:   protocol/x/clob/types/expected_keepers.go
	modified:   protocol/x/feetiers/keeper/grpc_query.go
	modified:   protocol/x/feetiers/keeper/keeper.go
	modified:   protocol/x/feetiers/keeper/keeper_test.go
	modified:   protocol/x/feetiers/types/expected_keepers.go
	modified:   protocol/x/feetiers/types/types.go
	modified:   protocol/x/revshare/keeper/keeper.go
	modified:   protocol/x/vault/keeper/vault_test.go

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   indexer/packages/v4-protos/src/codegen/dydxprotocol/affiliates/affiliates.ts
	both modified:   indexer/packages/v4-protos/src/codegen/dydxprotocol/stats/stats.ts
	both modified:   proto/dydxprotocol/affiliates/affiliates.proto
	both modified:   proto/dydxprotocol/stats/stats.proto
	deleted by us:   protocol/scripts/affiliates/update_affiliate_parameters.py
	both modified:   protocol/scripts/genesis/sample_pregenesis.json
	both modified:   protocol/testing/testnet/genesis.json
	both modified:   protocol/x/affiliates/keeper/grpc_query_test.go
	both modified:   protocol/x/affiliates/keeper/keeper.go
	both modified:   protocol/x/affiliates/keeper/keeper_test.go
	both modified:   protocol/x/affiliates/types/affiliates.pb.go
	both modified:   protocol/x/affiliates/types/constants.go
	both modified:   protocol/x/affiliates/types/expected_keepers.go
	both modified:   protocol/x/affiliates/types/keys.go
	both modified:   protocol/x/affiliates/types/query.pb.go
	both modified:   protocol/x/revshare/keeper/revshare.go
	both modified:   protocol/x/revshare/keeper/revshare_test.go
	both modified:   protocol/x/stats/keeper/keeper.go
	both modified:   protocol/x/stats/types/stats.pb.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.

@jusbar23 jusbar23 closed this Oct 23, 2025
@jusbar23 jusbar23 deleted the mergify/bp/release/protocol/v9.x/pr-3117 branch October 23, 2025 00:55
@jusbar23 jusbar23 restored the mergify/bp/release/protocol/v9.x/pr-3117 branch October 23, 2025 15:43
@jusbar23 jusbar23 reopened this Oct 23, 2025
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