> For the complete documentation index, see [llms.txt](https://faq.finerymarkets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faq.finerymarkets.com/product-features/settlements/automated-settlements.md).

# Automated Settlements

### Do you offer automated settlements?

Yes. Finery Markets provides the infrastructure required to automate post-trade settlement. The seamless way to enable automation is by using the[ Fireblocks integration](/product-features/settlements/fireblocks.md), which connects Finery Markets and Fireblocks work environments. It supports auto-commit flow based on Fireblocks’ blockchain-verified transaction statuses.

You may also use any other custody provider. FM’s API can deliver the settlement data and instructions needed to communicate with a third-party custodian, including crypto custodians and banks that support API-based fiat transfers.

### Do I need to settle every trade?

No, you can have open positions for a trading day or more.

### How would I use API to settle my open positions?

*For example:*

1. Make a [Positions](/api-reference/rest-api/deals-and-positions/positions.md) API request to fetch your current positions
2. The retrieved table shows what you owe to LP and what the LP owes you. For example, you owe 0.004 BTC, FM-Test-MM owes you 173 USDCP
3. Settle your side first
4. Then, [add an outgoing transaction](/api-reference/rest-api/settlements/addoutgoingsettlementtransaction.md); insert data from Positions (step 1) there (counterparty ID, currency, size (must exactly match what the LP will receive) and send a request
5. In response, you receive transactionID, which must be saved to be inserted on one of the future steps
6. Your custody provider (for example, Fireblocks) performs a transfer according to the parameters from paragraph 6 to the liquidity provider (LP). Their wallets remain unchanged, and you receive their addresses after completing the onboarding
7. After Fireblocks has sent the crypto, it is important to collect the blockchain hash of the transfer
8. After receiving the crypto hash of the transfer you perform another command: [sendOutgoingSettlementTransaction](/api-reference/rest-api/settlements/sendsettlementtransaction.md)
9. In this command, you need to insert the hash from the Fireblocks transaction into the TXID field and "transactionId" from the response from paragraph 7
10. You create a request for the funds you wish to receive using [addIncomingSettlementRequest](/api-reference/rest-api/settlements/addincomingsettlementrequest.md), either specifying only the currency/asset (The LP will send everything that can be withdrawn) or specifying both the currency and the size
11. You will need to make requests to the [SettlementTransactions](/api-reference/rest-api/settlements/settlementtransactions.md) command. From it, you will see what is sent to you and what needs to be confirmed upon receiving it. It is available in the 'Incoming settlement transactions' section
12. Once the funds have landed in your accounts, you need to execute the [CommitIncomingSettlementTransaction](/api-reference/rest-api/settlements/commitincomingsettlementtransaction.md) command to commit.


---

# 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://faq.finerymarkets.com/product-features/settlements/automated-settlements.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.
