> For the complete documentation index, see [llms.txt](https://perped.gitbook.io/perped/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://perped.gitbook.io/perped/technical-overview/how-it-works.md).

# How it Works

An overview on how Perped works

Perped leverages API3's Request-Response Protocol (RRP). Here's a general flow of how it works

1. When a user wants to open a perpetual position on *Perped* (for example, a 10x long position on AAPL stock) they go to the web UI and put in the parameters for it, or the trade can be opened from a direct RPC call to the blockchain.
2. The associated *Perped* smart contract responsible for opening and closing positions will then send a call to the **Airnode RRP** smart contract which then writes the details of the request to the blockchain in the form of an event.
3. The Airnode for the data provider that *Perped* has chosen to use will then ‘wake up’ for its next interval, and see that there was an event written to the blockchain that tells it the *Perped* protocol smart contract needs to know the price of AAPL stock.
4. The Airnode will retrieve the price of the stock from the data provider’s HTTP API and then send that value along with some other information such as a uniquely generated request ID directly to the *Perped* smart contract. The function on the *Perped* contract that receives the price information from the Airnode will have all of the other data necessary for opening the trade already there as a pending trade.
5. When it receives the price from Airnode, the trade is then settled at that time, by the transaction from the Airnode (aka “Airnode Settlement”). That’s it, the trade is now open. The same action outlined here is done when closing a trade.
