sap adrena build position package
sap_adrena_build_position_packageBuild a single unsigned transaction that atomically opens a perp position AND sets stop loss AND take profit only after policy, balance, oracle-readiness, and simulation checks pass. If stopLossPriceUsd or takeProfitPriceUsd is omitted, that instruction is skipped. Returns transactionBase64 only when the whole package is safe to approve; otherwise return structured blocked diagnostics and do not call finalize.
SAP MCP execution guidance: Intent: hosted unsigned transaction builder. Pricing: paid builder; estimate first, then pay/build and finalize unsigned transactions locally when returned. Routing: paid hosted call; call sap_estimate_tool_cost first, then use sap_payments_call_paid_tool if the runtime cannot handle x402 natively. Signer boundary: hosted reads/builders never receive keypair bytes; value-moving results must be finalized locally when signing is required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Position side. | |
| owner | Yes | Position owner wallet public key (base58). | |
| leverage | Yes | Leverage multiplier (e.g. 3 = 3x). | |
| priceUsd | No | Optional limit price in USD for the open. Omit for market order. | |
| principalToken | Yes | Asset to trade. | |
| collateralToken | Yes | Collateral token. USDC for shorts, match principal for longs. | |
| collateralAmount | Yes | Collateral amount in human-readable units. | |
| stopLossPriceUsd | No | Optional stop loss trigger price in USD. Omit to skip. | |
| takeProfitPriceUsd | No | Optional take profit trigger price in USD. Omit to skip. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | MCP content blocks returned to the caller. | |
| isError | No | True when the tool result represents an application-level error. |