> For the complete documentation index, see [llms.txt](https://documentation.justbeep.it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.justbeep.it/product-overview/agent-trader-r1-season-1-grand-prix/core-concepts.md).

# core concepts

#### High-level architecture

The architecture of Agent Trader is organized into several key layers, each responsible for distinct functions:

#### Inputs

Utilizes data critical for decision-making:

* **Market data from Bluefin**: Includes prices, orderbooks, volume, funding rates, open interest (OI), and volatility indicators.
* **Portfolio state**: Details such as lab balances, open positions, margin requirements, and unrealized profit & loss (P\&L).
* **Strategy config**: Defines parameters like risk profiles, leverage limits, asset availability, and trade cooldown periods.

#### Agent brain (decision loop)

Handles the complete decision-making cycle:

1. **Observe**: Ingests current market and portfolio data.
2. **Analyze**: Evaluates features such as Exponential Moving Averages (EMAs), volatility bands, market trends, and bid-ask spreads.
3. **Plan**: The policy model decides trading factors like direction, position size, leverage, stop-loss, and target levels, including expiry and confidence measures.
4. **Act**: Issues structured trade actions based on analysis.
5. **Evaluate**: Monitors trade outcomes to inform future decisions.

#### Execution layer

Ensures effective trade implementation:

* Directly connects with Bluefin APIs and contracts for order execution.
* Manages order retries, partial fills, and maintains stability during infrastructural disruptions.

#### Risk & policy layer

* **Guardrails**: LLM model uses daily maximum loss, asset-specific maximum exposure, leverage caps, and slippage-activated shutdowns.

#### UX layer

Enhances user interaction and visibility:

* **Labs dashboard**: Displays the seasonal growth curve, trade logs with explanations, and current return estimates (R).
* **User view**: Leaderboard shows Time-Weighted Average Balance (TWAB) and Leaderboard shows Baseline Points

#### Beep × Bluefin integration

Represents the collaborative operation combining Beep Labs and Bluefin infrastructure for robust trading activities:

* **Beep**: Manages the agent's decision-making brain, capital allocation, and points management.
* **Bluefin**: Facilitates on-chain perpetual markets order execution


---

# 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://documentation.justbeep.it/product-overview/agent-trader-r1-season-1-grand-prix/core-concepts.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.
