WebSocket Events

CLIQI uses Socket.IO for real-time communication. Users receive instant updates about trades, prices, and alerts.

Connection

const socket = io('https://api.cliqi.bot', {
  auth: { token: '<jwt_token>' }
});

On connection, the user is automatically joined to their private room (user:{userId}).


Events

trade:confirmed

Trade successfully confirmed on-chain.

{
  "tradeId": "clx...",
  "txHash": "0x5abc...",
  "tokenSymbol": "DEGEN",
  "chain": "BASE",
  "action": "BUY",
  "amountIn": "0.005",
  "amountOut": "42000",
  "message": "Bought DEGEN for 0.005 ETH",
  "timestamp": "2026-03-01T00:00:05.000Z"
}

trade:failed

Trade execution failed.

trade:rejected

Trade blocked by safety checks before execution.

trade:pending

Trade submitted, awaiting on-chain confirmation.

alert:low_balance

Wallet balance below threshold after a like-to-buy trade. Premium only.

alert:daily_limit

Free user hit their 5 trades/day limit.

When this fires, the system also posts to X tagging the user with an upgrade prompt.

auto-sell:executed

Auto-sell triggered and successfully executed. Premium only.

auto-sell:failed

Auto-sell triggered but execution failed. Premium only.

prices:update

Live token prices pushed every 30 seconds. Includes all tokens in the user's wallet.


Frontend Integration

All trade events include a message field with pre-formatted text for toast notifications:


Event Summary

Event
Premium Only?

trade:confirmed

No

trade:failed

No

trade:rejected

No

trade:pending

No

alert:low_balance

Yes

alert:daily_limit

No

auto-sell:executed

Yes

auto-sell:failed

Yes

prices:update

No

Last updated

Was this helpful?