Asset liquidity
Asset liquidity is the amount of value, denominated in a given asset, that Rafiki has available to handle cross-currency (foreign exchange) transactions between you and your peer. Whenever an outgoing payment/incoming payment is in a different asset than the peering relationship, the liquidity of asset accounts change depending on the FX direction.
You should deposit and withdraw liquidity as necessary, based on your risk tolerance. Rafiki fails any transaction that would cause an asset’s liquidity to fall below zero.
For more information about how Rafiki handles liquidity, see the Accounting concepts page and the low asset liquidity section of the webhook events page.
You can deposit and withdraw asset liquidity through the Rafiki Admin application’s Assets screen.
Manage asset liquidity using the Backend Admin API
Section titled “Manage asset liquidity using the Backend Admin API”mutation DepositAssetLiquidity($input: DepositAssetLiquidityInput!) { depositAssetLiquidity(input: $input) { assetId amount id idempotencyKey success }}
{ "input": { "assetId": "7b8b0f65-896d-4403-b7ba-2e24bf20eb35", "amount": "100", "id": "b97fd85a-126e-42ef-b40d-1a50a70ffa6f", "idempotencyKey": "b97fd85a-126e-42ef-b40d-1a50a70ffa6f", }}
For more information about this mutation’s input object, see DepositAssetLiquidityInput
.
When an asset liquidity deposit is successful, DepositAssetLiquidity
returns true
.
{ data: { success: true }}
mutation CreateAssetLiquidityWithdrawal($input: CreateAssetLiquidityWithdrawalInput!) { createAssetLiquidityWithdrawal(input: $input) { success }}
{ "input": { "id": "b97fd85a-126e-42ef-b40d-1a50a70ffa6f", "assetId": "7b8b0f65-896d-4403-b7ba-2e24bf20eb35", "amount": "100", "idempotencyKey": "b97fd85a-126e-42ef-b40d-1a50a70ffa6f", "timeoutSeconds": 0 }}
For more information about this mutation’s input object, see CreateAssetLiquidityWithdrawalInput
.
When an asset liquidity withdrawal is successful, CreateAssetLiquidityWithdrawal
returns true
.
{ data: { success: true }}