Handling Incoming Messages
After successfully subscribing to the channel, you will start receiving real-time messages. These could be updates about your balance or other information based on the channel you're subscribed to.
UserBalanceChannel
{
"identifier": "{\"channel\":\"UserBalanceChannel\"}",
"message": {
"data": {
"coin": "USDT"
}
}
}
FundTransferChannel
{
"identifier": "{\"channel\":\"FundTransferChannel\"}",
"message": {
"fundTransfer": {
"id": 1,
"coin": "USDT",
"amount": "10.0",
"from": "SPOT",
"to": "REMITANO",
"status": "pending",
"createdTime": 1712632235937,
"updatedTime": 1712632321232
}
}
}
InvestmentChannel
{
"identifier": "{\"channel\":\"InvestmentChannel\"}",
"message": {
"investment": {
"id": 43,
"ref": "IV4185335159",
"itemRef": "IV4185335159",
"symbol": "BTCUSDT",
"symbolRaw": null,
"positionSide": "long",
"riskLevel": "safe",
"initialCapital": "892.56",
"maintenanceCapitalRatio": "0.004",
"currentCapital": "893.89884",
"currentCapitalRatio": "0.333833333333333333333333333333333333",
"currentSymbolPrice": null,
"leverage": 3.0,
"quantity": 4.0,
"size": "2677.68",
"pnl": "-0.001",
"pnlAfterFee": null,
"pnlAfterFeeRatio": "0.0",
"openPrice": "66942",
"closePrice": null,
"bankruptcyPrice": null,
"estimatedLiquidationPrice": null,
"takeProfitRatio": null,
"takeProfitPrice": null,
"takeProfitPnlAfterFee": null,
"stopLossRatio": null,
"stopLossPrice": null,
"stopLossPnlAfterFee": null,
"createdTime": 1731937428191,
"updatedTime": 1731937428949,
"openedTime": null,
"closedTime": null,
"openFee": "-1.33884",
"fundingFee": "0.0001",
"status": "opened",
"statusExplanation": null
}
}
}
You can process or display the message based on the received data.