Last updated

Partner Tip and MEV Revenue Settlement CLI (rakurai-revshare)

The Partner Tip and MEV Revenue Settlement CLI (rakurai-revshare) is used to manage partner revenue settlement for custom tips accounts (TCA) and MEV/backrun revenue (MCA).

Partners collect SOL in their own accounts during an epoch. At the end of the epoch, this CLI allows partners to inspect their revenue accounts, record MEV revenue where required, and settle the validator's share into the appropriate on-chain vault.

This CLI supports two revenue types:

  • Custom Tips accounts (Tip) — settle the validator's recorded share of tips collected through a custom tip account.
  • MEV Share (Mev-share) — record and settle the validator's agreed share of post-pack/backrun revenue.

The two revenue types use separate vaults and workflows. Always use the correct --revenue-kind and avoid recording the same MEV revenue more than once.

This CLI does not manage PSA accounts. Services that sell or resell post-pack confirmations must use rakurai-p2c to manage their PSA.

Audience: Transaction-landing services and post-pack partners participating in custom tips and/or MCA-based backrun revenue sharing.

Program: Reward Distribution.

Related documentation:


1. What This CLI Manages

Partners may collect SOL in their own accounts from custom tips or post-pack MEV activity. Rakurai cannot directly withdraw these funds. At the end of each epoch, the partner settles the validator's agreed share into the corresponding on-chain revenue vault.

ActionCommands
Read TCA / MCA balances and pending amountsget-account, get-all-accounts, pending-record commands
Record MCA MEV revenue for the current epochrecord-revenue
Settle SOL into the validator's revenue vaulttransfer, transfer-all

Claiming or distributing settled funds is handled by the manager flow and is outside the scope of this CLI.

TCA and MCA vaults are created by Rakurai / ops before settlement.

--revenue-name is the service ID assigned by Rakurai when custom tips and/or post-pack access is enabled. It is used as a PDA seed, so use the exact assigned value.

1.1. --revenue-kind Tip vs Mev-share

The --revenue-kind flag determines which revenue vault and workflow the command operates on.

--revenue-kind Tip (TCA)--revenue-kind Mev-share (MCA)
Use whenRunning a custom tip accountSharing post-pack / backrun MEV revenue
During epochValidator records the owed share automaticallyNo revenue is recorded
After epochTransfer the recorded amountRecord, then transfer
Who recordsValidatorPartner using the MCA record_authority keypair
Settle within 2 epochs

If revenue is not recorded and settled within 2 epochs, post-pack access and MCA prioritization stop after the grace period. For custom tip accounts, the same delay prevents the tip account from being used for prioritization.


2. What You Do Each Epoch

2.1. Custom Tips — --revenue-kind Tip

  1. Wait for the epoch to end.
  2. Run get-account or get-all-accounts to check the balance, total owed, and deficit.
  3. If there are pending epochs, settle them with transfer or transfer-all.
  4. Keep the transaction signature for your records.

2.2. Post-pack MEV Share — --revenue-kind Mev-share

  1. Wait for the epoch to end.
  2. Run record-revenue once per validator using the MCA record_authority keypair.
  3. Run get-account or get-all-accounts to confirm the pending amount.
  4. Settle the recorded amount with transfer or transfer-all.
  5. Keep the transaction signatures for your records.

If you also resell post-pack confirmations, manage the PSA separately with rakurai-p2c. This CLI does not manage PSA fees.


3. Commands

rakurai-revshare \
  --url <RPC_URL> \
  --program-id <REWARD_DISTRIBUTION_PROGRAM_ID> \
  --keypair <KEYPAIR> \
  <COMMAND>

Global flags: -u / --url, -p / --program-id, -k / --keypair.

3.1. get-account

Displays one revenue vault for one validator, including the account pubkey, revenue name, validator vote account, balance after rent exemption, total owed for completed epochs, and deficit if greater than zero.

The current cluster epoch is excluded from the total owed amount. Use --detail to display the record authority and per-epoch entries.

rakurai-revshare \
  --url <RPC_URL> \
  --program-id <REWARD_DISTRIBUTION_PROGRAM_ID> \
  get-account \
  --revenue-kind Mev-share \
  --revenue-name <REVENUE_NAME> \
  --vote-pubkey <VALIDATOR_VOTE_PUBKEY>

3.2. get-all-accounts

Displays all revenue vaults matching --revenue-kind and --revenue-name.

By default, the command shows pending amounts by validator and epoch. Use --detail for additional per-account information.

3.3. get-pending-record / get-all-pending-records

Inspect a specific epoch or all unsettled epochs for a revenue vault.

3.4. record-revenue (MCA only)

record-revenue is available only for --revenue-kind Mev-share and requires the MCA record_authority keypair.

This command records the MEV amount for the current cluster epoch. It does not transfer SOL.

Record revenue only once per validator per epoch

record-revenue adds to the existing epoch entry rather than replacing it. Running the command twice for the same validator and epoch records the amount twice and doubles the amount owed.

Check the current entry with get-pending-record before recording again.

rakurai-revshare \
  --url <RPC_URL> \
  --program-id <REWARD_DISTRIBUTION_PROGRAM_ID> \
  --keypair <RECORD_AUTHORITY_KEYPAIR> \
  record-revenue \
  --revenue-kind Mev-share \
  --revenue-name <REVENUE_NAME> \
  --vote-pubkey <VALIDATOR_VOTE_PUBKEY> \
  --amount <LAMPORTS>

3.5. transfer / transfer-all

Settle one pending epoch for one revenue vault, or settle all pending epochs across matching vaults.

Both commands support --dry-run.


Appendix: Program IDs

ClusterReward DistributionRakurai Activation
MainnetRAkd1EJg45QQHeuXy7JEWBhdNvsd64Z5PbZJWQT96iBrAKACC6Qw8HYa87ntGPRbfYEMnK2D9JVLsmZaKPpMmi
TestnetA37zgM34Q43gKAxBWQ9zSbQRRhjPqGK8jM49H7aWqNVBpmQHMpnpA534JmxEdwY3ADfwDBFmy5my3CeutHM2QTt
These commands move real SOL

Before recording or transferring revenue, verify the RPC cluster, program ID, validator vote pubkey, revenue name, epoch, and lamport amount.

Use --dry-run with transfer and transfer-all before executing a settlement.