# Placing a Trade

The main way to interact with a Polymarket market in PaperMarket is through the trade panel on the right side of the screen.\
Here you choose what to buy or sell, how much size to trade and whether to use a market or limit order.

All trades use your virtual cash balance and are executed against the live Polymarket order book on the server.

### Trade panel layout

When a market is loaded the trade panel shows

* the current virtual cash balance
* a selector for side buy or sell
* a selector for token YES or NO
* a field for order size
* a selector for order type
* an optional field for limit price when needed
* a button to submit the order

The panel works with the YES and NO tokens of the market that is currently active in the center of the page.

### Choosing side and token

The first step is to decide what you want to do in the simulation.

* Use the side control to switch between buy and sell
* Use the token control to choose whether you trade the YES token or the NO token for this market

Buys increase your exposure to that outcome.\
Sells reduce or close an existing position in that token.\
The app does not create short positions, so sells are limited by your current position size.

### Entering size

The size field defines how many units of the selected token you want to buy or sell.

Some simple rules apply

* the size must be a positive number
* very large sizes can be limited by the available liquidity in the live order book
* for buys the effective size is also constrained by your remaining virtual cash

If you request more size than can be filled from the current book the backend executes whatever is possible and leaves the rest unfilled.

### Selecting order type and price

Next you choose the order type.

In the main trade panel PaperMarket supports

* market orders that use the best available prices in the book
* limit orders with immediate or cancel behaviour

For a market order you do not set a price.\
The backend walks the order book on the opposite side and matches at the currently visible prices.

For a limit order you specify a limit price between zero and one

* for a limit buy this is the maximum price you are willing to pay
* for a limit sell this is the minimum price you are willing to accept

Any levels in the book that are worse than your limit price are ignored when the order is simulated.

### Submitting the order

Once side token size and order type are set and any required limit price is entered you can submit the trade.

When you press the button the frontend sends a request to the trade API.\
The backend then

* fetches the latest order book for the selected token
* checks that you have enough virtual cash for buys
* checks that you have enough position size for sells
* matches as much size as possible under these constraints
* stores the order and any resulting trades in the database
* updates your cash balance and positions

If the request is invalid for example because the price is outside the allowed range or the size is not a number the backend rejects it and the app shows an error message instead of creating a trade.

### After the trade

After a successful trade you will see several changes in the interface

* the cash balance is updated in the trade panel
* the position for this token is updated in the portfolio and account views
* the average entry price and PnL for this token may change
* the latest trades appear in your history

You can place additional trades on the same market to scale in or out of a position or load a different Polymarket market and repeat the process with a new YES or NO pair.

Each trade is stored on the PaperMarket backend and contributes to your long term simulated track record.


---

# Agent Instructions: 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:

```
GET https://papermarket.gitbook.io/papermarket/using-papermarket/placing-a-trade.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
