> For the complete documentation index, see [llms.txt](https://docs.creditcoop.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.creditcoop.xyz/core-concepts/secured-line-of-credit/secured-line-of-credit/creating-a-secured-line-of-credit.md).

# Deploying a Secured Line of Credit

{% hint style="info" %}
Much of what follows is pre-configured and/or automated for users of the App. Lines, Escrows and Spigots are deployed from Credit Coop factory contracts and initialized atomically.
{% endhint %}

A Secured Line of Credit is deployed from the LineFactory together with its supporting modules: an **Escrow** (asset collateral), a **Spigot** (cash-flow collateral), and the **Credit Position Token** contract that will represent lender positions.

<details>

<summary>Deployment parameters of the Secured Line of Credit</summary>

Set at deployment:

* The **Borrower** address
* The **Admin** address — the neutral third party that mediates between Borrower and Lenders (see [Roles & Permissions](/core-concepts/secured-line-of-credit/secured-line-of-credit/roles-and-permissions.md))
* Whether **recovery functionality** is enabled — this determines whether the emergency ABORTED state and admin recovery of funds are ever possible on this facility (see [Credit Events](/core-concepts/secured-line-of-credit/secured-line-of-credit/loan-impairment-and-lender-recourse.md))
* The facility **fee schedule** (origination, servicing, swap) — set and later amendable only by mutual consent of Admin and Borrower
* The **minimum collateral ratio** for the attached Escrow

Note that repayment deadlines are **not** a facility-level parameter: each individual Credit Position carries its own deadline, agreed between Borrower and Lender when the position is created.

</details>

<details>

<summary>Cash-Flow / Revenue-Based Security</summary>

A Spigot is deployed alongside the Line. To attach a Borrower cash-flow source (a "Revenue Contract" — any smart contract owned by the Borrower that receives payment flows), the parties configure:

* The address of the Borrower **Revenue Contract**
* The **owner split** — the percentage of tokens from that contract (0–100%) escrowed for the Line, with the remainder flowing to the Borrower via the Operator role
* The **claim function** the Spigot calls to pull tokens, and the **transfer-ownership function** used to return control of the contract to the Borrower when the facility is repaid
* The **whitelisted functions** the Operator may still call on the Revenue Contract for business-as-usual operations while the Spigot is attached
* The **Operator** address, through which the Borrower operates its Revenue Contracts and receives its share of revenue

One Spigot can attach to multiple Revenue Contracts, and can also serve third-party beneficiaries in addition to the Line — see [The Spigot](/core-concepts/the-spigot.md).

</details>

<details>

<summary>Asset Collateral</summary>

If asset collateral is posted, the parties agree:

* The collateral token(s) — each must be enabled on the Escrow by the Admin before it counts toward the Collateral Ratio (once enabled, a token cannot be disabled)
* For Uniswap V3 positions: the token pair and fee tier must be enabled by the Admin
* The **minimum collateral ratio** to be maintained

</details>

<details>

<summary>Activation</summary>

The Line starts in UNINITIALIZED status. Once its modules are verified as correctly configured (Spigot and Escrow ownership, etc.), initialization moves the Line to ACTIVE and Credit Positions can be created.

</details>


---

# 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.creditcoop.xyz/core-concepts/secured-line-of-credit/secured-line-of-credit/creating-a-secured-line-of-credit.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.
