> For the complete documentation index, see [llms.txt](https://docs.theradius.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.theradius.xyz/overview/lighthouse/deposits-and-withdrawals.md).

# Deposits & Withdrawals

### Deposits

<figure><img src="/files/r9axyQQ5bWHTqmJhd8y3" alt=""><figcaption><p><strong>Figure 3. Deposit</strong> – steps to deposit funds within Lighthouse.</p></figcaption></figure>

1. **Deposit Tokens**: Searchers deposit tokens into the Lighthouse contract to fund bidding fees.
2. **Send `Deposited` Event:** The server receives the deposits instantly and updates the searcher balances, avoiding redundant on-chain queries.
3. **Submit Bid:** Searchers submit MEV bundles with a `BidMsg`; the server verifies that each bid is fully backed by the searcher’s deposit.
4. **Send Auction Closed Message**: The server informs the chain of auction close, triggering settlement. The server deducts the winning bid and distributes it between Lighthouse and the rollup per a predefined ratio.

***

### Withdrawals

<figure><img src="/files/2H3v0VeGpd6KbUI7ZMul" alt=""><figcaption><p><strong>Figure 4. Withdrawal</strong> – steps to withdraw funds within Lighthouse.</p></figcaption></figure>

1. **Reserve Withdrawal:** A searcher reserves a withdrawal first. This enforces a delay to prevent inconsistencies (e.g., using the same deposits simultaneously for a bid and a withdrawal).
2. **Send `WithdrawalReserved` Event:** Upon receiving the reservation event, the server marks the searcher as *ineligible to bid*. From this point, the searcher cannot submit bids.
3. **Withdraw:** After the withdrawal window opens, the searcher withdraws their funds from the contract.
4. **Send `Withdrew` Event:** The server detects withdrawal and updates the searcher’s deposit balance.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.theradius.xyz/overview/lighthouse/deposits-and-withdrawals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
