> For the complete documentation index, see [llms.txt](https://docs.lightning.engineering/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lightning.engineering/lightning-network-tools/loop.md).

# Loop

The guide to Lightning Loop

[Lightning Loop](https://lightning.engineering/posts/2020-02-05-loop-beta/) is a service that allows users to make a Lightning transaction to an onchain Bitcoin address (Loop Out), or send on-chain Bitcoin directly into a Lightning channel (Loop In). Loop can help manage channel liquidity, for example, by emptying out a channel and [acquiring inbound capacity](/the-lightning-network/liquidity/how-to-get-inbound-capacity-on-the-lightning-network.md) (or refilling a depleted channel).

Lightning Loop uses submarine swaps to transact non-custodially, meaning that Loop is trustless. Loop Out transactions are batched to save on transaction fees.

Loop uses [L402s](/the-lightning-network/l402/l402.md) for authentication.

{% content-ref url="/pages/-MdQmlMeL52UXRy8DQ7G" %}
[Get Started](/lightning-network-tools/loop/get-started.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MdQng4ie9\_aCJTcRhjH" %}
[The Loop CLI](/lightning-network-tools/loop/the-loop-cli.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MVqm3k55X9JBo897t4F" %}
[Autoloop](/lightning-network-tools/loop/autoloop.md)
{% endcontent-ref %}

{% content-ref url="/pages/VFyeg7YaWX4NPRgBreAU" %}
[Static Loop In Addresses](/lightning-network-tools/loop/static-loop-in-addresses.md)
{% endcontent-ref %}

{% content-ref url="/pages/280rxpospNMmp2L6TTHi" %}
[Instant Loop Outs](/lightning-network-tools/loop/instant-loop-outs.md)
{% endcontent-ref %}

{% content-ref url="/pages/JQN3L6RH0M3bFluqvlLl" %}
[Peer with Loop](/lightning-network-tools/loop/peer-with-loop.md)
{% endcontent-ref %}

{% embed url="<https://lightning.engineering/api-docs/api/loop/>" %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lightning.engineering/lightning-network-tools/loop.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
