RISE Logo-Light

Testing & Production

Run, test, and deploy your bot

Running and Testing

Start Both Apps

From the root directory:

npm run dev
yarn dev
pnpm dev
bun run dev

This starts:

  • Telegram bot on http://localhost:8008
  • Frontend on http://localhost:3000

Complete Registration

Get Telegram ID

Open your Telegram bot and send /debug. Copy your Telegram ID from the response.

Register Signer

  1. Open http://localhost:3000 in your browser
  2. Click "Connect RISE Wallet" and approve
  3. Paste your Telegram ID
  4. Click "Register Trading Signer"
  5. Sign the permission in RISE Wallet popup
  6. Wait for confirmation (~5-10 seconds)

Test the Bot

Go back to Telegram and try:

  • /balance - Should show 0 USDC
  • /deposit - Should credit 1000 testnet USDC
  • /balance - Should now show 1000 USDC

Place Your First Trade

Send: buy 0.02 BTC

The bot should respond with order confirmation and transaction hash.

A successful trade message should look like this:

RISEx Bot Trade Response


Testing Natural Language

Try these examples:

✅ "check my balance"         → Shows USDC balance
✅ "show positions"           → Lists open perp positions
✅ "buy 0.02 BTC"            → Places market long order
✅ "short 0.01 ETH at 3400"  → Places limit short order
✅ "deposit 500"             → Adds 500 USDC to account
✅ "go long with 1000 USDC"  → Calculates size from USDC amount

The LLM will parse these into structured tool calls and execute them via the RISEx API.


Understanding the Flow

Let's trace what happens when you send "buy 0.02 BTC":

  1. Message Received: Telegram bot receives your text message
  2. Verification: Bot checks if your Telegram ID is linked to a wallet and has a registered signer
  3. LLM Processing: Message is sent to GPT-4o-mini with system prompt and tool definitions
  4. Intent Parsing: LLM returns:
    {
      "tool": "place_order",
      "params": {
        "market": "BTC",
        "side": "long",
        "size": "0.02",
        "orderType": "market"
      }
    }
  5. Key Retrieval: Backend loads your encrypted signer key and decrypts it
  6. Signature Generation: Backend signs an EIP-712 VerifySignature message using the signer key
  7. API Call: Backend calls POST /v1/orders/place with the signature
  8. On-Chain Verification: RISEx smart contract verifies the signature matches the registered signer
  9. Order Execution: RISEx executes the perpetual futures trade
  10. Confirmation: Bot replies with order ID and transaction hash

This entire flow completes in under 5 seconds, providing near-instant trading from natural language commands.


Next Steps

You've built a fully functional AI-powered trading bot! Here are some ideas to extend it:

  • Advanced Orders: Add stop-loss, take-profit, and trailing stops
  • Portfolio Analytics: Track PnL over time with charts
  • Price Alerts: Notify users when markets hit target prices
  • Multi-User Support: Allow multiple users per bot instance
  • Risk Management: Add position sizing calculators and risk limits
  • Market Data: Integrate realtime price feeds and order book data

Resources

Now go build something amazing with RISEx on RISE! 🚀