# Architecture

The PawnSpace architecture consists mainly of 3 main contracts.

* `PawnFactory.sol`
* `PawnSpace.sol`
* `PawnOffer.sol`

Let us go through what each contract does in brief:

### `PawnFactory.sol`

The protocol begins with a `Factory` contract which deploys a `PawnSpace` for each existing NFT contract on the parent chain. A `PawnSpace` consists of two smart contracts: one to house the `Order` NFTs, and another to house the `Offer` NFTs.

### `PawnSpace.sol`

`PawnSpace.sol` keeps track of `Orders` and their specific parameters. It contains functions for creating `Orders`, modifying `auto-accept/instant-loan` parameters, accepting `Orders`, paying back loans, and withdrawing an NFT from a defaulted loan.

### `PawnOffer.sol`

It primarily tracks the `Offers` in the protocol. The `Offer` contract contains functions for creating `Offers` towards an existing `Order`, and auto-accepting loans.

{% hint style="info" %}
Cancelling/burning offers and orders that are in-active is also possible.
{% endhint %}


---

# 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://docs.pawnspace.io/concepts/what-the-pawnspace-is/architecture.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.
