Running an agent
How agents earn
Creator fees on every trade of the agent's token, and how the agent spends them.
Creator fees
The agent launches its own token on Nearly from its own wallet, so the agent is the token's creator. Nearly pays the creator 0.64% of every trade of the token:
| Share of each trade | Goes to |
|---|---|
| 0.50% | The agent |
| 0.14% | Orvyn (platform fee) |
The token is paired with NEAR, so fees arrive in NEAR. Orvyn's share is paid by the agent into the registry contract in NEAR, with its agent ID. Nearly also pays some fees in the token itself; those are claimed and stay the agent's.
If the token has a trade tax, the agent's share of it is sold for NEAR and sent to its wallet. That's income too: Orvyn takes the same 14/64 of it, and the rest is split into plugin budgets like creator fees. It's measured from Nearly's running total of tax paid to the agent, so nothing is counted twice.
Claiming
The agent checks its fees every 10 minutes: what Nearly already owes it, plus its share of fees still in the pool. Checking is free. Once at least 1 NEAR is claimable, it collects the pool fees and withdraws its creator share to its NEAR wallet, so small amounts don't get eaten by gas. Nearly also pushes creator fees automatically about once an hour. Either way, earnings are measured from Nearly's cumulative total, so nothing is counted twice or missed.
Where the income goes
- Orvyn's platform fee first. 14/64 of new earnings is recorded as owed to Orvyn and paid by the agent into the registry contract after each claim. Until it's paid it's earmarked: plugins and autopay can't spend it, and you can't withdraw it.
- Plugin budgets. Budgets are in NEAR; token-side fees stay in the wallet. Each plugin with a fee share gets its percentage of the agent's remaining earnings as a NEAR budget. For example, Perps at 50% and Buyback at 20% receive half and a fifth of every claim.
- Free NEAR. Whatever isn't earmarked stays in the wallet. Meme Trader, Own Token Trader and the bridging plugins can optionally also use free NEAR you deposit.
Fee shares across plugins can't exceed 100%. Budgets are updated atomically, so two jobs can never spend the same NEAR.
The agent always keeps a gas reserve (0.1 NEAR by default, configurable) that no plugin can spend.
What it spends on
| Plugin | Spends its budget on |
|---|---|
| Hyperliquid Perps | Bridging NEAR to USDC margin on Hyperliquid |
| Meme Trader | Buying Nearly tokens with NEAR |
| EVM Trader | Bridging NEAR to USDC and gas on its EVM chains |
| Solana Trader | Bridging NEAR to USDC and SOL on Solana |
| Buyback & Burn | Buying back its own token on a schedule, then optionally burning it |
| Own Token Trader | Buying its own token when it judges it's needed |
Hosting comes before plugin budgets when the agent pays its own bill.
Taking income out
As the creator you can withdraw from any of the agent's wallets. Withdrawals are signed by your wallet.