Overview
This example covers:- Positions —
GET /v2/wallets/{address}?include=earn - Poll an action —
GET /actions/{id}(INITIAL → PENDING → SUCCESS/FAILED/REFUNDED/EXPIRED) - Webhook — receive
ACTION_UPDATEevents (push) - WebSocket — subscribe to
wss://api.pods.finance/updates(push)
Prerequisites
- Node.js 18+
- Pods API key
- For webhook/WebSocket modes:
npm install express ws
Installation
Environment Variables
Step-by-Step Walkthrough
1. Check Positions
2. Poll an Action
3. Webhook (push alternative)
Configure your customer webhook URL with Pods (or passwebhookURL per quote). Deframe signs
every delivery — verify the signature over the raw body before trusting it, then consume the
{ messageType, data } envelope (this is different from the WebSocket { type, action } shape).
Ack quickly and do heavy work asynchronously.
4. WebSocket (push alternative)
Connect, subscribe to the wallet channel, and handleaction_update events. Re-subscribe on
reconnect.
Running the Example
track-and-positions.js.
Next Steps
Strategy Deposit
Deposit into yield strategies
Ondo Global Markets
Buy/sell tokenized stocks with async orders
Check Positions Guide
Full wallet/position response shape
API Reference
View complete API documentation