Hive Civilization Basis Perp API

The basis-perp API from Hive Civilization — 12 operation(s) for basis-perp.

Operations 12

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /v1/perp/basis/open Open a basis perpetual position · Open Position #
Ask an LLM
“How do I open a long or short basis perp position with USDC collateral?”
“Can I post USDT instead of USDC as collateral on a new perp position?”
Tell an agent
Open a {side} basis perp of {size_usdc} USDC backed by {collateral_asset}.
Open a new {side} perp position sized {size_usdc} USDC with {collateral_amount} {collateral_asset} collateral for owner {owner_did}.
POST /v1/perp/basis/close Close a basis perpetual position · Close Position Endpoint #
Ask an LLM
“How do I fully close my basis perp position?”
“Can I exit an open perp position entirely in one call?”
Tell an agent destructive · confirm first
Close basis perp position {position_id}.
Fully exit my perp position {position_id}.
POST /v1/perp/basis/increase Add size and collateral to a perp position · Increase Position Endpoint #
Ask an LLM
“How do I scale up an existing basis perp position?”
“Do I have to add collateral when I increase a position's size?”
Tell an agent
Increase position {position_id} by {additional_size_usdc} USDC with {additional_collateral} more collateral.
Add {additional_size_usdc} USDC of size to perp {position_id}, topping up collateral by {additional_collateral}.
POST /v1/perp/basis/decrease Reduce the size of a perp position · Decrease Position Endpoint #
Ask an LLM
“Can I partially reduce a basis perp position without closing it?”
“How do I trim my perp exposure by a set USDC amount?”
Tell an agent
Reduce position {position_id} by {reduce_size_usdc} USDC.
Trim {reduce_size_usdc} USDC off perp {position_id} but keep it open.
POST /v1/perp/basis/liquidate Liquidate a basis perp position · Liquidate Endpoint #
Ask an LLM
“How does an admin force-liquidate an undercollateralized perp position?”
“What credentials are needed to liquidate a basis position?”
Tell an agent destructive · confirm first
Liquidate basis position {position_id}.
Force-liquidate perp {position_id} using admin key {X-Admin-Api-Key}.
POST /v1/perp/basis/funding/tick Apply a funding-rate tick to basis perps · Funding Tick Endpoint #
Ask an LLM
“How is the periodic funding payment applied to open basis positions?”
“Can an operator trigger a funding tick manually?”
Tell an agent
Run a funding tick on the basis perp market.
Apply funding to all basis positions with admin key {X-Admin-Api-Key}.
GET /v1/perp/basis/positions List basis perp positions · List Positions Endpoint #
Ask an LLM
“Which basis perp positions do I currently hold?”
“Can I filter perp positions by owner or by open versus closed status?”
Tell an agent
List basis positions owned by {owner_did}.
Show all perp positions with status {status}.
GET /v1/perp/basis/position/{position_id} Get one basis perp position · Get Position Endpoint #
Ask an LLM
“What are the size, collateral and PnL of one specific perp position?”
“How do I look up a single basis position by its ID?”
Tell an agent
Get the details of basis position {position_id}.
Show me perp position {position_id}.
GET /v1/perp/basis/market View the basis perp market state · Market State Endpoint #
Ask an LLM
“What does the basis perp market look like right now?”
“Where can I see the current mark and funding state of the basis market?”
Tell an agent
Show the current basis perp market state.
Pull the latest snapshot of the basis market.
GET /v1/perp/basis/leaderboard Show the basis perp trader leaderboard · Leaderboard Endpoint #
Ask an LLM
“Who are the top traders on the basis perp market?”
“Can I limit the leaderboard to the top few positions?”
Tell an agent
Show the top {top_n} on the basis perp leaderboard.
Pull the basis perp leaderboard.
GET /v1/perp/basis/gates Check the basis perp trading gates · Gates Endpoint #
Ask an LLM
“Which gates control whether the basis perp market is open for trading?”
“Are any trading gates currently blocking basis perps?”
Tell an agent
Show the status of the basis perp gates.
Check which basis market gates are open or closed.
GET /v1/perp/basis/health Check basis perp service health · Health Endpoint #
Ask an LLM
“Is the basis perp service up?”
“How can I health-check the basis perpetuals endpoint?”
Tell an agent
Check the health of the basis perp service.
Ping the basis perpetuals health endpoint.

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/thehiveryiq-com:thehiveryiq-com-basis-perp-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

thehiveryiq-com-basis-perp-api-openapi.yml Raw ↑
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:
    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
    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
    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
    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
x-provenance:
  method: harvested
  publisher: Hive Civilization
  source: https://receipts.thehiveryiq.com/openapi.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)