> ## Documentation Index
> Fetch the complete documentation index at: https://docs.garden.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Intent Flow

> Understand the complete technical flow of how user intents are processed in Garden protocol

<Frame>
  <img src="https://mintcdn.com/garden-e60e7dd0/NpoTY5cHYX9LGVws/images/garden%20protocol.png?fit=max&auto=format&n=NpoTY5cHYX9LGVws&q=85&s=93e05bd99d51836ac8a125a2d2a53ded" alt="Garden Protocol Architecture Overview" width="7680" height="4000" data-path="images/garden protocol.png" />
</Frame>

Now that we know all the actors and modules in the system, let's take a detailed technical look at how all of them come together.

Here's a simplified representation of the process:

<Steps>
  <Step title="Intent creation">
    User requests quote → Signs intent → Submits intent to order book
  </Step>

  <Step title="Solver selection">
    Order book selects solver → Solver begins settlement
  </Step>

  <Step title="User settlement">
    User initiates transaction → Solver executes on destination chain
  </Step>

  <Step title="Completion">
    User redeems funds → Solver completes settlement
  </Step>
</Steps>

Here is the detailed look into each step of the process.

## Creating an intent

<CardGroup cols={1}>
  <Card title="Request quote" icon="calculator">
    The user starts the process by requesting a **quote** for a desired swap. The quote contains details like the input asset, output asset, chains involved, and the desired amounts.
  </Card>

  <Card title="Accept quote" icon="signature">
    The user receives the quote and must **accept it** by creating a **signed intent message.**
  </Card>

  <Card title="Create intent" icon="list-check">
    This signed intent represents the user's objective, including parameters like assets, chains, amounts, and expiration details.
  </Card>
</CardGroup>

## Selection of solver in the order book

Once the user signs the intent, it is submitted to the **order book**, a decentralized system where solvers compete to fulfill the intent.

### Auction process:

<Steps>
  <Step title="Quote submission">
    All solvers submit their quotes based on the intent's parameters.
  </Step>

  <Step title="Best quote determination">
    The **best quote** (lowest price or highest efficiency) is determined.
  </Step>

  <Step title="Breaking draws">
    Solvers with a **higher staker score** than the solver with the best quote have a 5-second window to match the quote.

    * **No acceptance:** The best-quote solver wins.
    * **One acceptance:** The accepting solver wins.
    * **Multiple acceptances:** The solver with the highest staker score wins.
  </Step>

  <Step title="Solver confirmation">
    Once a solver is selected, they prepare to execute the swap.
  </Step>
</Steps>

## Settlement: User-side execution

<Steps>
  <Step title="Begin settlement">
    The settlement process begins once the selected solver is confirmed.
  </Step>

  <Step title="User initiation">
    The user must **initiate settlement** by creating a **signed transaction message** for the intent.
  </Step>

  <Step title="Relayer broadcast">
    The signed message is submitted to a **relayer**, which broadcasts it on the blockchain.
  </Step>

  <Step title="On-chain processing">
    The transaction is processed on-chain, and the user's funds are locked or transferred to the relevant contract or wallet.
  </Step>

  <Step title="Confirmation">
    Once the transaction achieves the required number of blockchain confirmations, the settlement progresses to the solver's side.
  </Step>
</Steps>

## Settlement: Solver-side execution

<Steps>
  <Step title="Receive confirmation">
    The solver, upon receiving confirmation of the user-side transaction, initiates the corresponding transaction on their end.
  </Step>

  <Step title="Execute on destination">
    This step involves the solver locking funds on the destination chain, earmarked for the user.
  </Step>

  <Step title="Solver confirmation">
    The solver's transaction also undergoes a confirmation process on the destination chain to ensure security and reliability.
  </Step>
</Steps>

## Redemption

<Steps>
  <Step title="Asset availability">
    After the solver's transaction achieves the required confirmations:

    * The user can redeem funds on destination revealing the swap prehash.
  </Step>

  <Step title="Solver redemption">
    Once the user reveals the prehash the solver is able to recieve funds on the source chain, completing the swap.
  </Step>
</Steps>
