openapi: 3.2.0 info: title: HiveMorph v0.1 Basis Perp API description: 'Polymorphic agent runtime — single shape (Merchant), single supermodel (W2 MERCHANT). Three gates: NEED + YIELD + CLEAN-MONEY.' version: 0.1.0 tags: - name: basis-perp paths: /v1/perp/basis/open: post: tags: - basis-perp summary: Open Position operationId: open_position_v1_perp_basis_open_post requestBody: content: application/json: schema: $ref: '#/components/schemas/OpenBody' required: true responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Open Position V1 Perp Basis Open Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/perp/basis/close: post: tags: - basis-perp summary: Close Position Endpoint operationId: close_position_endpoint_v1_perp_basis_close_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CloseBody' required: true responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Close Position Endpoint V1 Perp Basis Close Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/perp/basis/increase: post: tags: - basis-perp summary: Increase Position Endpoint operationId: increase_position_endpoint_v1_perp_basis_increase_post requestBody: content: application/json: schema: $ref: '#/components/schemas/IncreaseBody' required: true responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Increase Position Endpoint V1 Perp Basis Increase Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/perp/basis/decrease: post: tags: - basis-perp summary: Decrease Position Endpoint operationId: decrease_position_endpoint_v1_perp_basis_decrease_post requestBody: content: application/json: schema: $ref: '#/components/schemas/DecreaseBody' required: true responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Decrease Position Endpoint V1 Perp Basis Decrease Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/perp/basis/liquidate: post: tags: - basis-perp summary: Liquidate Endpoint operationId: liquidate_endpoint_v1_perp_basis_liquidate_post parameters: - name: X-Admin-Api-Key in: header required: false schema: anyOf: - type: string - type: 'null' title: X-Admin-Api-Key - name: X-Hive-Trust in: header required: false schema: anyOf: - type: string - type: 'null' title: X-Hive-Trust requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/LiquidateBody' responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Liquidate Endpoint V1 Perp Basis Liquidate Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/perp/basis/funding/tick: post: tags: - basis-perp summary: Funding Tick Endpoint operationId: funding_tick_endpoint_v1_perp_basis_funding_tick_post parameters: - name: X-Admin-Api-Key in: header required: false schema: anyOf: - type: string - type: 'null' title: X-Admin-Api-Key - name: X-Hive-Trust in: header required: false schema: anyOf: - type: string - type: 'null' title: X-Hive-Trust responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Funding Tick Endpoint V1 Perp Basis Funding Tick Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/perp/basis/positions: get: tags: - basis-perp summary: List Positions Endpoint operationId: list_positions_endpoint_v1_perp_basis_positions_get parameters: - name: owner_did in: query required: false schema: anyOf: - type: string - type: 'null' title: Owner Did - name: status in: query required: false schema: anyOf: - type: string - type: 'null' title: Status responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response List Positions Endpoint V1 Perp Basis Positions Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/perp/basis/position/{position_id}: get: tags: - basis-perp summary: Get Position Endpoint operationId: get_position_endpoint_v1_perp_basis_position__position_id__get parameters: - name: position_id in: path required: true schema: type: string title: Position Id responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Get Position Endpoint V1 Perp Basis Position Position Id Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/perp/basis/market: get: tags: - basis-perp summary: Market State Endpoint operationId: market_state_endpoint_v1_perp_basis_market_get responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Market State Endpoint V1 Perp Basis Market Get /v1/perp/basis/leaderboard: get: tags: - basis-perp summary: Leaderboard Endpoint operationId: leaderboard_endpoint_v1_perp_basis_leaderboard_get parameters: - name: top_n in: query required: false schema: type: integer maximum: 500 minimum: 1 default: 50 title: Top N responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response Leaderboard Endpoint V1 Perp Basis Leaderboard Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/perp/basis/gates: get: tags: - basis-perp summary: Gates Endpoint operationId: gates_endpoint_v1_perp_basis_gates_get responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Gates Endpoint V1 Perp Basis Gates Get /v1/perp/basis/health: get: tags: - basis-perp summary: Health Endpoint operationId: health_endpoint_v1_perp_basis_health_get responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Health Endpoint V1 Perp Basis Health Get components: schemas: ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError OpenBody: properties: side: type: string title: Side description: long or short size_usdc: type: number exclusiveMinimum: 0.0 title: Size Usdc collateral_asset: type: string title: Collateral Asset description: USDC or USDT collateral_amount: anyOf: - type: number exclusiveMinimum: 0.0 - type: 'null' title: Collateral Amount description: Collateral in collateral_asset units. Defaults to 25% of size_usdc. owner_did: type: string title: Owner Did default: did:hive:caller payout_address: type: string title: Payout Address default: '' rail_settlement_id: anyOf: - type: string - type: 'null' title: Rail Settlement Id type: object required: - side - size_usdc - collateral_asset title: OpenBody CloseBody: properties: position_id: type: string title: Position Id type: object required: - position_id title: CloseBody LiquidateBody: properties: position_id: type: string title: Position Id type: object required: - position_id title: LiquidateBody DecreaseBody: properties: position_id: type: string title: Position Id reduce_size_usdc: type: number exclusiveMinimum: 0.0 title: Reduce Size Usdc type: object required: - position_id - reduce_size_usdc title: DecreaseBody IncreaseBody: properties: position_id: type: string title: Position Id additional_size_usdc: type: number exclusiveMinimum: 0.0 title: Additional Size Usdc additional_collateral: type: number exclusiveMinimum: 0.0 title: Additional Collateral type: object required: - position_id - additional_size_usdc - additional_collateral title: IncreaseBody HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError