# Auto swaps

The functionality of auto-swap will allow you to draw conclusions to customers in all available coins and networks.

To get started, you need to create a PAY\_OUT address and select it as an address for auto-swaps.\
All transactions will use funds from this address to swap into the final coin and sent to the client.

To create auto-swap, you just need to specify which coin and network you want to receive at the address to send.

For swap, you can specify both the outgoing amount that you want to spend from the address and the final amount that you want to receive.

* If you specify the outgoing amount, the specified amount will be debited from the address, but the final amount may change as a result of the swap
* If you specify the final amount, the calculated amount of the debit +5% will be blocked at the address, which will be adjusted as a result of the swap

## API Interaction Scheme

{% @mermaid/diagram content="sequenceDiagram
Merchant ->> Onchainpay: Creating swap
Onchainpay ->> Merchant: Swap body

```
Note over Onchainpay: Swap coins

Onchainpay -->> Merchant: Swap result webhook" %}
```


---

# 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.onchainpay.io/api-reference/auto-swaps.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.
