# Smart Liquidation troubleshooting When you use the Smart Liquidation service, you might encounter an error from the following categories: - Deposit and withdrawal - Trade and liquidation This troubleshooting topic gives you liquidation end status examples and describes errors, their possible causes, and how you can address the errors yourself, if possible. ## End status examples Start troubleshooting by looking at the `status` field of your liquidation. The following three liquidation end statuses exist: [`COMPLETED`](#completed-status), [`PARTIALLY_COMPLETED`](#partiallycompleted-status), and [`FAILED`](#failed-status). ### `COMPLETED` status If your liquidation shows a `COMPLETED` status, the liquidation was successful and you don't need to troubleshoot. **Note:** If the liquidation status is `COMPLETED`, the `total_fiat_executed` field in the `trading_summary` object shows the entire amount of fiat that you requested for liquidation, in the following example `100000.00`. All other fields in the object show `0`. ```json { "id": "4f6b059a-7cbb-43db-b1e1-248c6b59906c", "account_id": "string", "created_at": "2022-05-18T01:41:19.115199Z", "modified_at": "2022-05-18T01:46:52.979566Z", "unique_reference_id": "string", "ripplenet_payment_id": "40a3e42b-2fce-4cfa-9c52-6bf1cedb6c0f", "ripplenet_sender_address": "string", "ripplenet_receiver_address": "string", "destination_amount": 100000.000000000, "destination_currency": "string", "destination_venue": "string", "xrp_deposit_amount": 228760.706350000, "xrp_deposit_venue_id": "string", "estimate_type": "firm", "expires_at": "2022-05-18T02:11:19.114940Z", "status": "COMPLETED", "trade_requests": [ { "id": "ad71fbb8-b39f-4c72-99c7-96647b2bc9cd", "account_id": "string", "created_at": "2022-05-18T01:41:19.462221Z", "modified_at": "2022-05-18T01:41:40.782459Z", "liquidation_id": "string", "sequence_number": 1, "odl_payment_id": "string", "status": "COMPLETED", "destination_amount": 10000, "destination_currency": "string", "destination_venue": "string", "expires_at": "2022-05-18T01:51:19.458793Z", "xrp_deposit_amount": 22876.070635, "trade_executions": [ { "id": "f9b1f1ba-959c-431a-b345-80580f9a5f7c", "account_id": "string", "created_at": "2022-05-18T01:41:40.781757Z", "modified_at": "2022-05-18T01:41:40.781757Z", "trade_request_id": "string", "venue": "string", "venue_id": "string", "amount": 23063.33995, "adjusted_amount": 23063.33995, "proceeds": 10005.00, "adjusted_proceeds": 10000.00, "start_date": "2022-05-18T01:41:31.972Z", "end_date": "2022-05-18T01:41:37.676Z", "incentive_type": "string", "incentive_value": 187.269315, "is_pushed_forward": false, "adjusted_trade_difference": 0 } ] }, { "..." }, { "..." }, ], "execution_strategy": { "maxAmountPerTrade": 10000, "minimumTradeInterval": 30 }, "execution_summary": { "total_xrp": 230438.98138, "total_fiat": 100000.00, "total_slippage": 1678.27503000, "total_sender_fees": 0.00000, "total_receiver_fees": 50.02, "total_trades": 11, "fx_rate": 0.43395436, "incentive_type": "string" }, "trading_summary": { "total_fiat_executed": 100000.00, "total_fiat_in_flight": 0, "total_fiat_non_deliverable": 0, "total_fiat_remaining_deliverable": 0.000000000 } } ``` ### `PARTIALLY_COMPLETED` status If your liquidation shows a `PARTIALLY_COMPLETED` status, the liquidation was only partially successful and you need to troubleshoot. **Note:** - If the liquidation status is `PARTIALLY_COMPLETED`, the `total_fiat` amount field in the `execution_summary` object and the `destination_amount` field of the payment will not match. - The values you see in the `total_fiat_executed`, `total_fiat_non_deliverable`, and `total_fiat_remaining_deliverable` fields of the `trading_summary` object add up to the entire amount of fiat you requested for liquidation, in the following example `85000.00`. To complete the liquidation, manually liquidate the amount of fiat you see in the `total_fiat_non_deliverable`. ```json { "id": "30271b8e-49e2-4a32-99a8-f25d26e09072", "account_id": "string", "created_at": "2022-05-06T14:29:26.962244Z", "modified_at": "2022-05-06T14:38:35.535709Z", "unique_reference_id": "string", "ripplenet_payment_id": "287533b6-c4ab-4e0e-9e13-092bc101f481", "ripplenet_sender_address": "string", "ripplenet_receiver_address": "string", "destination_amount": 85000.000000000, "destination_currency": "string", "destination_venue": "string", "xrp_deposit_amount": 142373.804720000, "xrp_deposit_venue_id": "string", "estimate_type": "firm", "expires_at": "2022-05-06T22:29:26.962038Z", "status": "PARTIALLY_COMPLETED", "trade_requests": [ { "id": "21197b4d-820a-4a6a-87b8-583a280568fb", "account_id": "string", "created_at": "2022-05-06T14:29:27.078594Z", "modified_at": "2022-05-06T14:29:47.620482Z", "liquidation_id": "string", "sequence_number": 1, "odl_payment_id": "string", "status": "COMPLETED", "destination_amount": 10000, "destination_currency": "string", "destination_venue": "string", "expires_at": "2022-05-06T14:39:27.076916Z", "xrp_deposit_amount": 16749.85954632, "trade_executions": [ { "id": "87ef4699-0296-4e38-a88e-b8f1c43a60e9", "account_id": "string", "created_at": "2022-05-06T14:29:47.619963Z", "modified_at": "2022-05-06T14:29:47.619963Z", "trade_request_id": "string", "venue": "string", "venue_id": "string", "amount": 16844.47761, "adjusted_amount": 16844.47761, "proceeds": 10005.00, "adjusted_proceeds": 10000.00, "start_date": "2022-05-06T14:29:37.985Z", "end_date": "2022-05-06T14:29:43.683Z", "incentive_type": "string", "incentive_value": 94.61806368, "is_pushed_forward": false, "adjusted_trade_difference": 0 } ] }, { "..." }, { "..." } ], "execution_strategy": { "maxAmountPerTrade": 10000, "minimumTradeInterval": 30 }, "execution_summary": { "total_xrp": 50582.71146, "total_fiat": 29999.98, "total_slippage": 333.13282104, "total_sender_fees": 0.00000, "total_receiver_fees": 15.02, "total_trades": 3, "fx_rate": 0.59308762, "incentive_type": "string" }, "trading_summary": { "total_fiat_executed": 29999.98, "total_fiat_in_flight": 0, "total_fiat_non_deliverable": 55000.01, "total_fiat_remaining_deliverable": 0.010000000 } } ``` #### Example `PARTIALLY_COMPLETED` unhappy path scenario The following unhappy path scenario outlines how a `PARTIALLY_COMPLETED` liquidation status occurs in SLS. 1. One XRP deposit is made. 2. Multiple XRP withdrawals are made. 3. Multiple EUR deposits are made. 4. The total amount of EUR deposited does not match the EUR amount mentioned in the RPO for liquidation. For example, the RPO shows 100,000 EUR, SLS liquidated 60,000 EUR and 40,000 EUR are pending. 5. If the liquidation status is `PARTIALLY_LIQUIDATED`, your service alerts the reconciliation and Ops teams. 6. During the standard reconciliation, the reconciliation team uses the information from the notification and then manually liquidates the pending 40,000 EUR. ### `FAILED` status If your liquidation shows a `FAILED` status, the liquidation was unsuccessful and you need to troubleshoot. **Note:** The `total_fiat_remaining_deliverable` field of the `trading_summary` object shows the entire amount of fiat that you requested for liquidation, in this example `26000.00`. All other fields in the object show `0`. To troubleshoot and eventually complete the liquidation, refer to [Trade and liquidation errors](#trade-and-liquidation-errors). ```json { "id": "671adf19-dd4a-414d-8d75-d4dfea12ec70", "account_id": "string", "created_at": "2022-05-11T16:24:08.466733Z", "modified_at": "2022-05-11T16:24:08.766995Z", "unique_reference_id": "string", "ripplenet_payment_id": "90149b85-7737-4ef1-b8f5-900cd01b024e", "ripplenet_sender_address": "string", "ripplenet_receiver_address": "string", "destination_amount": 26000.000000000, "destination_currency": "string", "destination_venue": "string", "xrp_deposit_amount": 58798.742470000, "xrp_deposit_venue_id": "string", "estimate_type": "firm", "expires_at": "2022-05-11T16:24:13.466414Z", "status": "FAILED", "execution_strategy": { "maxAmountPerTrade": 10000, "minimumTradeInterval": 30 }, "execution_summary": { "total_xrp": 0, "total_fiat": 0, "total_slippage": 0, "total_sender_fees": 0, "total_receiver_fees": 0, "total_trades": 0, "fx_rate": 0 }, "trading_summary": { "total_fiat_executed": 0, "total_fiat_in_flight": 0, "total_fiat_non_deliverable": 0, "total_fiat_remaining_deliverable": 26000.000000000 } } ``` #### Example `FAILED` unhappy path scenario The following unhappy path scenario outlines how a `FAILED` liquidation status occurs in SLS. 1. One XRP deposit is made. 2. No XRP > EUR trades are completed at the destination exchange. For example, the RPO shows 100,000 EUR, but SLS didn't liquidate 100,000. 3. If the liquidation status is `FAILED`, your service alerts the reconciliation and Ops teams. 4. During the standard reconciliation, the reconciliation team uses the information from the notification and follows the manual liquidation process to get 100,000 EUR. ## Deposit and withdrawal errors The errors listed in the following table are related to deposit and withdrawal. | Error | Possible cause(s) | Remediation | | --- | --- | --- | | The RippleNet payment fails. | XRP was deposited after the payment expired. | The payment failure is addressed through push-forward. The failed payment status is logged in the RippleNet Payment Object (RPO). | | ODL does not register XRP as deposited although the deposit happened. | The exchange responds with an error message. | The falsely not registered XRP deposit is addressed through push-forward. The failed deposit status is logged in the RippleNet Payment Object (RPO). Liquidation is triggered through the Smart Liquidation service. | | Payment failed. | ODL registers XRP withdrawal as failed. | Retry the payment after you receive a payment expiry notification. | ## Trade and liquidation errors The errors listed in the following table are related to trade and liquidation. | Error | Possible cause(s) | Remediation | | --- | --- | --- | | The Smart Liquidation service times out but not enough fiat has been liquidated. | The maximum amount of time that the liquidation can take, that is eight hours, has been reached. | Retry the remaining trades through RippleNet liquidation. **Note:** You should be able to see the status of the failed liquidations. | | A liquidation trade is partially filled. | 1 - The exchange does not have enough liquidity to fill the order. 2 - The order amount that the exchange receives is different from the order amount that ODL is logging for the trade. | Make sure that all orders are filled in whole. | | A liquidation trade fails. | 1 - The exchange is not responsive or out for a period of time 2 - The exchange returns an error or unexpected response on the trade status. 3 - ODL registers the trade as failed or not executed although the trade was successful or executed. 4 - The slippage runs out and there is not enough liquidity to complete the trades | 1 - The liquidation is paused and the trade is moved to the end of the queue. Other trades are attempted only when exchange is responsive. 2 - The liquidation is paused and the trade is moved to the end of the queue. Other trades are attempted. If over-liquidation or under-liquidation occurs, contact your RippleNet liaison. 3 - The liquidation is paused and the trade is moved to the end of the queue. Other trades are attempted. If over-liquidation occurs, contact your RippleNet liaison. 4 - SLS continues to reattempt the trades (as they have not yet been executed) within an 8 hour window until slippage is replenished. Once slippage is replenished, SLS will execute trades. |