# radFi Actions Flowchart

<figure><img src="/files/QIzke7e8G8TXQ2gZ2ESm" alt=""><figcaption></figcaption></figure>

### **Key Components**

**Frontend (FE)**&#x20;

* User interface for sending actions and signing transactions.

**RadFi Backend (BE)**&#x20;

* Processes requests, generates PSBTs, and handles transaction broadcasting.

**Pending State Contract**

* Temporary contract validating transactions before final submission.

**Sequencer**

* Ensures transaction validity before sending it to the Main State Contract.

**Main State Contract**

* Stores finalized transactions after validation.

**Bitcoin Chain**

* Bitcoin mainnet where transactions are permanently recorded on-chain.

**Database (DB)**

* Stores transaction-related data for tracking and verification.

### **Flow Overview**

**1. Fetch Pool and Ratio Data**

* The FE retrieves pool and ratio data from the user.

**2. User Action Request**

* The user initiates an action via the FE, which sends a request to the RadFi BE.

**3. Generate PSBT (Partially Signed Bitcoin Transaction)**

* The BE creates a PSBT and sends it back to the FE for user signing.

**4. User Signs PSBT**

* The user signs the PSBT and returns it to the BE.

**5. Broadcast Signed Transaction to Pending State Contract**

* The BE broadcasts the signed transaction to the Pending State Contract.

**6. Transaction Validation**

* The Pending State Contract processes the transaction and returns a success/failure status.

**7. Notify Frontend**

* The BE relays the transaction success/failure result back to the FE.

**8. Sequencer Processing**

* If the transaction is successful, the BE sends the signed transaction to the Sequencer for final verification.

**9. Broadcast Final Transaction to Main State Contract**

* The Validator broadcasts the final transaction to the Main State Contract.

**10. Transaction Finalization on Bitcoin Mainnet**

* The Validator broadcasts the fully signed transaction to Bitcoin mainnet, completing the process.


---

# 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.radfi.co/radfi-actions-flowchart.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.
