/v1/models/{slug}

Given a slug, returns the metadata associated with that model. Result values are described above in /v1/models.

Given this request:

curl 'https://gateway.credmark.com/v1/models/aave-v2.get-lending-pool' \
  -H 'Authorization: Bearer <API key>'

We get the following output:

{
  "slug": "aave-v2.get-lending-pool",
  "displayName": "Aave V2 - Get lending pool for main market",
  "description": "Aave V2 - Get lending pool for main market",
  "latestVersion": "1.1",
  "developer": "",
  "category": "protocol",
  "subcategory": "aave-v2",
  "tags": [],
  "input": {
    "title": "EmptyInput",
    "description": "The model does not require any input. This is an empty object.",
    "type": "object",
    "properties": {},
    "examples": [
      {}
    ]
  },
  "output": {
    "title": "Contract",
    "description": "Contract object to make web3 call smart contract functions.\nYou could create a contract with the following\n\n    c = Contract(address='0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')\n\n    c = Contract('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')",
    "type": "object",
    "properties": {
      "address": {
        "title": "Address",
        "type": "string",
        "pattern": "^0x[a-fA-F0-9]{40}$",
        "format": "evm-address"
      }
    },
    "required": [
      "address"
    ],
    "examples": [
      {
        "address": "0x1F98431c8aD98523631AE4a59f267346ea31F984"
      },
      {
        "address": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
        "abi": "(Optional) contract abi JSON string"
      }
    ]
  },
  "error": {
    "title": "ModelError",
    "description": "Data fields common to all error types:\nModelDataError, ModelRunError, ModelInputError etc.",
    "type": "object",
    "properties": {
      "type": {
        "title": "Type",
        "description": "Error type",
        "type": "string"
      },
      "message": {
        "title": "Message",
        "description": "Error message",
        "type": "string"
      },
      "stack": {
        "title": "Stack",
        "description": "Model call stack. Last element is the model that raised the error.",
        "default": [],
        "type": "array",
        "items": {
          "$ref": "#/definitions/ModelCallStackEntry"
        }
      },
      "code": {
        "title": "Code",
        "description": "Short identifier for the type of error",
        "default": "generic",
        "type": "string"
      },
      "detail": {
        "title": "Detail",
        "description": "Arbitrary data object srelated to the error."
      },
      "permanent": {
        "title": "Permanent",
        "description": "If true, the error will always give the same result for the same context.",
        "default": false,
        "type": "boolean"
      }
    },
    "required": [
      "type",
      "message",
      "stack",
      "code",
      "permanent"
    ],
    "definitions": {
      "ModelCallStackEntry": {
        "title": "ModelCallStackEntry",
        "description": "An item in an error's call stack.",
        "type": "object",
        "properties": {
          "slug": {
            "title": "Slug",
            "description": "Model slug",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "description": "Model version",
            "type": "string"
          },
          "chainId": {
            "title": "Chainid",
            "description": "Context chain id",
            "type": "integer"
          },
          "blockNumber": {
            "title": "Blocknumber",
            "description": "Context block number",
            "type": "integer"
          },
          "trace": {
            "title": "Trace",
            "description": "Trace of code that generated the error",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "version"
        ]
      }
    }
  },
  "cmfVersion": "0.8.39"
}

Last updated