Ondo-<TICKER>-bsc), but you can fund a buy
from — or receive a sell payout on — another EVM chain; Pods handles the bridge.
Settlement is asynchronous. The on-chain transaction submits the request in seconds; the order
reaches
SUCCESS only after Ondo fills it (minutes later). Track it via GET /actions/{id}.Overview
This example covers:- Market status —
GET /ondo/stocks/market-status - Buy (
action=request-lend) — fund cross-chain from Base USDC - Sell (
action=request-withdraw) — redeem shares, receive USDC cross-chain - Async order tracking —
GET /actions/{id} - Optional limit / expiry —
priceInUsd(USD cents) andexpireAt(Unix seconds) on Ondo BSC bytecode; cancel viaGET /actions/{id}/cancel?wallet=
Prerequisites
- Node.js 18+
- Pods API key
- Wallet with USDC to buy (or an open Ondo position to sell)
Installation
Environment Variables
Step-by-Step Walkthrough
1. Check Market Status
2. Buy (request-lend) — cross-chain funding
Fund the BSC position from Base USDC.amount is in the fromTokenAddress token’s base units
(6 decimals for Base USDC; 18 for BSC USDC). The response returns origin-chain bytecode legs and
an Action id.
validTo, add priceInUsd and expireAt. They are
independent and only work on Ondo BSC. See limit price, expiry, and cancel.
3. Sell (request-withdraw) — cross-chain payout
Redeem market shares and receive USDC on Base.amountInShares is the share amount (18 decimals).
4. Execute the request (atomic batch on the origin chain)
5. Track the async order fill
The on-chain tx only submits the request. Poll the Actionid until the order reaches a terminal
state. For cross-chain, the bridge leg settles first, then the order.
priceInUsd set) can be cancelled after funding:
Running the Example
Download both files into the same folder to run this example:
ondo.js and the shared EIP-7702 batch helper
eip7702-batch.js that it imports.ondo.js.
Next Steps
Ondo Global Markets Guide
Full buy/sell, cross-chain, and accounting details
Track & Positions
Read positions and track actions
Cross-Chain Swap
Bridge tokens across chains
API Reference
View complete API documentation