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

# Technical Details

## Intents Flow Overview

<Frame>
  <img src="https://mintcdn.com/bron/1gTuJzZmbg7j8QZz/images/intents-flow-overview.png?fit=max&auto=format&n=1gTuJzZmbg7j8QZz&q=85&s=481472073567cfbcce6d6b796201c6d0" alt="Intents Flow Overview" width="1462" height="1061" data-path="images/intents-flow-overview.png" />
</Frame>

<Steps>
  <Step title="Create order">
    On this step user creates an order with all the necessary information, including:

    * Base asset and its network
    * Base amount
    * Quote asset and its network
    * Quote amount
    * User address on quote network (to receive the asset)
    * Base amount or quote amount, depending on user needs
    * Order value in USD
    * Max price for slippage protection
    * Auction duration
  </Step>

  <Step title="Solver react">
    Solvers are reacting to that order and propose their price during the auction.
    Solver with the best price will be automatically selected.
    Duration of the auction is defined by the user and is set in the order creation.
  </Step>

  <Step title="User sends needed amount to solver address on base network">
    If user is fine with the solvers price, he sends his funds to the solver address on base network.
  </Step>

  <Step title="User sets his tx hash">
    On this step user sets his tx hash from previous step to the order to complete his settlement.
  </Step>

  <Step title="Oracles decides if user tx was proper">
    On this step oracles will check if user tx was processed on base network, was its amount correct and was it sent to the right (solver) address.
    Decision on each order is made by quorum of oracles.
  </Step>

  <Step title="Set oracles decision on user tx">
    If oracles quorum decided that user tx was proper, they will send the order to the next step.
    If not, they will cancel the order and the order will be finished.
  </Step>

  <Step title="Solver sends needed amount to user address on quote network">
    On this step solver sends the needed amount to the user address on quote network.
  </Step>

  <Step title="Solver sets his tx hash">
    On this step solver sets his tx hash from previous step to the order to complete his settlement.
  </Step>

  <Step title="Oracles decides if solver tx was proper">
    On this step oracles will check if solver tx was processed on quote network, was its amount correct and was it sent to the right (user) address.
    Decision on each order is made by quorum of oracles.
  </Step>

  <Step title="Set oracles decision on solver tx">
    On this step if oracles quorum decided that solver tx was proper, they will finish the order.
    If not, they will liquidate the solver and the order will be finished.
  </Step>

  <Step title="Order Finished!" />
</Steps>

## On-chain status mapping

Each step above corresponds to an `OrderStatus` value emitted via `OrderStatusChanged(string orderId, OrderStatus status)`. Use the numeric code when filtering events.

| Code | Status                              | Meaning                                                                                                                                                         |
| ---: | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|    0 | `NOT_EXIST`                         | Order does not exist                                                                                                                                            |
|    1 | `USER_INITIATED`                    | Order created, auction has not started                                                                                                                          |
|    2 | `AUCTION_IN_PROGRESS`               | A solver has reacted; better quotes still possible. After the auction window elapses, the order stays in this status on-chain until the user transaction is set |
|    4 | `WAIT_FOR_ORACLE_CONFIRM_USER_TX`   | Oracles verifying the user transaction                                                                                                                          |
|    5 | `WAIT_FOR_SOLVER_TX`                | Waiting for the solver to settle on the quote network                                                                                                           |
|    6 | `WAIT_FOR_ORACLE_CONFIRM_SOLVER_TX` | Oracles verifying the solver transaction                                                                                                                        |
|    7 | `COMPLETED`                         | Terminal — settlement complete                                                                                                                                  |
|    8 | `LIQUIDATED`                        | Terminal — solver liquidated, order resolved by backup solver                                                                                                   |
|    9 | `CANCELLED`                         | Terminal — cancelled by broadcaster or due to user-side timeout                                                                                                 |
|   10 | `TO_BE_LIQUIDATED`                  | Intermediate — awaiting backup solver during liquidation                                                                                                        |
|   11 | `DECIDE_BY_DAO`                     | Edge case (e.g. all oracles offline) — DAO arbitration required                                                                                                 |

> Code `3` (`WAIT_FOR_USER_TX`) exists in the enum but is never written to storage or emitted via `OrderStatusChanged`. It is only returned as a derived value by `Metadata.getOrderFullResponse(orderId)` while the auction window has elapsed but the user-settlement window is still open.

## Liquidation process

Liquidation process is pretty simple. If solver didn't send the asset to the user, oracles will decide to liquidate the solver and the order will be paused, until new solver, which will resolve the order, appear.
New solver will receive a premium for that, which is taken from initial solvers insurance balance. Liquidation premium is calculated as ***order volume \* liquidation premium***.
For example if order volume is 1000 USD and liquidation premium is 0.1 (10%), new solver will receive 1100 USD from initial solvers insurance balance for resolving that order.
This ensures that all orders will be resolved in time and users will receive their assets.

## Solvers insurance

Each solver should have insurance to react on orders. Total volume on which solver can react in the moment is calculated as
***total amount of his insurance in USD \* insurance haircut***.
