Skip to main content

Bot

No description

type Bot implements Node {
aiHistory(
first: Int
): [AIHistoryEntry!]!
strategy: Strategy
pnl7d: BotPnl7d!
runnerReachable: Boolean!
runnerLastSeenAt: Time
webhookUrl: String
webhookToken: String
encryptionStatus: EncryptionStatus!
id: ID!
public: Boolean!
featured: Boolean!
deletedAt: Time
encryptionMode: BotEncryptionMode!
keyCustodyBackend: BotKeyCustodyBackend!
keyID: String
keyVersion: Int
algorithm: BotEncryptionAlgorithm!
encryptedAt: Time
name: String!
status: BotBotStatus!
mode: BotBotMode!
config: Map
freqtradeVersion: String!
lastSeenAt: Time
errorMessage: String
exchangeID: ID
strategyID: ID!
runnerID: ID
ownerID: String!
createdAt: Time!
updatedAt: Time!
exchange: Exchange
runner: BotRunner
trades(
after: Cursor
first: Int
before: Cursor
last: Int
orderBy: TradeOrder
where: TradeWhereInput
): TradeConnection!
metrics: BotMetrics
legibleStatus: EntityStatus!
aiMandates: [BotAIMandate!]!
paperStage: BotPaperStage
paperStageAvailable: Boolean!
encryptionLocked: Boolean!
recentUsage: ResourceUsageAggregation
}

Fields​

Bot.aiHistory ● [AIHistoryEntry!]! non-null object​

What the assistant changed on this bot, newest first.

Bot.aiHistory.first ● Int scalar​

Bot.strategy ● Strategy object​

The strategy this bot runs.

NULLABLE by design: strategies are soft-deleted (ADR-0037), so a bot can outlive its strategy. The ENT-generated non-null strategy: Strategy! edge is skipped (see internal/ent/schema/bot.go) precisely so a deleted strategy does NOT trigger GraphQL non-null propagation that would NULL the entire Bot node (which made getBots / getDashboardBots error "ent: strategy not found" and the bot vanish from lists). When the strategy has been deleted this resolves to null, and the bot (with its id, status, and config) stays addressable so the user can still open, stop, or delete it.

Bot.pnl7d ● BotPnl7d! non-null object​

Trailing 7-day PnL window (percent, abs, daily-cumulative series) for cards.

Bot.runnerReachable ● Boolean! non-null scalar​

False when the bot's runner is UNREACHABLE: the runner has running bots and none was contacted within the monitoring window. The bot's own status is then its last-known value and cannot currently be confirmed. True when the runner is reachable, has nothing to observe, does not support monitoring, or the bot has no runner.

Bot.runnerLastSeenAt ● Time scalar​

When the platform last heard from the bot's runner (its most recent bot contact). Null if never seen or not applicable.

Bot.webhookUrl ● String scalar​

The TradingView webhook endpoint a trader pastes into a TradingView alert's Webhook URL box. It carries NO token: the token goes in the alert message body as "token" (see webhookToken), so the URL is safe in any request, ingress or CDN log (#2438).

Resolves only for callers who hold view-secrets on the bot (the endpoint is useless without the token), and to null until a token has been generated via regenerateBotWebhook.

Bot.webhookToken ● String scalar​

The bot's webhook token — the credential a TradingView alert sends as the "token" field of its JSON message body so it can force-enter/exit a pair on this bot.

SECURITY: this is a SECRET. It is gated by the view-secrets scope exactly like Bot.config: it resolves only for callers who hold view-secrets on the bot, and to null for everyone else (and null until a token has been generated via regenerateBotWebhook). The FE lazy-fetches it like other secrets.

Bot.encryptionStatus ● EncryptionStatus! non-null object​

Bot.id ● ID! non-null scalar​

Bot.public ● Boolean! non-null scalar​

Whether this resource is publicly visible to all authenticated users

Whether this resource is featured (appears at top of lists)

Bot.deletedAt ● Time scalar​

Soft-delete timestamp. If set, record is considered deleted.

Bot.encryptionMode ● BotEncryptionMode! non-null enum​

Trust-ladder encryption mode for this row's sensitive fields. Set at create time; immutable after. Defaults to 'legacy_server' for all rows created before the trust ladder shipped.

Bot.keyCustodyBackend ● BotKeyCustodyBackend! non-null enum​

KeyCustodyBackend implementation that produced the wrapping key. Pinned at write time alongside encryption_mode.

Bot.keyID ● String scalar​

Opaque identifier of the wrapping key, backend-specific. Null for legacy_server rows that use the global process key.

Bot.keyVersion ● Int scalar​

Rotation counter for the wrapping key. Null for legacy_server rows; populated when the row is rewrapped under a versioned key.

Bot.algorithm ● BotEncryptionAlgorithm! non-null enum​

Symmetric algorithm protecting the row's sensitive fields. Stored alongside the ciphertext so future migrations can retire algorithms without re-encrypting existing rows.

Bot.encryptedAt ● Time scalar​

Timestamp the row's sensitive fields were last encrypted with the current key_id/key_version. Null for legacy_server rows.

Bot.name ● String! non-null scalar​

Bot display name

Bot.status ● BotBotStatus! non-null enum​

Bot lifecycle status

Bot.mode ● BotBotMode! non-null enum​

Trading mode (dry-run or live)

Bot.config ● Map scalar​

REQUIRED to create a bot. Complete freqtrade bot configuration — must contain stake_currency, stake_amount, entry_pricing and exit_pricing (plus pairlists, pricing, api_server as needed). Omitting it on updateBot leaves the stored config unchanged.

Bot.freqtradeVersion ● String! non-null scalar​

Freqtrade Docker image version tag

Bot.lastSeenAt ● Time scalar​

Last successful health check

Bot.errorMessage ● String scalar​

Last error message if status is error

Bot.exchangeID ● ID scalar​

Foreign key to exchange (provides credentials). REQUIRED when mode is live — createBot rejects a live bot without a connected exchange. Optional for dry-run bots, which may instead carry their exchange config inline in config.exchange (and must then set config.exchange.name to a supported exchange slug) — paper-trading doesn't need a connected Exchange entity.

Bot.strategyID ● ID! non-null scalar​

Foreign key to strategy (provides code)

Bot.runnerID ● ID scalar​

Foreign key to runner (provides execution environment). REQUIRED to create a bot, despite being typed as optional: createBot rejects a null runnerID. The column stays nullable so bots survive runner deletion as orphans — the runner.Delete hook clears runner_id on all bots referencing the runner before the runner is soft-deleted. Orphan bots cannot start until assigned a new runner.

Bot.ownerID ● String! non-null scalar​

Group ID (organization) that owns this bot

Bot.createdAt ● Time! non-null scalar​

Bot.updatedAt ● Time! non-null scalar​

Bot.exchange ● Exchange object​

Bot.runner ● BotRunner object​

Bot.trades ● TradeConnection! non-null object​

Bot.trades.after ● Cursor scalar​

Returns the elements in the list that come after the specified cursor.

Bot.trades.first ● Int scalar​

Returns the first _n_ elements from the list.

Bot.trades.before ● Cursor scalar​

Returns the elements in the list that come before the specified cursor.

Bot.trades.last ● Int scalar​

Returns the last _n_ elements from the list.

Bot.trades.orderBy ● TradeOrder input​

Ordering options for Trades returned from the connection.

Bot.trades.where ● TradeWhereInput input​

Filtering options for Trades returned from the connection.

Bot.metrics ● BotMetrics object​

Bot.legibleStatus ● EntityStatus! non-null object​

Bot.aiMandates ● [BotAIMandate!]! non-null object​

The active live Mandates this bot is under: ones that admitted an AI change on it and are neither frozen, expired nor pending a co-sign. Empty when the assistant does not manage it, or live Mandates are off for the organization. Visible to every member who can read the bot.

Bot.paperStage ● BotPaperStage object​

The bot's paper stage, or null when it has none (never promoted, or it runs another version since).

Bot.paperStageAvailable ● Boolean! non-null scalar​

Whether this bot's organization has the paper stage (ai.mandates_l3), so a validated version may be promoted onto it.

Bot.encryptionLocked ● Boolean! non-null scalar​

True when the bot's secure_config has at least one passphrase-encrypted leaf (api_server.username / password / jwt_secret_key) that the current session could not decrypt. UI consumers must show an unlock overlay before rendering the credentials form.

Bot.recentUsage ● ResourceUsageAggregation object​

Usage summary for the last 24 hours Aggregated from ResourceUsageAggregation if available, or calculated from samples Only populated if the bot runs on a runner with billing enabled

Interfaces​

Node interface​

An object with an ID. Follows the Relay Global Object Identification Specification

Returned By​

botChanged subscription ● botStatusChanged subscription ● createBot mutation ● createBotWithPassphrase mutation ● forceExitAll mutation ● pauseBotEntry mutation ● promoteBotToPaper mutation ● regenerateBotWebhook mutation ● restartBot mutation ● resumeBotEntry mutation ● setBotFeatured mutation ● setBotVisibility mutation ● startBot mutation ● stopBot mutation ● updateBot mutation ● updateBotConfigWithPassphrase mutation

Member Of​

BotEdge object ● BotMetrics object ● Trade object