> For the complete documentation index, see [llms.txt](https://docs-enterprise.isle.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-enterprise.isle.finance/contract-documentation/diagrams.md).

# Diagrams

## Contract Architecture

Architecture of all smart contracts

<figure><img src="/files/yG6qaPMkgeYneZbfr2In" alt=""><figcaption></figcaption></figure>

## Scenarios

A collection of scenarios to help you understand how Isle Finance works from end to end

### Borrowing

#### Seller mints receivables NFT

```mermaid
flowchart LR;
  S((Seller))
  R[Receivables]
  S -- "mintReceivable" --> R
  R -- "transferReceivable" --> S
```

#### Buyer requests for a loan to be created for the receivable

```mermaid
flowchart LR;
  B((Buyer))
  LM[LoanManager]
  B -- "requestLoan" --> LM
```

#### Pool Admin funds loan

```mermaid
flowchart LR;
  PM((PoolAdmin))
  PC[PoolConfigurator]
  LM[LoanManager]
  P[Pool]
  PM -- "fundLoan" --> LM
  LM -- "requestFunds" --> PC
  PC -- "transferFrom" --> P
  P -- "transferFunds" --> LM
```

#### Seller withdraws funds by submitting the invoice

```mermaid
flowchart LR
  S((Seller))
  LM((LoanManager))
  S -- "withdrawFunds" --> LM
  S -- "transferReceivables" --> LM
  LM -- "transferFunds" --> S

```

#### Buyer repays loan

```mermaid
flowchart LR
  B((Buyer))
  LM[LoanManager]
  TV[Treasury Vault]
  PA((Pool Admin))
  P[Pool]
  B -- "repayLoan" --> LM
  B -- "transferFunds" --> LM
  LM -- "transferFunds" --> PA
  LM -- "transferFunds" --> P
  LM -- "transferFunds" --> TV
```

### Lending

#### Lender deposits funds

```mermaid
flowchart LR
  LP((Lender))
  P[Pool]
  LP -- "deposit" --> P
  LP -- "transferFunds" --> P
  P -- "transferShares" --> LP
```

#### Lender requests redemption

```mermaid
flowchart LR
  LP((Lender))
  P[Pool]
  PC[PoolConfigurator]
  WM[WithdrawalManager]
  LP -- "requestRedeem" --> P
  P -- "requestRedeem" --> PC
  PC -- "addShares" --> WM
  LP -- "transferShares" --> WM
```

#### Lender redeems funds

```mermaid
flowchart LR
  LP((Lender))
  P[Pool]
  PC[PoolConfigurator]
  WM[WithdrawalManager]
  LP -- "redeem" --> P
  P -- "processRedeem" --> PC
  PC -- "processExit" --> WM
  P -- "transferFunds" --> LP
```

#### Lender remove redemption request

```mermaid
flowchart LR
  LP((Lender))
  P[Pool]
  PC[PoolConfigurator]
  WM[WithdrawalManager]
  LP -- "removeShares" --> P
  P -- "removeShares" --> PC
  PC -- "removeShares" --> WM
  WM -- "transferShares" --> LP
```

### Pool Configuration

{% hint style="info" %}
There could be multiple sellers, but only a single buyer for a pool.
{% endhint %}

```mermaid
flowchart LR;
  PA((Pool Admin))
  PC[Pool Configurator]
  PA -- "setBuyer" --> PC
  PA -- "setValidSeller" --> PC
  PA -- "setValidLender" --> PC
  PA -- "setOpenToPublic" --> PC
  PA -- "setAdminFee" --> PC

```

```mermaid
flowchart LR
  GV((Governor))
  PC[Pool Configurator]
  GV -- "setPoolLimit" --> PC
  GV -- "setMaxCoverLiquidation" --> PC
  GV -- "setMinCover" --> PC
```


---

# 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-enterprise.isle.finance/contract-documentation/diagrams.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.
