Sample scope document for a trading bot
This is a sample of the format, written for a fictional project. Client A and Exchange A do not exist, so this is not a real client and there are no real results here. It shows how written rules become trading bot requirements and a specification that can be tested, before any development starts.
Sample, fictional project. Text in [square brackets] would be filled in for a real project. Risk limits and rule thresholds are blank on purpose: Client A sets them, and Fincode does not suggest them. Purely technical values, such as how often reconciliation runs, are marked [from design] and reach Client A in the design note for approval. A scope document is what you receive at the end of the first stage in how we work.
| Document | Scope document |
|---|---|
| Project | Order service for Client A on Exchange A (fictional) |
| Version | 1.0, [date] |
| Prepared by | Fincode |
| Approver for Client A | [name, role] |
| Rule document | Client A rule document, version 1.2, [date] |
| Platform sources | Exchange A API documentation and API terms, read on [date] |
1. Purpose and status
This document states what the software must do, what it must not do, and how each requirement will be checked. It is the trading bot specification for this project, written before any development starts. Once Client A approves it, the written proposal is based on it. If this document and a later message disagree, this document stands until a numbered change says otherwise.
2. Background
Client A is a company that trades its own account on Exchange A. It has written its entry, exit and risk rules in a rule document and applies them by hand. It wants software that applies those rules on its own account, with its own API key, on its own server. No other person's account or money is involved.
The rules, instruments and limits are Client A's decisions. During discovery Fincode checked that the rules are precise enough to code and test. Fincode did not choose them and makes no statement about whether they will make money.
3. Responsibilities
| Area | Client A | Fincode |
|---|---|---|
| Rules and parameters | Writes them, including every limit and threshold | Checks that they can be coded and tested. Does not suggest or change them |
| Exchange A account and API key | Holds the account. Creates the key with read and trade permissions, withdrawal off | Does not ask for withdrawal rights. Uses test-environment keys during development |
| Server | Provides and secures the server. Enters the live key on it | Deploys the software and documents what the server needs |
| Trading decisions and positions | Decides and watches | Does not make trading decisions and does not watch positions |
| Technical operation after go-live | Receives alerts and can use the emergency stop | Watches technical operation in the initial period, [length agreed in the contract] |
| Approvals | A named person approves each stage | Waits for that approval before the next stage |
4. System overview
The order service is a set of small components on Client A's server. The risk gate sits in the only path to the adapter, so no rule can bypass it. Only Exchange A's responses and events can mark an order as open, filled or closed.
Exchange A market data
|
v
Rule module applies rules R-01 to R-nn from the rule document
| order instruction (signed, may be delivered more than once)
v
Intake checks secret and schema, drops duplicates and
| late messages
v
Risk gate allowlist, size and loss limits, emergency stop
|
v
Order manager saves intent, tracks state, resolves unknowns
| ^
v | responses and account events
Adapter signing, clock check, rate budget, symbol rules
| ^
v |
Exchange A
Beside the main path:
Reconciler compares local state with Exchange A
Logs and alerts record each decision and report failures
5. Functional requirements
These are the trading bot requirements for this project. Each one is written so that it can be checked, and each names its check from section 10. Most of them describe failure, because the normal path is the easy part of trading software.
Rules
| ID | Requirement | Check |
|---|---|---|
| FR01 | Apply rules R-01 to R-nn exactly as written in rule document version 1.2. A rule that cannot be coded as written goes back to Client A as a question. Fincode does not interpret it. | W01 |
| FR02 | Produce one order instruction per rule decision, carrying a unique instruction ID, the rule ID and the time it was created. | W01 |
Intake
| ID | Requirement | Check |
|---|---|---|
| FR03 | Reject any instruction that fails the shared-secret check or the schema check. Log the reason. Create no order. | T04 |
| FR04 | Process each instruction ID at most once, however many times it is delivered. Acknowledge and log repeat deliveries as duplicates. The record of processed IDs survives a restart. | T01, T07 |
| FR05 | Reject an instruction older than the late-message threshold and log how far past the threshold it is. Threshold: [set by Client A]. | T03 |
Risk gate
| ID | Requirement | Check |
|---|---|---|
| FR06 | Check every order against the symbol allowlist, maximum order size, maximum position and daily loss limit before it can reach the adapter. Values: [set by Client A]. | T05 |
| FR07 | Ship with no default limit values. The service refuses to start if a value is missing. | T05 |
| FR08 | If a limit cannot be evaluated, for example because a balance is unavailable, block the order and alert. | T05 |
| FR09 | Provide an emergency stop that blocks all new orders in one step and works with the rule module stopped. Effect on open orders and positions: [decided by Client A]. | T11 |
Order manager
| ID | Requirement | Check |
|---|---|---|
| FR10 | Write the order intent and its client order ID to durable storage before the first send. | T07 |
| FR11 | Treat a timeout or a 5xx response on an order request as an unknown outcome, never as a failure. Query by client order ID. Resend only after Exchange A confirms the order does not exist, with the same client order ID. A "not found" answer counts only after [number and spacing of queries from design]. | T02 |
| FR12 | Mark an order as open, filled or closed only on Exchange A's responses and events. Reported fills, not the requested quantity, set the position. Track partial fills. Applying the same event twice has no effect. | T09 |
| FR13 | Round price and quantity to Exchange A's symbol rules, read from the API at start-up and refreshed [interval from design]. Quantity never rounds up past a risk limit. An order below the platform minimum is not sent, and the reason is logged. | T14 |
Connections and limits
| ID | Requirement | Check |
|---|---|---|
| FR14 | Keep requests inside a client-side budget below Exchange A's published limits. On a rate-limit response, wait the time Exchange A states before the next request. | T08 |
| FR15 | Reconnect with exponential backoff and jitter. Detect a silent connection with a heartbeat deadline. After a reconnect, resubscribe and reconcile before sending any new order. | T06 |
| FR16 | Measure the clock offset against Exchange A's server time. Above [threshold from design], block new orders and alert. | T10 |
Restart and reconciliation
| ID | Requirement | Check |
|---|---|---|
| FR17 | On start-up, accept no new orders until stored state is loaded, each unfinished order is resolved by a query to Exchange A, and reconciliation is clean. | T07 |
| FR18 | Reconcile open orders, fills and balances at start-up, after each reconnect and [interval from design]. A difference with no explanation freezes new orders and alerts. Only a person named by Client A can release the freeze. | T13 |
Logs and alerts
| ID | Requirement | Check |
|---|---|---|
| FR19 | Log every instruction, check result, order request, response, state change and manual action with a UTC timestamp and the instruction ID. Never log API keys, secrets or signatures. | T12 |
| FR20 | Alert [channel named by Client A] on a risk block, a freeze, an unknown outcome still open after [time from design], failed reconnects, clock offset and any process restart. | T02, T05, T06, T07, T10, T13 |
6. Non-functional requirements
- Where it runs: Client A's own server, [operating system and version]. Fincode does not host it. The intake listens on a private interface only, with no public endpoint.
- API key: read and trade permissions only, withdrawal off, IP restriction on where Exchange A supports it. Encrypted where it is stored on the server. Never in code, the repository, logs or messages.
- Capacity: expected load is [instructions per day, from Client A]. The test report states what was measured. Nothing is claimed that was not measured.
- Availability: no uptime figure is promised. Outages caused by the exchange, the server or the connection cannot be ruled out entirely, so this document specifies how the software behaves when they happen.
- Time: every timestamp is in UTC, and the host's clock is kept in sync.
- Logs: kept for [period set by Client A], in a location that survives the loss of the process.
- Operations: a runbook covers start, stop, restart, key rotation and releasing a freeze.
7. Platform facts recorded during discovery
Exchange A is invented, so these facts are too. In a real document, each row cites the platform's documentation and the date it was read. Which platforms a customer can use depends on the law of the customer's country and the platform's terms: Client A's country is [stated here], and the check is repeated before go-live.
| Topic | What Exchange A documents | Effect on the design |
|---|---|---|
| Signing | HMAC-signed requests carrying a timestamp, accepted inside a window around server time | The adapter signs, and the clock offset is monitored (FR16) |
| Rate limits | Request weight per IP, order count per account, and a rate-limit response that states a wait time | Client-side budget below the limit (FR14) |
| Client order IDs | Unique among open orders only. An ID can be accepted again once the earlier order has closed | The ID alone does not prevent duplicates, so the order manager queries before any resend (FR11) |
| 5xx responses | The execution status is unknown, and the order may have succeeded | Unknown outcome state (FR11) |
| Symbol rules | Tick size, step size and minimum order value per symbol, from an API call | Read at start-up and refreshed (FR13) |
| Test environment | A testnet with virtual funds and periodic resets. Fills do not reflect live liquidity | Fill prices are not evaluated in testing. Test data is rebuilt by script |
| API terms | Automated trading on the account holder's own account is allowed. [A real document quotes the clause] | Re-read before go-live. A change is raised with Client A at once |
8. Out of scope
- Choosing, changing or judging rules, instruments or parameters.
- Any view on whether the rules will make money. Historical replay checks that rules fire as written, and no return is calculated from it.
- Watching positions, running the software or placing orders for Client A.
- Any account other than Client A's own. Fincode declines projects that run on other people's accounts, copy trades or sell signals, and it does not take a profit share.
- Withdrawals or transfers of any kind.
- Hosting, and the security of Client A's server and account credentials.
- Tax or accounting reports, other exchanges, and any user interface beyond logs, alerts and the command line.
- Maintenance after handover, which is agreed separately. It covers the software and API compatibility, not strategy changes or position monitoring.
9. What Fincode needs from Client A
- The rule document, frozen at version 1.2 during development. The rule document template shows what it covers.
- Worked cases from Client A's own records, with the action expected in each. They become check W01.
- A value for every limit and threshold marked [set by Client A].
- A testnet key with read and trade permissions. The live key is never sent to Fincode.
- Access to the server for deployment, on terms Client A sets.
- A named approver, and a named person who can release a freeze.
10. Acceptance checks
Acceptance checks describe how the software behaves. A return, a win rate or a backtest result is not an acceptance criterion. The sample test report shows how these results are reported.
| ID | Case | Passes when |
|---|---|---|
| W01 | Worked cases from the rule document | The software's decision matches the expected action in every case |
| T01 | The same instruction is delivered four times | One order only. Three deliveries are logged as duplicates |
| T02 | Exchange A returns a 5xx on an order request, or no response arrives before the timeout | The status is checked before anything is resent. One order at most. An outcome that stays unknown raises an alert |
| T03 | An instruction arrives past the threshold | It is rejected and logged. No order |
| T04 | An instruction is invalid | It is rejected and logged with the reason. No order |
| T05 | A quantity is too large, a limit cannot be evaluated, or a limit value is missing | The risk gate blocks the order before it reaches the exchange, and an alert goes out. With a value missing, the service does not start |
| T06 | A connection drops while an order is open | Reconnects with backoff and reconciles before any new order. No fill is lost |
| T07 | The process is killed in the middle of an order | No duplicate order. State matches Exchange A before new orders are accepted |
| T08 | Exchange A returns a rate-limit response | No request is sent during the stated wait |
| T09 | An order fills in parts, and one event arrives twice | Position equals the reported filled quantity. The repeated event changes nothing |
| T10 | The clock offset passes the threshold | New orders are blocked and an alert goes out |
| T11 | The emergency stop is used | No new order after the stop, including with the rule module stopped |
| T12 | All logs are searched for secrets | No API key, secret or signature is found |
| T13 | An order exists that the software did not place | New orders freeze, an alert goes out, and only the named person can release the freeze |
| T14 | Price or quantity does not fit the symbol rules | Rounded as specified. An order below the minimum is not sent |
| P01 | Paper trading period, [length agreed] | Every instruction can be traced from decision to order to its final state, with no unexplained difference |
11. Test approach
- Automated tests on synthetic data, including a fake exchange that can fail on demand.
- Historical replay to check that each rule fires as written (W01). No return is calculated.
- Exchange A's testnet with a proxy that can delay, drop or replace responses, so failures happen when the test needs them (T01 to T14).
- A paper trading account with live market data (P01).
- A live account with small limits, only after Client A approves the test report. The limits are Client A's.
12. Deliverables
- The order service, with source code and deployment scripts. Code ownership: [agreed in the contract].
- A configuration file with no limit values filled in.
- A test report covering every check in section 10.
- Technical documentation and an operations runbook.
13. Open questions
Questions stay visible until someone answers them. Each one blocks only the work that depends on it.
| No. | Question | Owner |
|---|---|---|
| Q1 | How is the daily loss limit measured: which amounts count, and when does the day reset? | Client A |
| Q2 | What should the emergency stop do to open orders and open positions? | Client A |
| Q3 | Rule R-07 does not say which price it reads. Which one? | Client A |
| Q4 | Who can release a freeze outside working hours? | Client A |
| Q5 | Does Exchange A's testnet support every order type the rule document uses? | Fincode |
14. Changes to this document
After approval, each change is written as a numbered change to this document, with its effect on work items, dates and cost. Work on a change starts only after Client A approves it. A new version of the rule document counts as a change.
15. Terms set elsewhere
| Term | Where it is set |
|---|---|
| Cost and delivery dates | [in the written proposal] |
| Payment terms | [agreed in the contract] |
| Code ownership | [agreed in the contract] |
| Confidentiality | [agreed in the contract] |
| Bug-fix period after delivery | [agreed in the contract] |
| Reply times | [agreed in the contract] |
16. Approval
| Role | Name | Date | Decision |
|---|---|---|---|
| Client A approver | [name] | [date] | [approved, or changes requested] |
| Fincode | [name] | [date] | [issued] |
Sample of the format for a fictional project. Tests show how the software behaves, not future results. Trades can lose money. Strategy and investment decisions belong to the account holder. Fincode is a software company and does not provide investment advice, portfolio management or crypto asset services.
What to look for in any trading bot specification
You can hold a specification to these tests, whoever writes it.
Failure is written down
A specification that only describes normal orders leaves the costly decisions to whoever writes the code. Look for duplicates, unknown outcomes, dropped connections and restarts.
Every requirement has a check
If nobody can say how a requirement will be tested, nobody can say when it is done.
The rules stay with their author
The scope points to the customer's rule document and does not rewrite it. A rule that is unclear comes back as a question, like Q3 above.
Blanks stay blank
Risk limits and rule thresholds belong to the customer. A developer who fills them in is making a decision about your account.
Profit is not a test
Acceptance describes behavior. If a return figure appears as a pass condition, ask what is being promised.
Questions about scope documents
Is this a real project?
No. Client A and Exchange A are fictional, and so are the platform facts and open questions. The page shows the format of a scope document, not a real client or real results.
What is the difference between a rule document and a scope document?
You write the rule document: it says what your rules are. Fincode writes the scope document: it says what the software does with those rules, how it behaves when something fails, and how each requirement is checked.
Do I need a specification before I contact you?
No. Your first message only needs the platform, what the software should do and your timeline. The scope document is written with you during discovery.
Will you fill in the limits and thresholds for me?
No. Fincode does not recommend strategies or parameters. Limits and thresholds are decisions about your account, so they stay yours.
Is a scope document a contract?
No. It is the technical basis for the written proposal. Cost and dates appear in the proposal, and terms such as payment and code ownership are agreed in the contract.
Read the other documents
Want a scope document for your own project?
Send a short brief with the platform you use, what the software should do and your timeline. You do not need to share your rules yet. Fincode is a software company and does not provide investment advice, portfolio management or crypto asset services.