> 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/plan-2026-09-13-fees-and-referrals.md).

# Plan 2026-09-13: collect 1% on every trade, referral links, daily referral league

## Where fees stand today (measured)

* Robinhood Chain trades from the agent, X, MCP and flash-trading web users go straight to Uniswap from the delegated wallet. No fee leg exists in the transaction (checked on `0x116bdd…bfa93a`), and the post-trade fee transfer was disabled as unsafe ("fee\_not\_collected\_no\_atomic\_route"). Collected so far: 3 fees, $0.015.
* Web swaps on Ink and XLayer through 0x carry an integrator fee; Robinhood and Stable swaps waive it ("atomic\_fee\_unavailable").
* NFT buys, sweeps and mints: no fee at all.
* `TroverAtomicFeeExecutor` (takes the fee inside the swap transaction) exists, is tested and rehearsed on testnet, but is not deployed on mainnet, and its fee is immutable at deploy time.

## Round 1: one executor, every token trade (this round)

1. Executor v2: `maxFeeBps` immutable cap (300), `defaultFeeBps` owner-set (100), and `executeNative/executeToken` take the fee in basis points as a call argument (≤ cap). Referral discounts become a per-call number; the backend is the only caller that builds these transactions, and a user who crafts their own call with a lower fee is simply trading without us.
2. Worker trade path: every Robinhood trade (buys and sells, all channels) goes through the executor when `AUTO_INVEST_FEE_EXECUTOR_ADDRESS` is set; `PLATFORM_FEE_BPS` becomes 100. Sells use `executeToken` with the sold asset as the token in.
3. Web swaps: Robinhood swaps in `dex-swaps.ts` are wrapped in the executor the same way (native `executeNative`, ERC-20 `executeToken` with the approval pointed at the executor).
4. Deploy the executor on mainnet from the admin page (fee wallet = `PLATFORM_FEE_WALLET`, cap 300, default 100), set `AUTO_INVEST_FEE_EXECUTOR_ADDRESS` and `PLATFORM_FEE_BPS=100`, redeploy. Until then nothing changes on-chain: the code falls back to today's behaviour.

## Round 2: NFT fees, referral codes, referral league (migration)

* `PlatformFee` table: one row per fee owed from any source (token trade, web swap, NFT buy/sweep/mint), with bps, token, amount, USD, status and tx hash. Token trades write it from the executor receipt; NFT actions write it and a keeper sends it as a second native transfer from the delegated wallet after the purchase confirms (the wallet is delegated precisely so no prompt is needed; Seaport's basic fulfillment sends the NFT to `msg.sender`, so wrapping a purchase in the executor would strand it).
* Referrals: `ReferralCode` (code, owner profile), `TradingProfile.referredById` and `referredAt`, link `trover.tech/r/<code>` sets a cookie, attached at profile creation or first login within 30 days. Referred users pay 80 bps for 90 days (20% off); the referrer earns 25% of every fee their referrals pay, forever, credited to `ReferralReward`.
* Referral league: one epoch per UTC day. The pool is the day's referrer credits, paid in ETH. Payout is proportional to referred fees, not trade count: paying for "most trades" invites wash trading, paying a share of fees actually collected cannot be gamed without paying us more than it returns. Rewards are funded through `TroverEthDistributor` tranches (claimable, seven days), so nothing is pushed to addresses that may not want it, and a public leaderboard shows the day's ranking live.
* Surfaces: account page (your link, referred count, earnings, claim), leaderboard page, agent reads (`referral_status`), MCP.

## Not in scope

Fees on Ink/XLayer/Stable web swaps beyond the existing 0x integrator fee (deploy the executor per chain later), and fees on paper-league or claims.


---

# 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/plan-2026-09-13-fees-and-referrals.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.
