Veli · Capability

Crypto Investment Workflow

Customer workflow capability for crypto investment strategy management. Combines strategy discovery, portfolio creation, automated rebalancing, position tracking, and performance reporting into a unified interface for fintech platforms, crypto exchanges, and robo-advisor applications.

Run with Naftiko CryptoDeFiFinanceInvestmentPortfolio Management

What You Can Do

GET
List strategies — List available crypto investment strategies filtered by category and risk level
/v1/strategies
GET
Get strategy — Get strategy details including allocations and historical performance
/v1/strategies/{strategyId}
GET
List portfolios — List portfolios for a user or filtered by strategy
/v1/portfolios
POST
Create portfolio — Create a new investment portfolio based on a strategy
/v1/portfolios
GET
Get portfolio — Get portfolio details including status and current value
/v1/portfolios/{portfolioId}
DELETE
Close portfolio — Close and liquidate an investment portfolio
/v1/portfolios/{portfolioId}
GET
Get positions — Get current asset positions with quantities and market values
/v1/portfolios/{portfolioId}/positions
POST
Rebalance portfolio — Trigger a rebalance to restore target strategy allocations
/v1/portfolios/{portfolioId}/rebalance
GET
Get performance — Get portfolio performance metrics and returns for a time period
/v1/portfolios/{portfolioId}/performance

MCP Tools

list-strategies

Browse available crypto investment strategies, optionally filtered by category (index, theme, custom) or risk level (low, medium, high)

read-only
get-strategy

Get full details for a specific crypto investment strategy including asset allocations and performance history

read-only
list-portfolios

List investment portfolios for a user or filtered by strategy

read-only
create-portfolio

Create a new crypto investment portfolio for a user based on a chosen strategy and initial investment amount

get-portfolio

Get current portfolio details including status, total value, and strategy information

read-only
get-positions

Get current asset positions in a portfolio with quantities, prices, and market values

read-only
rebalance-portfolio

Trigger a portfolio rebalance to restore target asset allocations defined by the investment strategy

get-performance

Get portfolio performance metrics including returns, gains/losses, and allocation for a time period (1d, 7d, 30d, 90d, 1y, all)

read-only

APIs Used

veli

Capability Spec

Raw ↑
naftiko: "1.0.0-alpha1"

info:
  label: "Crypto Investment Workflow"
  description: >-
    Customer workflow capability for crypto investment strategy management. Combines
    strategy discovery, portfolio creation, automated rebalancing, position tracking,
    and performance reporting into a unified interface for fintech platforms, crypto
    exchanges, and robo-advisor applications.
  tags:
    - Crypto
    - DeFi
    - Finance
    - Investment
    - Portfolio Management
  created: "2026-05-03"
  modified: "2026-05-03"

binds:
  - namespace: env
    keys:
      VELI_API_KEY: VELI_API_KEY

capability:
  consumes:
    - import: veli
      location: ./shared/veli.yaml

  exposes:
    - type: rest
      port: 8080
      namespace: crypto-investment-api
      description: "Unified REST API for crypto investment strategy and portfolio management workflows."
      resources:
        - path: /v1/strategies
          name: strategies
          description: "Browse available crypto investment strategies"
          operations:
            - method: GET
              name: list-strategies
              description: "List available crypto investment strategies filtered by category and risk level"
              call: "veli.list-strategies"
              with:
                category: "rest.category"
                risk: "rest.risk"
                limit: "rest.limit"
                offset: "rest.offset"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/strategies/{strategyId}
          name: strategy
          description: "Get details for a specific investment strategy"
          operations:
            - method: GET
              name: get-strategy
              description: "Get strategy details including allocations and historical performance"
              call: "veli.get-strategy"
              with:
                strategyId: "rest.strategyId"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/portfolios
          name: portfolios
          description: "Manage investment portfolios"
          operations:
            - method: GET
              name: list-portfolios
              description: "List portfolios for a user or filtered by strategy"
              call: "veli.list-portfolios"
              with:
                userId: "rest.userId"
                strategyId: "rest.strategyId"
                limit: "rest.limit"
                offset: "rest.offset"
              outputParameters:
                - type: object
                  mapping: "$."
            - method: POST
              name: create-portfolio
              description: "Create a new investment portfolio based on a strategy"
              call: "veli.create-portfolio"
              with:
                body: "rest.body"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/portfolios/{portfolioId}
          name: portfolio
          description: "Get or close a specific portfolio"
          operations:
            - method: GET
              name: get-portfolio
              description: "Get portfolio details including status and current value"
              call: "veli.get-portfolio"
              with:
                portfolioId: "rest.portfolioId"
              outputParameters:
                - type: object
                  mapping: "$."
            - method: DELETE
              name: close-portfolio
              description: "Close and liquidate an investment portfolio"
              call: "veli.close-portfolio"
              with:
                portfolioId: "rest.portfolioId"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/portfolios/{portfolioId}/positions
          name: positions
          description: "View current asset positions in a portfolio"
          operations:
            - method: GET
              name: get-positions
              description: "Get current asset positions with quantities and market values"
              call: "veli.get-positions"
              with:
                portfolioId: "rest.portfolioId"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/portfolios/{portfolioId}/rebalance
          name: rebalance
          description: "Trigger portfolio rebalancing"
          operations:
            - method: POST
              name: rebalance-portfolio
              description: "Trigger a rebalance to restore target strategy allocations"
              call: "veli.rebalance-portfolio"
              with:
                portfolioId: "rest.portfolioId"
              outputParameters:
                - type: object
                  mapping: "$."

        - path: /v1/portfolios/{portfolioId}/performance
          name: performance
          description: "Get portfolio performance metrics"
          operations:
            - method: GET
              name: get-performance
              description: "Get portfolio performance metrics and returns for a time period"
              call: "veli.get-performance"
              with:
                portfolioId: "rest.portfolioId"
                period: "rest.period"
              outputParameters:
                - type: object
                  mapping: "$."

    - type: mcp
      port: 9090
      namespace: crypto-investment-mcp
      transport: http
      description: "MCP server for AI-assisted crypto investment strategy and portfolio management."
      tools:
        - name: list-strategies
          description: "Browse available crypto investment strategies, optionally filtered by category (index, theme, custom) or risk level (low, medium, high)"
          hints:
            readOnly: true
            openWorld: false
          call: "veli.list-strategies"
          with:
            category: "tools.category"
            risk: "tools.risk"
            limit: "tools.limit"
            offset: "tools.offset"
          outputParameters:
            - type: object
              mapping: "$."

        - name: get-strategy
          description: "Get full details for a specific crypto investment strategy including asset allocations and performance history"
          hints:
            readOnly: true
            openWorld: false
          call: "veli.get-strategy"
          with:
            strategyId: "tools.strategyId"
          outputParameters:
            - type: object
              mapping: "$."

        - name: list-portfolios
          description: "List investment portfolios for a user or filtered by strategy"
          hints:
            readOnly: true
            openWorld: false
          call: "veli.list-portfolios"
          with:
            userId: "tools.userId"
            strategyId: "tools.strategyId"
            limit: "tools.limit"
            offset: "tools.offset"
          outputParameters:
            - type: object
              mapping: "$."

        - name: create-portfolio
          description: "Create a new crypto investment portfolio for a user based on a chosen strategy and initial investment amount"
          hints:
            readOnly: false
            openWorld: false
          call: "veli.create-portfolio"
          with:
            userId: "tools.userId"
            strategyId: "tools.strategyId"
            initialAmount: "tools.initialAmount"
            currency: "tools.currency"
          outputParameters:
            - type: object
              mapping: "$."

        - name: get-portfolio
          description: "Get current portfolio details including status, total value, and strategy information"
          hints:
            readOnly: true
            openWorld: false
          call: "veli.get-portfolio"
          with:
            portfolioId: "tools.portfolioId"
          outputParameters:
            - type: object
              mapping: "$."

        - name: get-positions
          description: "Get current asset positions in a portfolio with quantities, prices, and market values"
          hints:
            readOnly: true
            openWorld: false
          call: "veli.get-positions"
          with:
            portfolioId: "tools.portfolioId"
          outputParameters:
            - type: object
              mapping: "$."

        - name: rebalance-portfolio
          description: "Trigger a portfolio rebalance to restore target asset allocations defined by the investment strategy"
          hints:
            readOnly: false
            openWorld: false
          call: "veli.rebalance-portfolio"
          with:
            portfolioId: "tools.portfolioId"
          outputParameters:
            - type: object
              mapping: "$."

        - name: get-performance
          description: "Get portfolio performance metrics including returns, gains/losses, and allocation for a time period (1d, 7d, 30d, 90d, 1y, all)"
          hints:
            readOnly: true
            openWorld: false
          call: "veli.get-performance"
          with:
            portfolioId: "tools.portfolioId"
            period: "tools.period"
          outputParameters:
            - type: object
              mapping: "$."