# Step-by-Step

In this section, we'll provide a detailed Step-by-Step process of how Kawa operates for various actions, such as supplying and borrowing assets, withdrawing collateral, and the liquidation process.

### *Supplying and Borrowing Assets*

Murakami supplies $ETH as collateral on Ethereum and borrows $SEI on Sei.

1. Murakami deposits $ETH into the Kawa Port Ethereum contract.
2. Kawa Port sends an XCM via the XCM Aggregator Ethereum contract.
3. The XCM Aggregator Ethereum contract sends this message through 3 different XCM protocols: Wormhole, Layer Zero, and Axelar.
4. The XCM Aggregator Sei contract receives these XCMs, once it has received 2 of them, quorum is formed, and it sends the message to the Kawa Core Sei contract.
5. Kawa Core updates, and now Murakami is able to borrow $SEI.
6. Kawa Core sends a message to Kawa Port Sei, and the $SEI is now available.
7. Kawa Port sends a message to Kawa Core to confirm that the borrow was complete.

### *Withdrawing Collateral*

Murakami wants to pay off his healthy $SEI loan and withdraw $ETH collateral.

1. Murakami deposits $SEI into the Kawa Port Sei contract.
2. Kawa Port sends a message to Kawa Core, and his balance is updated.
3. Murakami can now start the withdrawal process of his $ETH.
4. Kawa Core sends an XCM to the XCM Aggregator Sei contract.
5. The XCM Aggregator Sei contract sends this message through 3 different XCM protocols: Wormhole, Layer Zero, and Axelar.
6. The XCM Aggregator Ethereum contract receives these XCMs; once it has received 2 of them, quorum is formed, and it sends the message to Kawa Port Ethereum contract.
7. The $ETH is now available.
8. Kawa Port sends an XCM to confirm that the collateral was withdrawn via the XCM Aggregator Ethereum contract.

### **Liquidation Process:**

Murakami's $SEI loan is underwater. Dave, a sophisticated user, liquidates Murakami's position and receives Murakami's $ETH collateral.

1. Dave deposits $SEI in Kawa Port Sei contract, also indicating that he is to liquidate Murakami's underwater position. In this transaction, he will select his preferred collateral to receive from Murakami's position; in this instance, there is only one choice, $ETH.
2. Kawa Port contract updates the Kawa Core contract. $ETH collateral is now Dave's. He doesn't have to withdraw it at this moment and could borrow against it. He chooses to withdraw it.
3. Kawa Core sends an XCM to the XCM Aggregator Sei contract.
4. The XCM Aggregator Sei contract sends this message through 3 different XCM protocols: Wormhole, Layer Zero, and Axelar.
5. The XCM Aggregator Ethereum contract receives these XCMs; once it has received 2 of them, quorum is met, and it sends the message to Kawa Port Ethereum contract.
6. The $ETH is now available.
7. Kawa Port sends an XCM to confirm that the collateral was withdrawn via the XCM Ethereum contract.


---

# 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://kawa-fi.gitbook.io/kawa/overview/step-by-step.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.
