Liquidity
This walkthrough covers the scenario where you trade directly against Fuze.
Introduction
Once your account is created, you'll be assigned an "Org Id" and a keys to hit our APIs. An "org" in of itself doesn't have balances. Instead it has "users" against whom trades and transfers are recorded. In other words, the ledgers are maintained at a user-level.
Given that the transactions here are directly between the Org and Fuze - the users here are "internal". Think of these users more as sub-accounts. Internal users are essentially sub-accounts by another name.
Creating an Internal user
You can create an internal user by hitting this API: https://dev.fuze.finance/reference/openloopcreateuser
The userType would be "Internal". You can pass any internal identifier as the orgUserId.
You can also have multiple internal users, and you can move funds between internal users as well. This enables flows where you want to manage different trading strategies, different balances for different busienss units etc. To move funds between internal users, you can use this API: https://dev.fuze.finance/reference/openloopcreateinternaltransfer
Funding the account
Once you have the orgUserId created. You basically have a sub-account in place. You can now fund the account in a few ways:
-
Via fiat
-
Get your account details: https://dev.fuze.finance/reference/openloopcreateinternalaccount
-
Whitelist the account from which you'll be sending money: https://dev.fuze.finance/reference/openloopcreateexternalaccount
-
Initiate a deposit: https://dev.fuze.finance/reference/openloopcreateexternaltransfer
(If you're issued a VIBAN - you don't have to initiate a deposit via APIs. Funds are automatically credited)
-
-
Via crypto
- Add a counterparty - only if sending funds from a third party: https://dev.fuze.finance/reference/openloopcreatecounterparty
- Generate your wallet address: https://dev.fuze.finance/reference/openloopcreateinternalwallet
Trades
Now that you have funds in the account, you can place trades. Fuze supports three types of trades - Request for Quotes, Market Order and Limit Orders. All three order types are executed via one end-point: https://dev.fuze.finance/reference/openloopcreateorder
For quote orders, you'd first have to generate a quote, which is then passed in the above Create Order API. To generate a quote, you can use this end-point: https://dev.fuze.finance/reference/openloopcreatequote
Withdrawing Funds
-
Via Fiat
- The initial steps - adding a bank account - is common whether you're depositing or withdrawing funds. You can initiate a withdrawal by hitting this endpoint: https://dev.fuze.finance/reference/openloopcreateexternaltransfer
-
Via Crypto
- You will need to whitelist a wallet address first. You can do so by hitting this endpoint and selecting "WITHDRAWAL WALLET": https://dev.fuze.finance/reference/openloopcreateexternalwallet
Other useful APIs
- Fetch balances for a user(sub-account): https://dev.fuze.finance/reference/openloopgetuserbalance
- Fetch order history for a user(sub-account): https://dev.fuze.finance/reference/openlooplistorders
- Simulate webhooks on preprod: https://dev.fuze.finance/reference/openloopsimulate
Important Pointers
- While supported via API, third-party transfers are subject to jurisdictional limitations. In some jurisdictions, only first-party transfers are permitted. Please be sure to check with Fuze as to what you can do on your account.
- In Sandbox - you can ask a solutions engineer to fund your account by adding funds via the backend. In that way, you can test trades etc. without having to go through the testing of funds transfers - which are complicated to test beyond a point.
- You can take a hybrid approach to your implementation - where certain actions (like funding) are done via our dashboard. And others (like trades) are done via API.
- Trades, counterparty additions, wallet whitelisting etc. are async operations. There are APIs to fetch statuses for all of them, and there are webhook events for them as well: https://dev.fuze.finance/reference/webhooks-2
Updated about 2 hours ago