# Auto Borrow and Repay

### Auto-Borrow & Auto-Repay

Drake offers two modes for managing liabilities in your cross-margin portfolio:

**Non-Borrow Mode** — You can only trade with assets you currently hold. No borrowing is allowed.

**Auto-Borrow Mode (Default)** — The system automatically borrows assets when needed to maintain positions, providing greater flexibility.

You can only switch modes when you have no open positions or pending orders.

#### Automatic Repayment

Drake automatically manages liabilities to protect your portfolio through three mechanisms:

**Margin-Based Repayment (All Portfolios)**\
When your margin ratio drops below 199%, the system automatically repays liabilities using available assets. It prioritizes using each asset to repay its own liability first, then swaps other assets if needed to restore healthy margin levels.

**Liability Limit Repayment**\
The system monitors total liabilities across the platform. When limits are approached, it automatically repays liabilities by selling collateral assets, starting with those that have higher haircuts (discount ratios).

The repayment process sells assets in this order: USDC → WETH → WBTC, ensuring the most stable assets are preserved when possible.


---

# 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://docs.drake.exchange/trading/margin/cross-margin/auto-borrow-and-repay.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.
