> For the complete documentation index, see [llms.txt](https://docs.trover.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trover.tech/engineering/verify-2026-09-13-fees-round-4-operating-wallet.md).

# Verify 2026-09-13 · fees round 4 · one operating wallet

## What changed

* The platform fee wallet moved to `0x61eAA89638B4425278EB4B6978c5C0d7bADacc9C` (defaults for `PLATFORM_FEE_WALLET`, `RELAY_APP_FEE_RECIPIENT`, `STABLEDEX_FEE_WALLET`; admin-page deployer defaults for admin, fee wallet, league manager, voucher signer).
* `stockBuyerAddress()` (`apps/worker/src/trading.ts`): the stock basket is bought from, and distributor tranches are funded by, the platform fee wallet unless `TREASURY_PRIVY_WALLET_ID` is set. Before, the buyer assumed the fee key belonged to `TREASURY_WALLET_ADDRESS`, which was true only while treasury and fee wallet were the same address (`0x4b14…`).
* Token-fee sweeps (`sweepTokenFeeReceiver`) land in the buyer wallet, not the treasury.
* The `platform_fees` revenue source for stock tranches now sums the `platform_fees` ledger (DEX, agent and NFT fees) instead of `trade_fees`.
* `feeWalletReady()` guards every fee-wallet send: the key must control `PLATFORM_FEE_WALLET` or the split, referral payouts and stock buys log and stop instead of moving another wallet's funds. A mismatch is logged once at worker start.
* Docs: wallet table in `contracts-runbook.md`, admin note in `token-economics.md`.

## Server env (addresses only, done by the deploy; backup taken first)

```
PLATFORM_FEE_WALLET=0x61eAA89638B4425278EB4B6978c5C0d7bADacc9C
TREASURY_BUY_ENABLED=true
TREASURY_BUYBACK_PERCENT=35
TREASURY_PRIVY_WALLET_ID=
```

`TREASURY_PRIVY_WALLET_ID` was still set from the old design; cleared so `stockBuyerAddress()` resolves to the platform fee wallet.

## Result

Deploy m: `DEPLOY_EXIT=0`, api and worker healthy. With the old key still in place the worker logged the expected level-50 line `FEE_ACCUMULATOR_PRIVATE_KEY does not control PLATFORM_FEE_WALLET` once at start (key `0x4b14…`, wallet `0x61eA…`); it disappears once the new key is in.

The private key is added by the operator (see the chat handoff): replace `FEE_ACCUMULATOR_PRIVATE_KEY`, add `SOCIAL_CLAIM_VOUCHER_SIGNER_PRIVATE_KEY` with the same value, `docker compose … up -d api worker`.

## Checks

* `tsc --noEmit` clean for `packages/core`, `apps/worker`, `apps/web` (web: ignore stale `.next/types` entries for deleted routes).
* After the key is in: worker log has no `FEE_ACCUMULATOR_PRIVATE_KEY does not control PLATFORM_FEE_WALLET` line.
* Before the key is in: `fee split: FEE_ACCUMULATOR_PRIVATE_KEY is missing…` warning once per run, nothing sent.

## Migration

None.

## Deploy

```
ssh trevor-server 'cd ~/trover && git pull --ff-only && nohup bash -c "docker compose -f docker-compose.yml -f docker-compose.production.yml build api worker && docker compose -f docker-compose.yml -f docker-compose.production.yml up -d api worker" > deploy-m.log 2>&1 &'
```

Frontend: Vercel on push to `main`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.trover.tech/engineering/verify-2026-09-13-fees-round-4-operating-wallet.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
