The finance developer workbenchSearch the reference Development · 0.1.4 · unpublished

research / wire operation

Rank a universe

totalfinance.research.rank

Rank a point-in-time universe by one declared numeric field with an explicit tie policy (competition, dense, ordinal) and missing-value policy. The result is rankUniverse(...) verbatim.

Pack / profilesresearch / full, research
Default discoveryOpt-in
Required capabilitiesNone
Effects / authorizationnone / none
Cost / cancellationmedium / Do not assume inline interruption
Handle-eligible inputsNone
Idempotencynot-applicable
Input schema
{
  "type": "object",
  "properties": {
    "universeId": {
      "type": "string",
      "minLength": 1
    },
    "asOf": {
      "type": "number",
      "description": "Epoch ms; the latest observation at or before it is used per instrument"
    },
    "observations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "instrumentId": {
            "type": "string",
            "minLength": 1
          },
          "availableTimestampMs": {
            "type": "number"
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Declared fields only; null is a stated missing value"
          }
        },
        "additionalProperties": false,
        "required": [
          "instrumentId",
          "availableTimestampMs",
          "fields"
        ]
      }
    },
    "fieldDefinitions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fieldName": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "numeric",
              "category",
              "text",
              "boolean"
            ]
          },
          "unit": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "fieldName",
          "kind"
        ]
      },
      "minItems": 1
    },
    "rankBy": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string"
        },
        "direction": {
          "type": "string",
          "enum": [
            "ascending",
            "descending"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "field",
        "direction"
      ]
    },
    "tiePolicy": {
      "type": "string",
      "enum": [
        "competition",
        "dense",
        "ordinal"
      ]
    },
    "missingValuePolicy": {
      "type": "string",
      "enum": [
        "exclude",
        "evaluate-as-false"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "universeId",
    "asOf",
    "observations",
    "fieldDefinitions",
    "rankBy",
    "tiePolicy",
    "missingValuePolicy"
  ]
}
Output schema
{
  "type": "object",
  "properties": {
    "assumptions": {
      "type": "object",
      "description": "Applied conventions"
    },
    "diagnostics": {
      "type": "object",
      "description": "Engine, method, warnings"
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "{ instrumentId, value, rank }"
    }
  },
  "required": [
    "assumptions",
    "diagnostics",
    "rows"
  ]
}

All operations · Setup, handles, jobs & permissions