Add or remove agent commission
Access prerequisites
- Permission (module):
manageToken - License/Feature:
STAKING_TOKENS - Menu container: GENERAL → group Investments / Financial Distributions → screen Staking Applications
What it is / when to use
Modal opened by the Agent commission icon (manage_accounts) on a staking application. Allows linking an agent (partner/referrer) to an application, defining the percentage they receive on the amount contributed by the client. The agent is then paid automatically according to the current contract. The modal has two sections: list (already linked agents) and add.
Prerequisites
- The agent must already exist in the system (agent registration). Otherwise the backend responds with
agent not found. - Permission:
manageToken(dual — CPM enum on the backend + module in the DB).
Fields ("Add" tab)
| Field | What it is | Required? | System/backend effect |
|---|---|---|---|
| Agent ID | Identifier of the agent to be linked | Yes | Sent as agentId to createAgentsLinkedStaking; validates agent existence |
| Percentage | Commission percentage on the contributed amount | Yes | Sent as percentage; defines how much the agent receives; automatic payment according to contract |
The Apply button remains disabled while both (percentage and agent ID) are not filled in.
Actions and modals
- Apply (add): calls
createAgentsLinkedStaking(stakeId+agentId+percentage). Handles distinct errors:agent not foundandstake not found. - Delete (in the list): opens a confirmation (bottom-sheet); upon confirmation, calls
deleteAgentsLinkedStakingby the link'sid.
Business rules / notes
Attention
- The commission is applied on the amount contributed by the user and the agent is paid automatically according to the current contract — there is no manual entry.
- Errors are differentiated: non-existent agent, non-existent application (stake), and non-existent commission (when deleting).
- Financial values: the commission percentage follows BigNumber treatment of financial values.