Canli Paper Trading
v0.3.1Agent trading on your Alpaca paper account behind pre-trade checks and confirmation tokens.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
paper_account Paper account
Read your Alpaca paper account: equity, cash, buying power, positions, open orders, the market clock, the kill switch and the local order log's verified head.
preview_paper_orders Preview paper orders
Check orders against your paper account, live quotes, the market clock, your limits file and the kill switch; when every order passes, return a five-minute confirmation token for exactly these orders.
| Parameter | Type | Description |
|---|---|---|
orders * | array | Orders to check. |
fees | object | Your fee schedule, if any (Alpaca equities: no commission). |
limits | object | Tighten your limits file for this call only (e.g. {"max_order_notional": 5000}). |
rebalance_to_weights Rebalance to weights
Turn target portfolio weights into the whole-share orders that move your paper account there (sells first), check them, and return a confirmation token when all pass.
| Parameter | Type | Description |
|---|---|---|
target_weights * | object | Target weight per ticker as a fraction of equity, e.g. {"SPY": 0.6, "TLT": 0.4}. |
allow_leverage | boolean | Allow gross weight above 1; default false. |
allow_short | boolean | Allow negative weights; default false. |
cash_buffer | number | Equity kept in cash; default 0.02. |
fees | object | Your fee schedule, if any (Alpaca equities: no commission). |
limits | object | Tighten your limits file for this call only (e.g. {"max_order_notional": 5000}). |
liquidate_others | boolean | Sell holdings not in target_weights; default false. |
min_trade_usd | number | Skip smaller changes; default 50. |
verify_attestation Verify an attestation
Check an attestation a pre-trade check or send returned: that it was signed by the trader's keys (Ed25519 and, where present, post-quantum ML-DSA-65; both must hold) and not altered, and, given openings from the trader's commitments file, that committed account figures are what they claim. Offline; reads nothing from Alpaca.
| Parameter | Type | Description |
|---|---|---|
attestation * | object | An attestation object a check or send returned. |
openings | array | Commitments to open: label, commitment, salt and value, from the trader's commitments.jsonl. |
pq_public_key_pem | string | The signer's ML-DSA-65 public key (PEM), for an attestation also signed post-quantum; default this machine's CANLI_HOME/attest-ml-dsa-65.pub.pem. |
public_key_pem | string | The signer's public key (PEM); default this machine's CANLI_HOME/attest-ed25519.pub.pem. |
send_paper_orders Send paper orders
Send previewed orders to your Alpaca paper account with their confirmation token (the kill switch is read again first), or cancel open paper orders by id. Every send is logged, hash-chained.
| Parameter | Type | Description |
|---|---|---|
cancel_order_ids | array | Open paper order ids to cancel instead (no token needed). |
token | string | Confirmation token from preview_paper_orders or rebalance_to_weights. |