### Get Strategy Details API (Bash) Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Fetches detailed information for a specific trading strategy using its unique ID. Includes performance metrics, pricing, and metadata. Accessed via a GET request to `/v1/strategies/{strategyId}`. ```bash # Get strategy by ID curl -X GET "https://stratos-markets-api.vercel.app/v1/strategies/strat_abc123" \ -H "Accept: application/json" ``` -------------------------------- ### Get User's Purchased Strategies Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Retrieve a list of all strategies that have been purchased or subscribed to by the authenticated user. ```APIDOC ## GET /v1/strategies/user/purchased ### Description Lists all strategies purchased or subscribed to by the currently authenticated user. ### Method GET ### Endpoint `/v1/strategies/user/purchased` ### Parameters None ### Request Example ```bash curl -X GET "https://stratos-markets-api.vercel.app/v1/strategies/user/purchased" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Accept: application/json" ``` ### Response #### Success Response (200) - A list of strategy objects that the user has purchased or subscribed to. Each object may contain details about the strategy, its performance, pricing, and subscription status. #### Response Example ```json [ { "id": "strat_arb001", "name": "ETH-Base Arbitrage Scanner", "status": "active", "purchasedAt": "2025-11-01T10:00:00Z" }, { "id": "strat_inst123", "name": "ETH DCA Strategy", "status": "subscribed", "subscribedUntil": "2026-12-22T11:30:00Z" } ] ``` ``` -------------------------------- ### Get User Purchased Strategies API Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Retrieve a list of all strategies that have been purchased or subscribed to by the authenticated user. This endpoint requires an authorization token and returns an array of strategy objects. ```bash # Get purchased strategies curl -X GET "https://stratos-markets-api.vercel.app/v1/strategies/user/purchased" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Accept: application/json" ``` -------------------------------- ### Get Strategy Details Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Retrieves detailed information for a specific trading strategy using its unique identifier. Includes comprehensive performance metrics, pricing, and metadata. ```APIDOC ## GET /v1/strategies/{strategyId} ### Description Retrieves detailed information about a specific strategy including performance metrics, pricing, and metadata. ### Method GET ### Endpoint /v1/strategies/{strategyId} ### Parameters #### Path Parameters - **strategyId** (string) - Required - The unique identifier of the strategy to retrieve. ### Request Example ```bash curl -X GET "https://stratos-markets-api.vercel.app/v1/strategies/strat_abc123" \ -H "Accept: application/json" ``` ### Response #### Success Response (200) - **id** (string) - Unique identifier for the strategy. - **name** (string) - Name of the strategy. - **description** (string) - Detailed description of the strategy. - **creator** (string) - Blockchain address of the strategy creator. - **version** (string) - Current version of the strategy. - **performance** (object) - Comprehensive performance metrics. - **roi** (float) - Return on Investment. - **sharpeRatio** (float) - Sharpe Ratio. - **maxDrawdown** (float) - Maximum Drawdown. - **totalTrades** (integer) - Total number of trades executed. - **winRate** (float) - Percentage of winning trades. - **pricing** (object) - Pricing details. - **type** (string) - Pricing model (`subscription`, `streaming`, `flat-fee`). - **amount** (float) - Cost of the strategy. - **currency** (string) - Currency of the cost (e.g., `USDC`). - **tags** (array of strings) - Tags associated with the strategy. - **subscribers** (integer) - Number of subscribers. - **createdAt** (string) - Timestamp when the strategy was created. - **updatedAt** (string) - Timestamp when the strategy was last updated. #### Response Example ```json { "id": "strat_abc123", "name": "DCA Bitcoin Strategy", "description": "Automated dollar-cost averaging for Bitcoin accumulation with customizable intervals", "creator": "0x1234567890abcdef", "version": "1.2.0", "performance": { "roi": 24.5, "sharpeRatio": 1.8, "maxDrawdown": -12.3, "totalTrades": 1247, "winRate": 67.3 }, "pricing": { "type": "subscription", "amount": 100, "currency": "USDC" }, "tags": ["bitcoin", "dca", "low-risk", "long-term"], "subscribers": 342, "createdAt": "2025-01-15T08:30:00Z", "updatedAt": "2025-12-20T14:22:00Z" } ``` ``` -------------------------------- ### Instantiate Strategy Template API Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Create a new strategy by instantiating a template. You need to provide the template ID and the required parameters for the strategy. The response confirms the creation of the strategy with its details. ```bash # Instantiate a template curl -X POST "https://stratos-markets-api.vercel.app/v1/strategies/instantiate/tmpl_dca001" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "parameters": { "token": "ETH", "interval": 24, "amount": 100, "stopLoss": 15 }, "pricing": { "type": "subscription", "amount": 50, "currency": "USDC" } }' # Response (201 Created) { "id": "strat_inst123", "name": "ETH DCA Strategy", "templateId": "tmpl_dca001", "creator": "0xfedcba0987654321", "version": "1.0.0", "parameters": { "token": "ETH", "interval": 24, "amount": 100, "stopLoss": 15 }, "createdAt": "2025-12-22T11:30:00Z" } ``` -------------------------------- ### Instantiate Template Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Create a new strategy instance from a chosen template by providing the necessary parameters. ```APIDOC ## POST /v1/strategies/instantiate/{template_id} ### Description Creates a new strategy based on a specified template ID. ### Method POST ### Endpoint `/v1/strategies/instantiate/{template_id}` ### Parameters #### Path Parameters - **template_id** (string) - Required - The ID of the template to instantiate. #### Query Parameters None #### Request Body - **parameters** (object) - Required - An object containing the parameters for the strategy, matching the template's required fields. - Example fields based on DCA template: `token`, `interval`, `amount`, `stopLoss`. - **pricing** (object) - Required - Pricing details for the strategy instance. - **type** (string) - Type of pricing (e.g., "subscription", "one-time"). - **amount** (number) - The cost amount. - **currency** (string) - The currency of the amount (e.g., "USDC"). ### Request Example ```bash curl -X POST "https://stratos-markets-api.vercel.app/v1/strategies/instantiate/tmpl_dca001" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "parameters": { "token": "ETH", "interval": 24, "amount": 100, "stopLoss": 15 }, "pricing": { "type": "subscription", "amount": 50, "currency": "USDC" } }' ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier of the newly created strategy instance. - **name** (string) - The name of the created strategy. - **templateId** (string) - The ID of the template used. - **creator** (string) - The identifier of the user who created the strategy. - **version** (string) - The version of the strategy. - **parameters** (object) - The parameters used for instantiation. - **createdAt** (string) - The timestamp when the strategy was created. #### Response Example ```json { "id": "strat_inst123", "name": "ETH DCA Strategy", "templateId": "tmpl_dca001", "creator": "0xfedcba0987654321", "version": "1.0.0", "parameters": { "token": "ETH", "interval": 24, "amount": 100, "stopLoss": 15 }, "createdAt": "2025-12-22T11:30:00Z" } ``` ``` -------------------------------- ### List Strategy Templates API Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Retrieve a list of all available strategy templates. These templates can be instantiated with custom parameters to create new strategies. The response includes details such as template ID, name, description, category, required parameters, and usage statistics. ```bash # List all templates curl -X GET "https://stratos-markets-api.vercel.app/v1/templates" \ -H "Accept: application/json" # Response [ { "id": "tmpl_dca001", "name": "Dollar-Cost Averaging Template", "description": "Configurable DCA strategy for any token", "category": "accumulation", "parameters": [ { "name": "token", "type": "string", "required": true, "description": "Token symbol (e.g., BTC, ETH)" }, { "name": "interval", "type": "integer", "required": true, "description": "Purchase interval in hours" }, { "name": "amount", "type": "number", "required": true, "description": "Purchase amount in USDC per interval" }, { "name": "stopLoss", "type": "number", "required": false, "default": null, "description": "Stop loss percentage (e.g., 15 for 15%)" } ], "usageCount": 847, "createdAt": "2025-01-10T00:00:00Z" } ] ``` -------------------------------- ### Create Strategy API (Bash) Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Publishes a new trading strategy to the Stratos marketplace. Allows for custom pricing models like flat-fee, streaming, or subscription. This is achieved via a POST request to the `/v1/strategies` endpoint with strategy details in the request body. ```bash # Create a new strategy curl -X POST "https://stratos-markets-api.vercel.app/v1/strategies" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "name": "ETH Momentum Strategy", "description": "Momentum-based trading strategy for Ethereum", "code": "def execute_trade(market_data):\n if market_data[\"rsi\"] > 70:\n return {\"action\": \"sell\", \"amount\": 0.5}\n elif market_data[\"rsi\"] < 30:\n return {\"action\": \"buy\", \"amount\": 0.5}\n return {\"action\": \"hold\"}", "pricing": { "type": "streaming", "amount": 0.05, "currency": "USDC" }, "tags": ["ethereum", "momentum", "medium-risk"] }' ``` -------------------------------- ### List Strategies API (Bash) Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Retrieves a paginated list of trading strategies from the Stratos marketplace. Supports filtering by performance, popularity, or recency. Requires an API call to the `/v1/strategies` endpoint. ```bash # List all strategies with default pagination curl -X GET "https://stratos-markets-api.vercel.app/v1/strategies?page=1&limit=20&sort=performance" \ -H "Accept: application/json" ``` -------------------------------- ### List Strategy Templates Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Retrieve a list of all available strategy templates that can be used as a basis for creating new strategies. ```APIDOC ## GET /v1/templates ### Description Fetches a list of all available strategy templates. ### Method GET ### Endpoint `/v1/templates` ### Parameters None ### Request Example ```bash curl -X GET "https://stratos-markets-api.vercel.app/v1/templates" \ -H "Accept: application/json" ``` ### Response #### Success Response (200) - An array of strategy template objects. Each object includes: - **id** (string) - The unique identifier of the template. - **name** (string) - The display name of the template. - **description** (string) - A brief description of the template. - **category** (string) - The category the template belongs to. - **parameters** (array) - A list of parameters required or optional for instantiation: - **name** (string) - The name of the parameter. - **type** (string) - The data type of the parameter (e.g., "string", "integer", "number"). - **required** (boolean) - Whether the parameter is mandatory. - **description** (string) - Description of the parameter. - **default** (any) - The default value if not provided (only for optional parameters). - **usageCount** (integer) - Number of times this template has been used. - **createdAt** (string) - The timestamp when the template was created. #### Response Example ```json [ { "id": "tmpl_dca001", "name": "Dollar-Cost Averaging Template", "description": "Configurable DCA strategy for any token", "category": "accumulation", "parameters": [ { "name": "token", "type": "string", "required": true, "description": "Token symbol (e.g., BTC, ETH)" }, { "name": "interval", "type": "integer", "required": true, "description": "Purchase interval in hours" }, { "name": "amount", "type": "number", "required": true, "description": "Purchase amount in USDC per interval" }, { "name": "stopLoss", "type": "number", "required": false, "default": null, "description": "Stop loss percentage (e.g., 15 for 15%)" } ], "usageCount": 847, "createdAt": "2025-01-10T00:00:00Z" } ] ``` ``` -------------------------------- ### Fork Strategy API (Bash) Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Creates a new trading strategy by forking an existing one, enabling code reuse and modification. This feature facilitates composability within the marketplace. It's a POST request to `/v1/strategies/{strategyId}/fork` with modification details. ```bash # Fork an existing strategy curl -X POST "https://stratos-markets-api.vercel.app/v1/strategies/strat_abc123/fork" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "name": "Modified DCA with Stop Loss", "modifications": "Added 15% stop-loss protection and enhanced buy signals" }' ``` -------------------------------- ### Create Strategy Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Publishes a new trading strategy to the marketplace. Allows for custom pricing models such as flat-fee, streaming, or subscription. ```APIDOC ## POST /v1/strategies ### Description Publishes a new trading strategy to the marketplace with custom pricing models (flat-fee, streaming, or subscription). ### Method POST ### Endpoint /v1/strategies ### Parameters #### Request Body - **name** (string) - Required - The name of the strategy. - **description** (string) - Required - A brief description of the strategy. - **code** (string) - Required - The trading logic of the strategy, likely in a Python or similar format. - **pricing** (object) - Required - Pricing details for the strategy. - **type** (string) - Required - Pricing model (`subscription`, `streaming`, `flat-fee`). - **amount** (float) - Required - Cost of the strategy. - **currency** (string) - Required - Currency of the cost (e.g., `USDC`). - **tags** (array of strings) - Optional - Tags associated with the strategy. ### Request Example ```json { "name": "ETH Momentum Strategy", "description": "Momentum-based trading strategy for Ethereum", "code": "def execute_trade(market_data):\n if market_data[\"rsi\"] > 70:\n return {\"action\": \"sell\", \"amount\": 0.5}\n elif market_data[\"rsi\"] < 30:\n return {\"action\": \"buy\", \"amount\": 0.5}\n return {\"action\": \"hold\"}", "pricing": { "type": "streaming", "amount": 0.05, "currency": "USDC" }, "tags": ["ethereum", "momentum", "medium-risk"] } ``` ### Response #### Success Response (201 Created) - **id** (string) - Unique identifier for the newly created strategy. - **name** (string) - Name of the strategy. - **creator** (string) - Blockchain address of the strategy creator. - **version** (string) - Initial version of the strategy (e.g., "1.0.0"). - **createdAt** (string) - Timestamp when the strategy was created. #### Response Example ```json { "id": "strat_xyz789", "name": "ETH Momentum Strategy", "creator": "0x9876543210fedcba", "version": "1.0.0", "createdAt": "2025-12-22T10:45:00Z" } ``` ``` -------------------------------- ### List Strategies Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Retrieves a paginated list of all published trading strategies in the marketplace. Strategies can be optionally sorted by performance, popularity, or recency. ```APIDOC ## GET /v1/strategies ### Description Retrieves a paginated list of all published trading strategies in the marketplace with optional sorting by performance, popularity, or recency. ### Method GET ### Endpoint /v1/strategies ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination. Defaults to 1. - **limit** (integer) - Optional - The number of strategies to return per page. Defaults to 20. - **sort** (string) - Optional - The field to sort strategies by. Options: `performance`, `popularity`, `recency`. Defaults to `performance`. ### Request Example ```bash curl -X GET "https://stratos-markets-api.vercel.app/v1/strategies?page=1&limit=20&sort=performance" \ -H "Accept: application/json" ``` ### Response #### Success Response (200) - **strategies** (array) - An array of strategy objects. - **id** (string) - Unique identifier for the strategy. - **name** (string) - Name of the strategy. - **description** (string) - Description of the strategy. - **creator** (string) - Blockchain address of the strategy creator. - **version** (string) - Current version of the strategy. - **performance** (object) - Performance metrics of the strategy. - **roi** (float) - Return on Investment. - **sharpeRatio** (float) - Sharpe Ratio. - **maxDrawdown** (float) - Maximum Drawdown. - **pricing** (object) - Pricing details for the strategy. - **type** (string) - Pricing model (`subscription`, `streaming`, `flat-fee`). - **amount** (float) - Cost of the strategy. - **currency** (string) - Currency of the cost (e.g., `USDC`). - **tags** (array of strings) - Tags associated with the strategy. - **subscribers** (integer) - Number of subscribers. - **createdAt** (string) - Timestamp when the strategy was created. - **pagination** (object) - Pagination details. - **page** (integer) - Current page number. - **limit** (integer) - Items per page. - **total** (integer) - Total number of strategies. - **pages** (integer) - Total number of pages. #### Response Example ```json { "strategies": [ { "id": "strat_abc123", "name": "DCA Bitcoin Strategy", "description": "Dollar-cost averaging strategy for BTC accumulation", "creator": "0x1234567890abcdef", "version": "1.2.0", "performance": { "roi": 24.5, "sharpeRatio": 1.8, "maxDrawdown": -12.3 }, "pricing": { "type": "subscription", "amount": 100, "currency": "USDC" }, "tags": ["bitcoin", "dca", "low-risk"], "subscribers": 342, "createdAt": "2025-01-15T08:30:00Z" } ], "pagination": { "page": 1, "limit": 20, "total": 156, "pages": 8 } } ``` ``` -------------------------------- ### Next.js API for OpenAPI Documentation (Scalar) Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt A Next.js API route that uses Scalar to serve interactive OpenAPI documentation with custom Stratos theming. It configures Scalar with OpenAPI specification, custom CSS for a brutalist design, and layout options. The API route is accessible at /api/reference. ```typescript import { ApiReference } from '@scalar/nextjs-api-reference'; const config = { content: { openapi: '3.1.0', info: { title: 'Stratos DeFi Strategy Marketplace API', version: '0.2.0', description: 'Decentralized marketplace for DeFi intelligence' }, servers: [ { url: 'https://stratos-markets-api.vercel.app/v1', description: 'Production' } ], // ... OpenAPI specification with paths, components, schemas }, theme: 'none', customCss: ` :root { --scalar-radius: 0px; /* Sharp corners for brutalist design */ } .light-mode { --scalar-background-1: #f2efe9; /* Cream */ --scalar-color-accent: #141414; /* Charcoal */ --scalar-button-1-color: #dcee24; /* Acid Lime */ } .dark-mode { --scalar-background-1: #141414; /* Charcoal */ --scalar-color-accent: #dcee24; /* Acid Lime */ } `, layout: 'modern', darkMode: true, hideModels: false, showSidebar: true, searchHotKey: 'k' }; export const GET = ApiReference(config); // Access at: /api/reference // Features: // - Interactive API playground with request/response examples // - Authentication testing with JWT tokens // - Schema exploration and model definitions // - Code generation in multiple languages // - Dark/light mode toggle with custom Stratos colors ``` -------------------------------- ### Fork Strategy Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Creates a new strategy based on an existing one, facilitating composability and remixing. This is analogous to forking in version control systems like Git. ```APIDOC ## POST /v1/strategies/{strategyId}/fork ### Description Creates a new strategy based on an existing one, enabling composability and remixing (GitHub-style forking for trading strategies). ### Method POST ### Endpoint /v1/strategies/{strategyId}/fork ### Parameters #### Path Parameters - **strategyId** (string) - Required - The unique identifier of the strategy to fork. #### Request Body - **name** (string) - Required - The name for the new forked strategy. - **modifications** (string) - Optional - A description of the modifications made to the original strategy. ### Request Example ```json { "name": "Modified DCA with Stop Loss", "modifications": "Added 15% stop-loss protection and enhanced buy signals" } ``` ### Response #### Success Response (201 Created) - **id** (string) - Unique identifier for the newly forked strategy. - **name** (string) - Name of the forked strategy. - **description** (string) - Description of the forked strategy, potentially including modifications. - **creator** (string) - Blockchain address of the strategy creator (the user forking). - **version** (string) - Initial version of the forked strategy (e.g., "1.0.0"). - **parentStrategyId** (string) - The ID of the strategy that was forked. - **createdAt** (string) - Timestamp when the forked strategy was created. #### Response Example ```json { "id": "strat_fork456", "name": "Modified DCA with Stop Loss", "description": "Forked from DCA Bitcoin Strategy - Added 15% stop-loss protection", "creator": "0xabcdef1234567890", "version": "1.0.0", "parentStrategyId": "strat_abc123", "createdAt": "2025-12-22T11:00:00Z" } ``` ``` -------------------------------- ### Validate Strategy Code with API Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Use this endpoint to perform comprehensive validation checks on your strategy code. It ensures security, performance, and compliance before publishing. The API returns a JSON object indicating validation status, errors, warnings, and performance scores. ```bash # Validate strategy code curl -X POST "https://stratos-markets-api.vercel.app/v1/strategies/strat_xyz789/validate" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" # Response (200 OK) - Validation passed { "valid": true, "errors": [], "warnings": [ "Consider adding rate limiting to API calls", "Strategy execution time exceeds 500ms - optimization recommended" ], "securityScore": 95, "performanceScore": 82 } # Response (200 OK) - Validation failed { "valid": false, "errors": [ "Syntax error on line 45: unexpected token", "Forbidden API call detected: os.system()", "Missing required function: risk_assessment()" ], "warnings": [], "securityScore": 30, "performanceScore": 0 } ``` -------------------------------- ### Advanced Marketplace Search Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Search the marketplace with advanced filters for performance metrics, risk tolerance, pricing, and tags. ```APIDOC ## POST /v1/marketplace/search ### Description Searches the strategy marketplace using various advanced filters. ### Method POST ### Endpoint `/v1/marketplace/search` ### Parameters #### Query Parameters None #### Request Body - **query** (string) - Required - The search query string. - **filters** (object) - Optional - An object containing various filtering criteria: - **minRoi** (number) - Minimum Return on Investment. - **maxDrawdown** (number) - Maximum drawdown percentage. - **tags** (array of strings) - List of tags to filter by. - **priceRange** (object) - Optional - Defines the price range: - **min** (number) - Minimum price. - **max** (number) - Maximum price. - **chains** (array of strings) - List of blockchain chains to filter by. - **minSharpeRatio** (number) - Minimum Sharpe Ratio. - **sort** (string) - Optional - Field to sort the results by (e.g., "performance"). - **page** (integer) - Optional - The page number for pagination (defaults to 1). - **limit** (integer) - Optional - The number of results per page (defaults to 10). ### Request Example ```bash curl -X POST "https://stratos-markets-api.vercel.app/v1/marketplace/search" \ -H "Content-Type: application/json" \ -d '{ "query": "arbitrage ethereum", "filters": { "minRoi": 15.0, "maxDrawdown": -20.0, "tags": ["ethereum", "arbitrage", "low-risk"], "priceRange": { "min": 0, "max": 200 }, "chains": ["ethereum", "base"], "minSharpeRatio": 1.5 }, "sort": "performance", "page": 1, "limit": 10 }' ``` ### Response #### Success Response (200) - **results** (array) - A list of strategies matching the search criteria. - Each strategy object contains fields like `id`, `name`, `description`, `performance` (with `roi`, `sharpeRatio`, `maxDrawdown`), `pricing`, `tags`, `subscribers`, and `relevanceScore`. - **total** (integer) - The total number of strategies found. - **facets** (object) - Aggregated data for filtering, such as `avgRoi`, `avgSharpeRatio`, and `priceDistribution`. #### Response Example ```json { "results": [ { "id": "strat_arb001", "name": "ETH-Base Arbitrage Scanner", "description": "Cross-chain arbitrage opportunities between Ethereum and Base", "performance": { "roi": 32.8, "sharpeRatio": 2.1, "maxDrawdown": -8.5 }, "pricing": { "type": "streaming", "amount": 0.10, "currency": "USDC" }, "tags": ["ethereum", "base", "arbitrage", "low-risk"], "subscribers": 128, "relevanceScore": 0.94 } ], "total": 7, "facets": { "avgRoi": 24.3, "avgSharpeRatio": 1.8, "priceDistribution": { "0-50": 2, "50-100": 3, "100-200": 2 } } } ``` ``` -------------------------------- ### Advanced Marketplace Search API Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Perform advanced searches on the Stratos marketplace using various filters. This endpoint allows you to specify criteria such as minimum ROI, maximum drawdown, tags, price range, supported chains, and Sharpe ratio to find relevant strategies. The response includes strategy details, total results, and facet information. ```bash # Advanced search with filters curl -X POST "https://stratos-markets-api.vercel.app/v1/marketplace/search" \ -H "Content-Type: application/json" \ -d '{ "query": "arbitrage ethereum", "filters": { "minRoi": 15.0, "maxDrawdown": -20.0, "tags": ["ethereum", "arbitrage", "low-risk"], "priceRange": { "min": 0, "max": 200 }, "chains": ["ethereum", "base"], "minSharpeRatio": 1.5 }, "sort": "performance", "page": 1, "limit": 10 }' # Response { "results": [ { "id": "strat_arb001", "name": "ETH-Base Arbitrage Scanner", "description": "Cross-chain arbitrage opportunities between Ethereum and Base", "performance": { "roi": 32.8, "sharpeRatio": 2.1, "maxDrawdown": -8.5 }, "pricing": { "type": "streaming", "amount": 0.10, "currency": "USDC" }, "tags": ["ethereum", "base", "arbitrage", "low-risk"], "subscribers": 128, "relevanceScore": 0.94 } ], "total": 7, "facets": { "avgRoi": 24.3, "avgSharpeRatio": 1.8, "priceDistribution": { "0-50": 2, "50-100": 3, "100-200": 2 } } } ``` -------------------------------- ### Validate Strategy Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt Run comprehensive validation checks on strategy code to ensure security, performance, and compliance before publishing. ```APIDOC ## POST /v1/strategies/{strategy_id}/validate ### Description Validates a specific strategy identified by its ID. ### Method POST ### Endpoint `/v1/strategies/{strategy_id}/validate` ### Parameters #### Path Parameters - **strategy_id** (string) - Required - The unique identifier of the strategy to validate. #### Request Body This endpoint does not require a request body for validation. ### Request Example ```bash curl -X POST "https://stratos-markets-api.vercel.app/v1/strategies/strat_xyz789/validate" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **valid** (boolean) - Indicates if the strategy passed validation. - **errors** (array) - A list of validation errors encountered. - **warnings** (array) - A list of potential issues or recommendations. - **securityScore** (integer) - The security score of the strategy. - **performanceScore** (integer) - The performance score of the strategy. #### Response Example (Validation Passed) ```json { "valid": true, "errors": [], "warnings": [ "Consider adding rate limiting to API calls", "Strategy execution time exceeds 500ms - optimization recommended" ], "securityScore": 95, "performanceScore": 82 } ``` #### Response Example (Validation Failed) ```json { "valid": false, "errors": [ "Syntax error on line 45: unexpected token", "Forbidden API call detected: os.system()", "Missing required function: risk_assessment()" ], "warnings": [], "securityScore": 30, "performanceScore": 0 } ``` ``` -------------------------------- ### Create Interactive Zoomable Diagrams in React Source: https://context7.com/cipher-rc5/stratos-docs/llms.txt The ZoomableDiagram component enhances diagram visualization by offering zoom, pan, drag, and fullscreen capabilities. It is ideal for complex visualizations and supports various interactions like mouse wheel zooming, drag-to-pan, and fullscreen mode activated by a button. It accepts a 'chart' string for diagram definition and optional 'minScale' and 'maxScale' props to control zoom limits. ```tsx import { ZoomableDiagram } from '@/components/zoomable-diagram'; export default function InteractiveDocs() { const complexChart = ` sequenceDiagram participant Creator as Elena (Creator) participant Stratos as Stratos Platform participant Avalanche as Avalanche Data-Chain participant Agent as Agent-007 participant Market as DeFi Market Creator->>Stratos: stratos publish ./strategy.py Stratos->>Stratos: Validate & Wrap in MCP Stratos->>Avalanche: Deploy Liveness Monitor Stratos-->>Creator: Endpoint: api.stratos.markets/elena/arb-v1 Agent->>Stratos: Connect via WebTransport Stratos-->>Agent: 402 Payment Required: 0.05 USDC Agent->>Stratos: Sign Micro-Transaction Stratos->>Avalanche: Log Transaction Stratos-->>Agent: Stream Live Signal Agent->>Market: Execute Trade On-Chain Market-->>Agent: Trade Confirmed Agent->>Avalanche: Log Performance `; return (
Scroll to zoom, drag to pan, click fullscreen for immersive view