Admin screens
The four AI Investments admin screens — the dashboard, the plans and durations tables, and the Investment Logs desk — including which actions move money and which analytics figures are real.
Everything for this addon lives under /admin/ai/investment, reached from
Extensions → Investment Products → AI Investment in the admin menu. The menu
entry is gated on the ai_investment extension flag and the
access.ai.investment permission; the section's content is additionally held
behind a licence check for the same extension name.
Four screens, in the order the navigation lists them.
Dashboard
/admin/ai/investment · access.ai.investment
The landing screen. It fetches one endpoint and refreshes itself every minute,
with a 1m / 3m / 1y timeframe selector that only affects the chart.
Overview figures — totals across the whole install, not the selected timeframe:
| Figure | What it counts |
|---|---|
| Total investments, total amount, average investment | Everything except REJECTED |
| Total profit | Wins add, losses subtract, draws contribute nothing |
| Active / completed / cancelled / rejected | Counts by status |
| Win rate | Wins as a share of settled outcomes |
| Active plans, total durations | Configuration counts |
| Spot / Eco investments | Counts by wallet type |
Total profit is the one to read carefully. It is signed by outcome — the
profit column stores an absolute amount for every result, so summing it raw
counted a loss as a gain and reported a figure that was too high by twice the
losses. On one database checked during the 6.1.1 work, the reported total was
+1102 where the true figure was −48.
Below that: a chart of amount invested over the selected window, a distribution
of invested amount across plans, the ten most recent investments with their
owners, and the five top plans sorted by trending first and then by the plan's
invested field.
The top-plans list orders by trending then by invested. invested is a
static field on the plan that nothing in the addon ever updates — see
Plans. If you have never maintained it, this list is
effectively ordered by the trending flag alone.
The plan distribution chart on the same page is computed from real investments and is the figure to trust.
A failed load renders as a failure with the reason and a Try again button, not as a page of zeros. A refresh that fails after the page has already loaded leaves the existing figures on screen.
Plans
/admin/ai/investment/plan · access.ai.investment.plan
A standard data table over ai_investment_plan. Create, edit, view and delete are
all available; the table is not treated as paranoid, so deleted plans do not
appear and there is no restore action here.
The compound first column shows the plan's image and internal name. title,
profitPercentage, status and the attached durations are the visible columns;
everything else — the amount limits, invested, minProfit, maxProfit,
defaultProfit, defaultResult, trending, the description and the id — is in
the expanded row.
status renders as a live toggle, so activating and deactivating a plan is a
click in the table rather than an edit. The view dialog surfaces the two amount
limits, the profit rate and invested as a stat strip, and — when the plan has
investments — a panel counting positions, staked total, paid profit and a badge
per status.
Deleting is refused with a 409 while any investment references the plan. That is covered in Plans; the short version is that you should deactivate instead, always.
Durations
/admin/ai/investment/duration · access.ai.investment.duration
The smallest screen in the addon: a table of two columns over
ai_investment_duration, sorted by the duration number.
Create, edit and delete are available. The table is not paranoid, and neither is the underlying model — a delete here is a real delete, which is why it is refused while any investment references the row. Durations explains why that guard exists and what used to happen without it.
The same data is served to the plan form's duration picker through a separate
options endpoint, which returns each row pre-formatted as 30 DAY. That endpoint
requires view.ai.investment.duration; on an earlier build it checked only that
the caller was signed in, so any account could read the list.
Investment Logs
/admin/ai/investment/log · access.ai.investment
The operational desk. A paranoid table over ai_investment with an analytics
header, showing the investor, the plan, the amount, the status, the profit, the
symbol, the wallet type, the result, the duration and the creation date.
What you can change
Editing is only offered on ACTIVE investments, and the form has exactly two
fields: profit and result.
Settlement resolves the ROI from roiPercentage first and only falls back to the
absolute profit column when roiPercentage is null. Every investment created
since 6.1.1 has roiPercentage stamped at purchase, so the profit value you
type here is overwritten at settlement and never affects the payout.
result does take effect. It is the first entry in the outcome precedence,
so changing it on an ACTIVE investment changes what that investment settles as
— without moving any money at the time you save it.
The backend refuses four fields outright, each with an explanation rather than a silent drop:
| Field | Why it is refused |
|---|---|
amount |
The principal has already been debited; changing it desynchronises the wallet |
userId |
Would orphan the funding transaction |
type |
Decides which wallet the payout goes to, and the debit came from the original one |
status |
Completing or cancelling must pay or refund; use the status action instead |
A Status select used to sit on this form and was silently discarded. An admin could pick "Completed", save, see a success toast, and nothing would happen — no status change and no payout. It has been removed rather than fixed in place.
What moves money
The status action, single or bulk. COMPLETED settles on the derived terms;
CANCELLED and REJECTED refund the principal in full. Only ACTIVE
investments can be moved, and the bulk action reports which ids succeeded and
which failed rather than claiming a whole batch worked.
Delete refunds only when the principal is genuinely still outstanding. Restore restores. Both are described in Lifecycle.
POST /api/admin/ai/investment/log exists and takes create.ai.investment, but
the table does not expose a Create button — deliberately. The handler is a plain
record write: it does not touch a wallet, does not create a funding transaction,
and does not snapshot any terms.
An investment created that way will still be picked up by settlement, which falls back to resolving the wallet by user, currency and type when no funding transaction exists — so it will pay out principal plus profit that was never taken from anybody. Do not call it.
The analytics header
Four rows of figures computed directly from ai_investment:
- Capital Deployed — the sum of
amountacrossACTIVEinvestments. This is your outstanding liability: principal you are holding and owe back. It is a stock, so it is shown as a current value rather than folded into the selected window. - ROI Paid Out —
profitsummed acrossCOMPLETEDWINinvestments. Money you have paid out, shown inverted so it reads as a cost. - Principal Retained —
profitsummed acrossCOMPLETEDLOSSinvestments. Principal you kept. - House Result — retained minus paid. The product's own profit and loss.
- Win Rate Over Time, plus win rate, winning count, completed count and average ticket. The average excludes cancelled and rejected rows, which never became positions.
- Spot and Eco capital by value, and two ranked bars: Top Symbols by
Deployed Capital and Top Plans by Deployed Capital. Both use the same
ACTIVEfilter and the same column as Capital Deployed, so they reconcile with it exactly. Concentration is the finding — one plan carrying the whole book means one mispriced rate can empty your float.
All the money figures come from the absolute profit column rather than
roiPercentage, because the analytics engine can multiply two columns but cannot
divide. profit is written alongside roiPercentage on every settlement, so it
is the exact figure and needs no arithmetic.
Where the user side lives
There is no user-facing page for this addon under its own route. Users buy from
the AI Investment tab in the trade order form on /trade and /trade/pro,
and see their holdings in the Orders panel of the Pro workspace.
That asymmetry is worth knowing when you are handling a support ticket: a user on
the standard trade page can open an investment and then has nowhere on that page
to see it. Point them at /trade/pro.
Next: Configuration surface — what is actually configurable, and what is not.