> For the complete documentation index, see [llms.txt](https://docs.radfi.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.radfi.co/radfi-actions-flowchart.md).

# 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.
