### List Markets Response Example Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Example JSON response when listing markets, showing market details, metadata, and pagination information. ```json { "results": [ { "marketId": 2, "address": "0xd490dd635051d609887883d364368b223631653d", "tokenId": 1, "imData": { "name": "Binance BTCUSDT 26 Sep 2025", "symbol": "BINANCE-BTCUSDT-26SEP2025", "isIsolatedOnly": false, "maturity": 1758844800, "tickStep": 2 }, "metadata": { "name": "BTCUSDT", "platformName": "Binance", "maxLeverage": 20, "defaultLeverage": 10, "isWhitelisted": true } }, { "marketId": 3, "address": "0x30c3cf7bfe1c694382c4901aae5c9d679ec8450d", "tokenId": 2, "imData": { "name": "Binance ETHUSDT 26 Sep 2025", "symbol": "BINANCE-ETHUSDT-26SEP2025", "isIsolatedOnly": false, "maturity": 1758844800, "tickStep": 2 }, "metadata": { "name": "ETHUSDT", "platformName": "Binance", "maxLeverage": 20, "defaultLeverage": 10, "isWhitelisted": true } } ], "total": 2, "skip": 0 } ``` -------------------------------- ### Approve Agent cURL Example Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Example request for approving an agent using cURL. ```bash # Approve an agent for transaction execution curl -X POST "https://api.boros.finance/send-txs-bot/v1/agent/approve" \ -H "Content-Type: application/json" \ -d '{"approveAgentCalldata":"0x2b6e83631eca053af93a7afaefcd2133a352f422c3c04903000000000000000000000000000000000000000000000000c11305458070b1cf122c9fc64c33f6c8f85e963900000000000000000000000000000000000000000000000000000002540be4000000000000000000000000000000000000000000000000000000019623040eab00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000004121d777e303c7e27a101f44f9a4d5a8eb416933ffb260db2eb14ec4db9af8a2ec5660ffaf95cc516890d195ea1e0d10a09edd9dad6c6f992d19ceae5d32ada2131b00000000000000000000000000000000000000000000000000000000000000","skipReceipt":false}' ``` -------------------------------- ### Get Market Information Response Schema Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Example JSON response detailing a specific market, including its configuration, metadata, and current trading data. ```json { "marketId": 2, "address": "0xd490dd635051d609887883d364368b223631653d", "tokenId": 1, "imData": { "name": "Binance BTCUSDT 26 Sep 2025", "symbol": "BINANCE-BTCUSDT-26SEP2025", "isIsolatedOnly": false, "maturity": 1758844800, "tickStep": 2, "iTickThresh": 583 }, "config": { "maxOpenOrders": 100, "markRateOracle": "0x0000000000000000000000000000000000000001", "fIndexOracle": "0x86a329b73db9de3a0a80af12ae3d9fb66910f366", "hardOICap": "150000000000000000000", "takerFee": "1000000000000000", "otcFee": "1000000000000000", "liqSettings": { "base": "100000000000000000", "slope": "0", "feeRate": "1000000000000000" }, "kIM": "500000000000000000", "kMM": "250000000000000000", "tThresh": 583, "maxRateDeviationFactorBase1e4": 1000, "closingOrderBoundBase1e4": 100, "loUpperConstBase1e4": 7500, "loUpperSlopeBase1e4": 2500, "loLowerConstBase1e4": 2500, "loLowerSlopeBase1e4": 7500, "status": 1, "useImpliedAsMarkRate": true, "softOICap": 100000000000000000000 }, "extConfig": { "settleFeeRate": "1000000000000000", "paymentPeriod": 28800, "maxUpdateDelay": 300 }, "metadata": { "name": "BTCUSDT", "platformIcon": "https://storage.googleapis.com/pendle-v3/binance.svg", "platformName": "Binance", "maxLeverage": 20, "defaultLeverage": 10, "icon": "https://storage.googleapis.com/pendle-v3/BTCUSDT.svg", "isWhitelisted": true, "fundingRateSymbol": "BTCUSDT", "realtimeFundingRateLink": "https://api.binance.com/api/v1/premiumIndex?symbol=BTCUSDT", "isDevTest": false }, "data": { "volume24h": 31.774597234944626, "notionalOI": 99.75860829556142, "markApr": 0.07004243605986377, "lastTradedApr": 0.07004243605986377, "midApr": 0.07004243605986377, "floatingApr": -0.00877095, "longYieldApr": -1.1252233716215074, "nextSettlementTime": 1755532800, "timeToMaturity": 3340800 }, "state": "Normal" } ``` -------------------------------- ### Install Pendle SDK Boros Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/SDK.docs.md Use yarn to add the SDK to your project. ```bash yarn add @pendle/sdk-boros ``` -------------------------------- ### Get Assets Source: https://context7.com/pendle-finance/sdk-boros-public/llms.txt Retrieve all available assets and their associated token information. ```typescript import { Exchange } from '@pendle/sdk-boros'; const assets = await exchange.getAssets(); console.log('Available assets:', assets.assets); ``` -------------------------------- ### SDK - Get Assets Source: https://context7.com/pendle-finance/sdk-boros-public/llms.txt Retrieve a list of all available assets and their associated token information. ```APIDOC ## Get Assets Retrieve all available assets and their token information. ### Method ```typescript exchange.getAssets ``` ### Parameters This method does not require any parameters. ### Response #### Success Response (200) - **assets** (array) - An array of asset objects, each containing token information. ### Response Example ```json { "assets": [ { "tokenId": 1, "address": "0x...", "symbol": "USDC" } ] } ``` ``` -------------------------------- ### GET /v1/collaterals/summary Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Retrieve comprehensive collateral and position summary for a user. ```APIDOC ## GET /v1/collaterals/summary ### Description Retrieve comprehensive collateral and position summary for a user. ### Method GET ### Endpoint /v1/collaterals/summary ### Parameters #### Query Parameters - **userAddress** (string) - Required - User's wallet address - **accountId** (string) - Required - Account identifier ### Request Example curl -X GET "https://api.boros.finance/core/v1/collaterals/summary?userAddress=0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903&accountId=0" ### Response #### Success Response (200) - **collaterals** (array) - List of collateral and position data #### Response Example { "collaterals": [ { "collateralAddress": "0x70a5cc7c683e7431a7f0a596305b870161fc515d", "isolatedPositions": [], "crossPosition": {}, "totalNetBalance": "10546108643258964025" } ] } ``` -------------------------------- ### REST API - Get Collateral Summary Source: https://context7.com/pendle-finance/sdk-boros-public/llms.txt Retrieve a comprehensive summary of collateral and positions for a user account. ```bash curl -X GET "https://api.boros.finance/core/v1/collaterals/summary?userAddress=0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903&accountId=0" ``` -------------------------------- ### GET /getMarkets Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/SDK.docs.md Retrieves a list of available market data. ```APIDOC ## GET /getMarkets ### Description Retrieves market data with optional filtering and pagination. ### Parameters #### Query Parameters - **skip** (number) - Optional - Number of records to skip - **limit** (number) - Optional - Limit on the number of records - **isWhitelisted** (boolean) - Optional - Filter for whitelisted markets ``` -------------------------------- ### Get Market Chart Data Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Retrieve OHLCV chart data for market analysis. ```bash curl -X GET "https://api.boros.finance/core/v1/markets/chart?marketId=2&timeFrame=1h&startTimestamp=1755500000&endTimestamp=1755510000" ``` -------------------------------- ### Market Trades Response Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Example JSON response structure for market trades. ```json { "results": [ { "size": -0.008675982713510604, "rate": 0.07004243605986377, "txHash": "0x1c642109a1e583e235e8c6f5372de1870bf75f363cf8a2cbdd9486a6c652e839", "blockTimestamp": 1755505047 }, { "size": -0.008667428827907858, "rate": 0.07004243605986377, "txHash": "0x95342be3594c658dc5bb860b2d26e46b16dd3bc4273b68cac8d685fa93b733d9", "blockTimestamp": 1755504687 }, { "size": -1.5, "rate": 0.07004243605986377, "txHash": "0x58852970391d65d83c3cb54409931920bccdb65b217a0a5798eb2aab29ba6afb", "blockTimestamp": 1755504443 } ], "total": 3353, "skip": 0 } ``` -------------------------------- ### Get Market Information Request Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Retrieve detailed information for a specific market by providing its unique market ID in the path. ```bash # Get details for Binance BTCUSDT market curl -X GET "https://api.boros.finance/core/v1/markets/2" ``` -------------------------------- ### Get Tick at Interest Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/SDK.docs.md Estimates the tick price limit for a given interest rate using the `@pendle/boros-offchain-math` package. ```APIDOC ## Get Tick at Interest ### Description Returns the tick price limit for a given interest rate. This function is provided by the `@pendle/boros-offchain-math` package. ### Method N/A (Function Signature) ### Endpoint N/A (Off-chain Math Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Function Signature `estimateTickForRate(rate: FixedX18, step: bigint, roundDown: boolean): bigint` ### Parameters - **rate** (FixedX18) - The interest rate. Use `FixedX18.fromNumber(rate)` to convert. - **step** (bigint) - Tick step from the market's imData (`BigInt(market.imData.tickStep)`). - **roundDown** (boolean) - Whether to round the tick down. ### Example ```typescript import { estimateTickForRate, FixedX18 } from '@pendle/boros-offchain-math'; const interestRate = 0.05; // 5% const tick = estimateTickForRate(FixedX18.fromNumber(interestRate), BigInt(market.imData.tickStep), true); console.log('Tick:', tick); ``` ``` -------------------------------- ### GET /v1/markets/{marketId} Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Retrieve detailed information about a specific market including configuration, metadata, and current data. ```APIDOC ## GET /v1/markets/{marketId} ### Description Retrieve detailed information about a specific market including configuration, metadata, and current data. ### Method GET ### Endpoint /v1/markets/{marketId} ### Parameters #### Path Parameters - **marketId** (integer) - Required - The unique identifier of the market ### Request Example curl -X GET "https://api.boros.finance/core/v1/markets/2" ### Response #### Success Response (200) - **marketId** (integer) - Unique identifier - **address** (string) - Contract address - **imData** (object) - Market data - **config** (object) - Market configuration - **metadata** (object) - Market metadata - **data** (object) - Current market statistics - **state** (string) - Current market state #### Response Example { "marketId": 2, "address": "0xd490dd635051d609887883d364368b223631653d", "imData": { "name": "Binance BTCUSDT 26 Sep 2025" }, "state": "Normal" } ``` -------------------------------- ### Get Markets Source: https://context7.com/pendle-finance/sdk-boros-public/llms.txt Retrieves a list of available markets. Supports filtering by whitelist status and pagination using skip and limit parameters. ```APIDOC ## Get Markets Retrieve available markets with filtering and pagination. ### Method GET (Implied by SDK function call) ### Endpoint /exchange/getMarkets (Implied) ### Parameters #### Query Parameters - **skip** (number) - Optional - Number of markets to skip for pagination. - **limit** (number) - Optional - Maximum number of markets to return. - **isWhitelisted** (boolean) - Optional - Filter to return only whitelisted markets. ### Request Example ```json { "skip": 0, "limit": 10, "isWhitelisted": true } ``` ### Response #### Success Response (200) - **results** (array) - An array of market objects. - **marketId** (number) - The ID of the market. - **name** (string) - The name of the market. - **symbol** (string) - The symbol of the market. - **maturity** (string) - The maturity date of the market (ISO format). - **tickStep** (number) - The tick step for the market. - **maxLeverage** (number) - The maximum leverage for the market. #### Response Example ```json { "results": [ { "marketId": 2, "name": "Example Market", "symbol": "EXM", "maturity": "2024-12-31T00:00:00.000Z", "tickStep": 0.0001, "maxLeverage": 10 } ] } ``` ``` -------------------------------- ### Initialize Exchange Class Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/SDK.docs.md The constructor requires a viem WalletClient, root address, account ID, and RPC URLs. ```typescript constructor(walletClient: WalletClient, root: Address, accountId: number, rpcUrls: string[], agent?: Agent) ``` ```typescript import { createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { Exchange } from 'pendle-sdk-boros'; const account = privateKeyToAccount(PRIVATE_KEY); const walletClient = createWalletClient({ transport: http(RPC_URL), account: account, }); const exchange = new Exchange( walletClient, account.address, 0, // accountId [RPC_URL] ); ``` -------------------------------- ### Initialize Exchange with Viem WalletClient Source: https://context7.com/pendle-finance/sdk-boros-public/llms.txt Initialize the Exchange class with a viem WalletClient, wallet address, account ID, and RPC URLs. Ensure to set the environment to 'production'. ```typescript import { createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { Exchange, setEnv } from '@pendle/sdk-boros'; // Set environment to production setEnv('production'); const PRIVATE_KEY = '0xYourPrivateKey'; const RPC_URL = 'https://your-rpc-endpoint.com'; const account = privateKeyToAccount(PRIVATE_KEY); const walletClient = createWalletClient({ transport: http(RPC_URL), account: account, }); // Initialize Exchange with wallet client, address, account ID, and RPC URLs const exchange = new Exchange( walletClient, account.address, 0, // accountId (0 for cross-margin) [RPC_URL] ); ``` -------------------------------- ### Get Collaterals Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/README.md Retrieves collateral information. ```APIDOC ## GET /getCollaterals ### Description Retrieves collateral information. ### Query Parameters - **userAddress** (string) - Optional - User address - **accountId** (number) - Optional - Account ID ### Request Example { "userAddress": "0xYourWalletAddress", "accountId": 0 } ``` -------------------------------- ### Get Markets Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/README.md Retrieves market data. ```APIDOC ## GET /getMarkets ### Description Retrieves market data. ### Query Parameters - **skip** (number) - Optional - Number of records to skip - **limit** (number) - Optional - Limit on the number of records - **isWhitelisted** (boolean) - Optional - Filter for whitelisted markets ### Request Example { "skip": 0, "limit": 10, "isWhitelisted": true } ``` -------------------------------- ### Manage Account Settings and Gas Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Endpoints for retrieving account configuration and checking gas balances. ```bash curl -X GET "https://api.boros.finance/core/v1/accounts/settings?userAddress=0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903" ``` ```bash curl -X GET "https://api.boros.finance/core/v1/accounts/gas-balance?userAddress=0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903" ``` -------------------------------- ### Simulate Place Order Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Simulate the effects of placing a limit order on a specific market. ```bash curl -X GET "https://api.boros.finance/core/v2/simulations/place-order?marketId=2&side=0&size=1000000000000000000&limitTick=7000&tif=0&slippage=0.05" ``` -------------------------------- ### GET /v1/pnl/positions/active Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Retrieve all active positions for a user account. ```APIDOC ## GET /v1/pnl/positions/active ### Description Retrieve all active positions for a user account. ### Method GET ### Endpoint /v1/pnl/positions/active ### Parameters #### Query Parameters - **userAddress** (string) - Required - User's wallet address - **accountId** (string) - Required - Account identifier (0 for cross-margin) ### Request Example curl -X GET "https://api.boros.finance/core/v1/pnl/positions/active?userAddress=0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903&accountId=0" ``` -------------------------------- ### Get Order Book Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/README.md Retrieves the order book for a market. ```APIDOC ## GET /getOrderBook ### Description Retrieves the order book for a market. ### Query Parameters - **marketId** (number) - Required - ID of the market - **tickSize** (number) - Required - Tick size (0.00001, 0.0001, 0.001, 0.01, or 0.1) ### Request Example { "marketId": 0, "tickSize": 0.001 } ``` -------------------------------- ### Simulate Deposit Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Simulate depositing tokens into a cross-margin account. ```bash curl -X GET "https://api.boros.finance/core/v2/simulations/deposit?userAddress=0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903&tokenId=1&amount=1000000000000000000000&accountId=0&marketId=2" ``` -------------------------------- ### Create Agent and Place Order Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/README.md Complete workflow for creating an agent, approving it, and executing an order. ```typescript import { createWalletClient, http } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { Exchange, Agent, Side, TimeInForce, MarketAccLib } from 'pendle-sdk-boros'; // Setup wallet client const PRIVATE_KEY = '0xYourPrivateKey'; const RPC_URL = 'https://your-rpc-endpoint.com'; const account = privateKeyToAccount(PRIVATE_KEY); const accountId = 0; const walletClient = createWalletClient({ transport: http(RPC_URL), account: account, }); async function placeOrderExample() { const exchange = new Exchange( walletClient, account.address, accountId, [RPC_URL] ); const { agent } = await Agent.create(walletClient); const approvalTx = await exchange.approveAgent(agent); console.log('Agent approved:', approvalTx); const tokenId = 0; const marketId = 0; const marketAcc = MarketAccLib.pack(account.address, accountId, tokenId, marketId) const orderResult = await exchange.placeOrder({ marketAcc: marketAcc, marketId: marketId, side: Side.LONG, size: 100000000000000000000n, // 100 tokens with 18 decimals limitTick: 1000, tif: TimeInForce.GOOD_TIL_CANCELLED, }); console.log('Order placed:', orderResult); return orderResult; } placeOrderExample() .then(result => console.log('Example completed successfully')) .catch(error => console.error('Error in example:', error)); ``` -------------------------------- ### GET /getOrderBook Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/SDK.docs.md Retrieves the order book for a specific market. ```APIDOC ## GET /getOrderBook ### Description Retrieves the order book for a market given its ID and tick size. ### Parameters #### Query Parameters - **marketId** (number) - Required - ID of the market - **tickSize** (number) - Required - Tick size (0.00001, 0.0001, 0.001, 0.01, or 0.1) ``` -------------------------------- ### SDK - Tick and Rate Conversion Utilities Source: https://context7.com/pendle-finance/sdk-boros-public/llms.txt Utilities for converting between interest rates and tick values using the offchain math library. ```APIDOC ## Tick and Rate Conversion Utilities Convert between interest rates and tick values using the offchain math library. ### Functions - **estimateTickForRate**: Converts an interest rate to a tick value. - **getRateAtTick**: Converts a tick value back to an interest rate. ### Parameters - **rate** (number) - The interest rate (e.g., 0.05 for 5%). - **tickStep** (bigint) - The tick step value obtained from market data. - **roundDown** (boolean) - Optional. Whether to round the tick down. ### Request Example ```typescript import { estimateTickForRate, getRateAtTick, FixedX18 } from '@pendle/boros-offchain-math'; const interestRate = 0.05; const tickStep = 2n; const tick = estimateTickForRate( FixedX18.fromNumber(interestRate), tickStep, true // roundDown ); console.log('Tick for 5% rate:', tick); const rate = getRateAtTick(tick, tickStep); console.log('Rate at tick:', rate.toNumber()); ``` ### Response Example ```json { "tick": "some_tick_value", "rate": "0.05" } ``` ``` -------------------------------- ### Configure Agent Session Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Sets up an agent session for automated trading operations. ```json { "userAddress": "0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903", "agentAddress": "0xc11305458070b1cf122C9fc64C33f6c8f85e9639", "sessionConfig": { "expiryTime": 1746432000, "permissions": ["trade", "deposit", "withdraw"] } } ``` ```bash curl -X POST "https://api.boros.finance/core/v1/accounts/set-agent-session" \ -H "Content-Type: application/json" \ -d '{"userAddress":"0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903","agentAddress":"0xc11305458070b1cf122C9fc64C33f6c8f85e9639"}' ``` -------------------------------- ### GET /v4/calldata/remove-liquidity-single-cash-from-amm Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Generate transaction calldata for removing liquidity from the AMM. ```APIDOC ## GET /v4/calldata/remove-liquidity-single-cash-from-amm ### Description Generate transaction calldata for removing liquidity from AMM. ### Method GET ### Endpoint /v4/calldata/remove-liquidity-single-cash-from-amm ### Parameters #### Query Parameters - **payTreasuryAmount** (string) - Optional - Amount to pay treasury as bigint string - **marketId** (string) - Required - Market identifier - **lpToRemove** (string) - Required - LP tokens to remove as bigint string - **minCashOut** (string) - Required - Minimum cash expected as bigint string ### Request Example curl -X GET "https://api.boros.finance/core/v4/calldata/remove-liquidity-single-cash-from-amm?marketId=2&lpToRemove=500000000000000000&minCashOut=480000000000000000" ### Response #### Success Response (200) - **data** (string) - Transaction calldata - **from** (string) - Sender address - **to** (string) - Target contract address - **gas** (string) - Estimated gas limit ``` -------------------------------- ### Simulate Add Liquidity Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Simulate adding liquidity to the AMM with a single cash input. ```bash curl -X GET "https://api.boros.finance/core/v1/simulations/add-liquidity-single-cash?userAddress=0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903&accountId=0&marketId=2&netCashIn=1000000000000000000" ``` -------------------------------- ### GET /v4/calldata/add-liquidity-single-cash-to-amm Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Generate transaction calldata for adding liquidity to the AMM. ```APIDOC ## GET /v4/calldata/add-liquidity-single-cash-to-amm ### Description Generate transaction calldata for adding liquidity to AMM. ### Method GET ### Endpoint /v4/calldata/add-liquidity-single-cash-to-amm ### Parameters #### Query Parameters - **payTreasuryAmount** (string) - Optional - Amount to pay treasury as bigint string - **userAddress** (string) - Required - User's wallet address - **accountId** (string) - Required - Account identifier - **marketId** (string) - Required - Market identifier - **netCashIn** (string) - Required - Net cash input as bigint string - **minLpOut** (string) - Required - Minimum LP tokens expected as bigint string ### Request Example curl -X GET "https://api.boros.finance/core/v4/calldata/add-liquidity-single-cash-to-amm?userAddress=0x1eCa053Af93A7AFaeFCD2133A352f422c3C04903&accountId=0&marketId=2&netCashIn=1000000000000000000&minLpOut=950000000000000000" ### Response #### Success Response (200) - **data** (string) - Transaction calldata - **from** (string) - Sender address - **to** (string) - Target contract address - **gas** (string) - Estimated gas limit #### Response Example { "data": "0x4af92423...", "from": "0x1eca053af93a7afaefcd2133a352f422c3c04903", "to": "0x664370dda3501dfb830cfacf947d4457b38d76fe", "gas": "116207" } ``` -------------------------------- ### REST API - Simulate Place Order Source: https://context7.com/pendle-finance/sdk-boros-public/llms.txt Simulate an order placement to validate parameters before execution. ```bash # Simulate placing a LONG order curl -X GET "https://api.boros.finance/core/v2/simulations/place-order?marketId=2&side=0&size=1000000000000000000&limitTick=7000&tif=0&slippage=0.05" ``` -------------------------------- ### Get PnL Limit Orders Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/README.md Retrieves PnL limit orders. ```APIDOC ## GET /getPnlLimitOrders ### Description Retrieves PnL (Profit and Loss) limit orders. ### Query Parameters - **tokenId** (number) - Required - Token ID - **marketId** (number) - Required - ID of the market - **userAddress** (string) - Optional - User address - **accountId** (number) - Optional - Account ID - **skip** (number) - Optional - Number of records to skip - **limit** (number) - Optional - Limit on the number of records - **isActive** (boolean) - Optional - Filter for active orders - **orderBy** (string) - Optional - Field to order by - **fromContract** (boolean) - Optional - Query directly from contract ### Request Example { "tokenId": 0, "marketId": 0, "skip": 0, "limit": 10, "isActive": true, "orderBy": "pnl" } ``` -------------------------------- ### GET /getPnlLimitOrders Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/SDK.docs.md Retrieves PnL limit orders for a user or account. ```APIDOC ## GET /getPnlLimitOrders ### Description Retrieves PnL (Profit and Loss) limit orders based on token and market IDs. ### Parameters #### Query Parameters - **tokenId** (number) - Required - Token ID - **marketId** (number) - Required - ID of the market - **userAddress** (string) - Optional - User address - **accountId** (number) - Optional - Account ID - **skip** (number) - Optional - Number of records to skip - **limit** (number) - Optional - Limit on the number of records - **isActive** (boolean) - Optional - Filter for active orders - **orderBy** (string) - Optional - Field to order by - **fromContract** (boolean) - Optional - Query directly from contract ``` -------------------------------- ### GET /v1/markets Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Retrieve a list of all available markets with support for filtering and pagination. ```APIDOC ## GET /v1/markets ### Description Retrieve a list of all available markets with filtering and pagination support. ### Method GET ### Endpoint /v1/markets ### Parameters #### Query Parameters - **skip** (integer) - Optional - Number of results to skip (default: 0) - **limit** (integer) - Optional - Maximum number of results (default: 10, max: 100) - **isWhitelisted** (boolean) - Optional - Filter for whitelisted markets (default: true) ### Request Example curl -X GET "https://api.boros.finance/core/v1/markets?skip=0&limit=5&isWhitelisted=true" ### Response #### Success Response (200) - **results** (array) - List of market objects - **total** (integer) - Total number of markets - **skip** (integer) - Number of skipped results #### Response Example { "results": [ { "marketId": 2, "address": "0xd490dd635051d609887883d364368b223631653d", "tokenId": 1, "imData": { "name": "Binance BTCUSDT 26 Sep 2025", "symbol": "BINANCE-BTCUSDT-26SEP2025", "isIsolatedOnly": false, "maturity": 1758844800, "tickStep": 2 }, "metadata": { "name": "BTCUSDT", "platformName": "Binance", "maxLeverage": 20, "defaultLeverage": 10, "isWhitelisted": true } } ], "total": 2, "skip": 0 } ``` -------------------------------- ### Simulate Close Position Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Simulate closing an active market position. ```bash curl -X GET "https://api.boros.finance/core/v2/simulations/close-active-position?marketId=2&side=0&size=1000000000000000000&limitTick=6950&tif=0&slippage=0.05" ``` -------------------------------- ### Place Order Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/SDK.docs.md Places a new order on the exchange with various configuration options. ```APIDOC ## Place Order ### Description Places a new order on the exchange. ### Method N/A (Assumed to be a method on an `exchange` object) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **marketAcc** (string) - Use MarketAccLib to pack. - **marketId** (number) - ID of the market. - **side** (Enum: Side) - Trade side. - **size** (bigint) - Order size as bigint. - **limitTick** (number) - Optional tick price limit. - **slippage** (number) - Optional slippage tolerance. - **tif** (Enum: TimeInForce) - Time-in-force setting enum (GOOD_TIL_CANCELLED = 0, IMMEDIATE_OR_CANCEL = 1, FILL_OR_KILL = 2, ADD_LIQUIDITY_ONLY = 3, SOFT_ADD_LIQUIDITY_ONLY = 4). - **nonces** (Array) - Optional array of nonces. ### Request Example ```typescript import { estimateTickForRate, FixedX18 } from '@pendle/boros-offchain-math'; const limitTick = Number(estimateTickForRate(FixedX18.fromNumber(interestRate), BigInt(market.imData.tickStep), true)); const result = await exchange.placeOrder({ marketAcc: '0xMarketAccHex', marketId: 0, side: Side.LONG, size: 100000000000000000000n, // 100 tokens with 18 decimals limitTick, tif: TimeInForce.GOOD_TIL_CANCELLED, }); ``` ### Response #### Success Response (200) - **executeResponse** (any) - Details of the execution response. - **result** (object) - Contains order and events details. - **order** (any) - Details of the placed order. - **events** (any) - Associated events. #### Response Example ```json { "executeResponse": {}, "result": { "order": {}, "events": [] } } ``` ``` -------------------------------- ### Order Book Response Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Example JSON response structure for order book data. ```json { "long": { "ia": [6950, 6900, 6850], "sz": ["58724227191248872", "58757442160557416", "58776533001426712"] }, "short": { "ia": [7050, 7100, 7150], "sz": ["250306054222955776", "250044477691435296", "249723379463267488"] } } ``` -------------------------------- ### Initialize Socket.IO Connection Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/websocket.md Initializes a Socket.IO connection to the Pendle WebSocket service. Ensure the correct URL and transport methods are used. ```typescript import { io } from 'socket.io-client'; // Initialize the socket connection const socket = io('wss://secrettune.io/pendle-dapp-v3', { path: '/socket.io', reconnectionAttempts: 5, transports: ['websocket'] }); ``` -------------------------------- ### Get Market Trades API Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Retrieve recent trading activity for specific markets. ```APIDOC ## GET /v1/markets/market-trades ### Description Retrieve recent trading activity for specific markets. ### Method GET ### Endpoint /v1/markets/market-trades ### Query Parameters - **marketId** (string) - Required - Market identifier - **skip** (integer) - Optional - Results to skip (default: 0) - **limit** (integer) - Optional - Maximum results (default: 10, max: 100) ### Response #### Success Response (200) - **results** (array) - List of trade objects - **size** (number) - Trade size - **rate** (number) - Trade rate - **txHash** (string) - Transaction hash - **blockTimestamp** (integer) - Block timestamp - **total** (integer) - Total number of trades - **skip** (integer) - Number of results skipped ### Response Example ```json { "results": [ { "size": -0.008675982713510604, "rate": 0.07004243605986377, "txHash": "0x1c642109a1e583e235e8c6f5372de1870bf75f363cf8a2cbdd9486a6c652e839", "blockTimestamp": 1755505047 } ], "total": 3353, "skip": 0 } ``` ``` -------------------------------- ### Place Orders with bulkPlaceOrdersV5 Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/README.md Use this method to place single or bulk orders through a unified interface. Requires specific market and order parameters. ```typescript // Single order requests const results = await exchange.bulkPlaceOrdersV5({ orderRequests: [ { marketAcc: '0xMarketAccHex', marketId: 0, side: Side.LONG, size: 100000000000000000000n, limitTick: 1000, tif: TimeInForce.GOOD_TIL_CANCELLED, }, ], }); // Bulk order request const results = await exchange.bulkPlaceOrdersV5({ orderRequests: [ { cross: true, bulks: [{ marketId: 0, orders: { tif: TimeInForce.GOOD_TIL_CANCELLED, side: Side.LONG, sizes: [1000000000000000000n, 2000000000000000000n], limitTicks: [69, 89], }, cancelData: { ids: [], isAll: false, isStrict: false }, }], }, ], }); ``` -------------------------------- ### Simulate Place Order Source: https://github.com/pendle-finance/sdk-boros-public/blob/main/documentation/API.docs.md Simulates the effects of placing a limit order. ```APIDOC ## GET /v2/simulations/place-order ### Description Simulates the effects of placing a limit order. ### Method GET ### Endpoint /v2/simulations/place-order ### Parameters #### Query Parameters - **marketId** (string) - Required - Market identifier - **side** (string) - Required - Order side (0 = LONG, 1 = SHORT) - **size** (string) - Required - Order size as bigint string - **limitTick** (string) - Required - Price tick (-32768 to 32767 range) - **tif** (string) - Required - Time in force (0 = GTC, 1 = IOC, 2 = FOK, 3 = POST_ONLY) - **slippage** (string) - Optional - Maximum acceptable slippage ### Request Example ```bash # Simulate placing a LONG order on Binance BTCUSDT market curl -X GET "https://api.boros.finance/core/v2/simulations/place-order?marketId=2&side=0&size=1000000000000000000&limitTick=7000&tif=0&slippage=0.05" ``` ``` -------------------------------- ### Get Cumulative PnL Source: https://context7.com/pendle-finance/sdk-boros-public/llms.txt Retrieve the cumulative profit and loss for a specific market account. ```typescript import { Exchange } from '@pendle/sdk-boros'; const cumulativePnl = await exchange.getCumulativePnl({ marketAcc: '0x1eca053af93a7afaefcd2133a352f422c3c04903000001ffffff', marketId: 2, }); console.log('Cumulative PnL:', cumulativePnl); ``` -------------------------------- ### Place Single Limit or Market Order Source: https://context7.com/pendle-finance/sdk-boros-public/llms.txt Use MarketAccLib for account packing when placing a single limit or market order. Ensure market information is retrieved to determine the tick step for rate conversion. ```typescript import { Exchange, Side, TimeInForce, MarketAccLib, PlaceOrderParams } from '@pendle/sdk-boros'; import { estimateTickForRate, FixedX18 } from '@pendle/boros-offchain-math'; // Get market information to determine tick step const markets = await exchange.getMarkets({ isWhitelisted: true }); const market = markets.results.find(m => m.marketId === 2); // BTCUSDT market // Pack market account identifier const marketAcc = MarketAccLib.pack( account.address, // User address 0, // Account ID 1, // Token ID 2 // Market ID ); // Convert interest rate (5%) to tick price const interestRate = 0.05; const limitTick = Number(estimateTickForRate( FixedX18.fromNumber(interestRate), BigInt(market.imData.tickStep), true // roundDown )); // Place a LONG limit order (pay fixed, receive floating) const orderParams: PlaceOrderParams = { marketAcc, marketId: 2, side: Side.LONG, size: BigInt('1000000000000000000'), // 1 token with 18 decimals limitTick, tif: TimeInForce.GOOD_TIL_CANCELLED, }; const { result, executeResponse } = await exchange.placeOrder(orderParams); console.log('Order placed:', { txHash: executeResponse.txHash, orderId: result.order.orderId, side: result.order.side, placedSize: result.order.placedSize, filledSize: result.order.filledSize, }); // Place a market order (FILL_OR_KILL) const marketOrderResult = await exchange.placeOrder({ marketAcc, marketId: 2, side: Side.LONG, size: BigInt('1000000000000000000'), tif: TimeInForce.FILL_OR_KILL, // Must fill completely or cancel }); ```