Automated Settlements

Do you offer automated settlements?

Yes, we provide the technological infrastructure to automate the settlement process. Our API can provide the necessary data and commands to communicate with your custody providers, both crypto and fiat (if your bank support API integrations)

Would I need to settle every trade?

No, you may have open positions for a minimum of one trading day

How would I use API to settle my open positions?

For example:

  1. Make a request to https://faq.finerymarkets.com/api-reference/rest-api/positions to fetch your current positions

  2. The retrieved table shows what you owe to LP and what the LP owes you

  3. For example, You owe 0.004 BTC, FM-Test-MM owes You 173 USDCP

  4. You settle your side first

  5. You create https://faq.finerymarkets.com/api-reference/rest-api/addoutgoingsettlementtransaction

  6. Insert data from Positions (step 1) there (counterparty ID, currency, size (must exactly match what the LP will receive) and send a request

  7. In response, you receive transactionID, which must be saved for insertion into the following step.

  8. Your custody provider (for example Fireblocks) creates a transfer according to the parameters from paragraph. 6 to the liquidity provider [LP](its wallets do not change and you receive them after completing the onboarding)

  9. After Fireblocks has sent the crypto, it is important to collect the blockchain hash of the transfer

  10. After receiving the crypto hash of the transfer you perform another command: https://faq.finerymarkets.com/api-reference/rest-api/sendoutgoingsettlementtransaction

  11. In this command, you need to insert the hash from the Fireblocks translation into the TXID field and "transactionId" from the response from paragraphs. 7

  12. You create a request for the funds you wish to receive using https://faq.finerymarkets.com/api-reference/rest-api/addincomingsettlementrequest

  13. Either specifying only the currency (The LP will send everything that can be withdrawn) or specifying the currency and the size

  14. You will need to make requests to the https://faq.finerymarkets.com/api-reference/rest-api/settlementtransactions 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 section Incoming settlement transactions

  15. Once the funds have landed in your accounts, you need to make the command https://faq.finerymarkets.com/api-reference/rest-api/commitincomingsettlementtransaction

Last updated