Skip to main content

Boros Open API

This guide walks you through integrating with the Boros trading platform via the REST API. For exact request/response schemas and parameter details, see the interactive API docs.

For key concepts and terminology, see the Glossary.

Example Repository: https://github.com/pendle-finance/boros-api-examples


Base URLs​

EnvironmentBase URL
Productionhttps://api.boros.finance
ServicePath PrefixPurpose
Open API/open-api/v1/ (or /v2/)Market data, calldata generation, account queries
Send Txs Bot/send-txs-bot/v2/ or /v3/Submitting signed transactions on-chain
Stop Order/stop-order/v1/ to /v3/Conditional TP/SL order management

API Services​

Open API (Primary)​

The main API for querying data and generating transaction calldata.

Interactive docs: https://api.boros.finance/open-api/docs

Send Txs Bot (Transaction Submission)​

Receives signed calldata from agents and broadcasts transactions on-chain. You never call smart contracts directly β€” the bot submits them on your behalf and charges gas fees from your gas balance.

Interactive docs: https://api.boros.finance/send-txs-bot/docs

Stop Order Service​

Manages conditional stop orders (take-profit / stop-loss). These orders live off-chain and are triggered automatically when the market APR crosses a threshold. See Stop Orders below for details.

Interactive docs: https://api.boros.finance/stop-order/docs


Integration Workflows​

1. First-Time Setup​

Before trading, you need to set up an agent and fund your accounts.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 1. Generate an agent key pair β”‚
β”‚ 2. GET /calldata/approve-agent β†’ calldata β”‚
β”‚ 3. Sign & submit approval tx (from root wallet) β”‚
β”‚ 4. GET /calldata/deposit β†’ calldata β”‚
β”‚ 5. Sign & submit deposit tx (from root wallet) β”‚
β”‚ 6. Top up gas balance for agent tx fees β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Steps 2-5 are "sensitive" actions β€” they require the root wallet signature and are submitted directly to the blockchain, not through the Send Txs Bot. The calldata endpoints return a to address (the Router contract) and the encoded calldata to include in your transaction.

See Agent Trading for the full agent setup guide.

2. Placing a Trade (Agent Flow)​

Once your agent is approved, this is the typical order placement flow:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 1. GET /markets/{marketId} β†’ market info β”‚
β”‚ 2. GET /simulations/place-order β†’ preview trade β”‚
β”‚ 3. POST /calldata/place-orders β†’ calldata[] β”‚
β”‚ 4. Sign each calldata with agent key β”‚
β”‚ 5. POST /send-txs-bot/v3/agent/bulk-direct-call β†’ tx hash β”‚
β”‚ 6. Subscribe to WebSocket account channel for fill updates β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Step 2 (simulation) is optional but recommended β€” it previews the margin impact, estimated fees, and validates constraints before generating calldata.

Step 3 returns an array of calldata objects. When autoExitMarket is enabled (default), the response may contain 1 or 2 calldatas: an optional exit-market calldata followed by the place-order calldata. You must submit all calldatas, not just the first one.

Step 5 sends the signed calldata(s) to the Send Txs Bot. Use bulk-direct-call when you have multiple calldatas (e.g., exit-market + place-order). Use direct-call only when you have exactly one calldata. The response includes a transaction status and hash.

skipReceipt parameter

When submitting via the Send Txs Bot, you can set skipReceipt=true to get the txHash returned immediately without waiting for block inclusion. With skipReceipt=false (default), the bot waits for the transaction to be included in a block and returns the full status and any error message. Use skipReceipt=true for lower latency when you can track the transaction status yourself.

3. Closing a Position​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 1. POST /accounts/market-acc-infos β†’ current position β”‚
β”‚ 2. GET /simulations/close-active-position β†’ preview close β”‚
β”‚ 3. POST /calldata/place-orders β†’ counter-order β”‚
β”‚ 4. Sign & submit via Send Txs Bot β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Closing a position internally creates a counter-order (opposite side, same size). The simulation endpoint handles this logic for you.

4. Withdrawing Funds​

Withdrawals follow a request β†’ cooldown β†’ finalize pattern:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 1. GET /calldata/withdraw-request β†’ request calldata β”‚
β”‚ 2. Sign & submit withdrawal request (root wallet) β”‚
β”‚ 3. Wait for cooldown period β”‚
β”‚ 4. Finalize withdrawal on MarketHub contract β”‚
β”‚ β”‚
β”‚ To cancel: GET /calldata/withdraw-cancel β†’ cancel calldata β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Withdrawal requests and cancellations are sensitive actions signed by the root wallet.

5. Setting Up Stop Orders (TP/SL)​

Stop orders are conditional orders that execute automatically when the market APR hits your target:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 1. GET /stop-order/v1/orders/tpsl/prepare β†’ order params β”‚
β”‚ 2. POST /stop-order/v2/orders/place β†’ place order β”‚
β”‚ β”‚
β”‚ To cancel: DELETE /stop-order/v3/orders/cancel β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The prepare endpoint generates the order parameters (including the calldata that will be executed when triggered). The place endpoint submits the signed conditional order. See Stop Orders for details.


Sensitive vs Non-Sensitive Actions​

Understanding this distinction is critical for integration:

TypeSigned bySubmitted viaExamples
SensitiveRoot walletDirect to blockchainDeposit, withdraw, approve/revoke agent
Non-sensitiveAgent keySend Txs BotPlace orders, cancel orders, cash transfer, enter/exit markets

Sensitive actions require the root wallet's private key and are submitted as regular Ethereum transactions. Non-sensitive actions are signed by the agent and submitted through the Send Txs Bot service, which handles gas and on-chain submission.


Endpoint Categories​

Assets​

Query available collateral tokens with metadata and current prices.

EndpointDescription
GET /assets/allList all supported collateral assets

Markets​

Query market configurations, order books, and trade history.

EndpointDescription
GET /marketsList all markets with current state and pricing
GET /markets/{marketId}Get a single market's details
GET /markets/order-booksAggregated order book by tick size
GET /v2/markets/order-booksOrder book with optional AMM liquidity
GET /markets/market-tradesRecent executed trades
GET /markets/chartOHLCV candlestick data

Accounts​

Query and manage user account state.

EndpointDescription
POST /accounts/market-acc-infosPositions, margins, balances for market accounts
GET /accounts/entered-marketsMarkets entered by a cross-margin account
GET /accounts/limit-ordersActive/inactive limit orders
GET /accounts/transactionsTrade history for your account on a market (includes both maker and taker fills, with size, rate, PnL, and maker/taker indicator). Supports skip, limit, and total for pagination.
GET /accounts/settlementsFunding rate settlement history
GET /accounts/transfer-logsDeposit/withdrawal transfer logs
GET /accounts/gas-balanceCurrent gas balance
GET /accounts/gas-consumption-historyGas usage history
GET /accounts/settingsUser account settings
POST /accounts/settingsUpdate settings (agent-signed)

Calldata Generation​

Generate transaction calldata for on-chain operations.

Sensitive (root-signed, direct to chain):

EndpointDescription
GET /calldata/depositDeposit collateral to margin account
GET /calldata/withdraw-requestRequest withdrawal
GET /calldata/withdraw-cancelCancel pending withdrawal
GET /calldata/approve-agentApprove an agent
GET /calldata/revoke-agentRevoke an agent
GET /calldata/vault-pay-treasuryPay treasury from vault

Non-sensitive (agent-signed, via Send Txs Bot):

EndpointDescription
POST /calldata/place-ordersPlace one or more limit orders
GET /calldata/cancel-orderCancel orders
GET /calldata/cash-transferTransfer between cross and isolated accounts
GET /calldata/enter-exit-marketsEnter or exit markets
GET /calldata/pay-treasuryPay accrued treasury fees
GET /calldata/add-liquidity-single-cash-to-ammAdd AMM liquidity
GET /calldata/remove-liquidity-single-cash-from-ammRemove AMM liquidity

Simulations​

Preview operations before executing them. All simulation endpoints return the projected account state after the operation.

EndpointDescription
GET /simulations/depositPreview deposit effect on account
GET /simulations/withdrawPreview withdrawal effect on account
GET /simulations/cash-transferPreview cross ↔ isolated transfer
GET /simulations/place-orderPreview order placement with fees
GET /simulations/close-active-positionPreview closing a position
GET /simulations/add-liquidity-single-cashPreview adding AMM liquidity
GET /simulations/remove-liquidity-single-cashPreview removing AMM liquidity

Funding Rate​

Access funding rate data and settlement history.

EndpointDescription
GET /funding-rate/all-funding-rate-symbolsAvailable funding rate symbols
POST /funding-rate/settlement-summaryHistorical settlement summaries

Agents​

Manage agent authorization.

EndpointDescription
GET /agents/expiry-timeCheck agent expiry time

Events​

Query protocol events.

EndpointDescription
GET /events/liquidation-eventsLiquidation event history

Charts​

Charting data for trading UIs.

EndpointDescription
GET /charts/ohlcvOHLCV candlestick data

Error Handling​

The Open API returns errors in a structured format:

{
"errorCode": "INVALID_MARKET_ID",
"message": "Market with ID 999 not found",
"data": {}
}

The errorCode field is a machine-readable string you can use for programmatic error handling. Common error codes include validation errors (invalid parameters), state errors (insufficient margin), and not-found errors.

The Send Txs Bot and Stop Order services use the legacy format:

{
"statusCode": 400,
"message": "Invalid signature"
}

See Best Practices for error handling recommendations.


Rate Limiting​

The API does not currently enforce strict rate limits, but excessive request rates may be throttled. Recommendations:

  • Use WebSocket for real-time data instead of polling
  • Use bulk order endpoints instead of multiple single-order calls
  • Cache market and asset data that doesn't change frequently

Code Examples​

For complete working examples covering the full integration lifecycle, see:

https://github.com/pendle-finance/boros-api-examples

Key examples:

  • 01-agent.ts β€” Agent setup and approval
  • 02-deposit.ts to 04-withdraw.ts β€” Fund management
  • 05-place-order.ts to 08-cancel-order.ts β€” Order lifecycle
  • 11-bulk-place-orders.ts β€” Bulk order placement
  • 12-top-up-gas-account.ts β€” Gas management
  • 13-top-up-isolated-account.ts β€” Isolated margin funding