# Globe agent sessions

Globe is a trading terminal on Atlas, a perpetuals and spot exchange. This
server lets an agent trade one sub-account that a Globe user opened for it.

## Connecting

1. The user opens Globe, Profile, Agent sessions, and enables a session: the
   markets, the largest single order in each, and how long it lasts.
2. They fund the session's sub-account. That balance is the most the agent can
   lose.
3. They give their agent this server's address, https://mcp.globemarkets.xyz,
   and the session's connector token as the bearer token
   ("Authorization: Bearer globe-mcp-v1...").

An agent that can run code can instead trade from the user's machine with the
session code and globe-agent.mjs, so the code never leaves it.

## How to trade

- Call get_session first. It lists the markets this session may trade, the cap
  per order, and the expiry. Orders outside them are refused.
- Read before you write: get_ticker, get_order_book, get_candles and
  get_recent_trades for the market; get_account, get_positions,
  get_open_orders and get_fills for the sub-account.
- Sizes and prices are decimal strings, for example "0.01" and "64250.5". Use
  the tick and lot sizes from list_markets.
- Orders are cross margin. Atlas holds a cross position at the market's
  maximum leverage, so risk is set by size, not by a leverage setting.
- A market order fills only what the book holds. Check get_positions after.
- If an answer says the outcome is unknown, check get_open_orders and
  get_positions before sending the order again, or it may be placed twice.
- Ask the user before placing an order unless they told you to trade on your
  own.

## What a session can't do

Withdraw, transfer, change keys, or touch any account but its sub-account. The
user can end it at any time in Globe, and it stops by itself at the expiry.
