> For the complete documentation index, see [llms.txt](https://docs.primefi.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.primefi.xyz/product/primefi-features/omnichain-lending-and-borrowing/end-to-end-workflow.md).

# End-to-end workflow

#### Scenario

You have **ETH collateral on HyperEVM** and want to **borrow USDC on Base**.

#### What you do (single flow)

1. In PrimeFi (still on **HyperEVM**), choose:
   * **Borrow asset**: USDC
   * **Destination chain**: Base
   * **Amount**: e.g., 5,000 USDC
   * Optional safety params: **minAmountOut**, **slippage bps**, **deadline**
2. Confirm the transaction on **HyperEVM**.\
   The UI quotes **interest + LayerZero/Stargate fees** before you sign.

#### What happens on-chain

1. **Origin checks (HyperEVM)**
   * LendingPool validates your **health factor**, LTV and caps.
   * Your **variable debt** is minted on HyperEVM for the borrowed amount.
2. **Cross-chain messaging**
   * PrimeFi’s **Borrow OApp** sends a LayerZero message with borrow details.
   * In parallel, a **Stargate** instruction moves 5,000 USDC liquidity to **Base**.
3. **Destination delivery (Base)**
   * Stargate **delivers 5,000 USDC** to your wallet on Base.
   * Your **collateral and debt remain on HyperEVM**.

Result: you now **hold USDC on Base** while your **debt accrues on HyperEVM** against your ETH collateral.

> Tip: You don’t need to switch networks during the borrow. PrimeFi handles the bridge leg via Stargate.


---

# 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.primefi.xyz/product/primefi-features/omnichain-lending-and-borrowing/end-to-end-workflow.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.
