{
  "openapi": "3.1.0",
  "info": {
    "title": "Tako indexer API",
    "version": "1",
    "description": "Read-only API over every event of the Tako protocol. Amounts are nanoGram as decimal strings, times are unix seconds, addresses are user-friendly. Responses are cached for a few seconds."
  },
  "servers": [
    {
      "url": "https://api.tako.wtf"
    }
  ],
  "tags": [
    {
      "name": "Pool"
    },
    {
      "name": "Activity"
    },
    {
      "name": "Lending"
    },
    {
      "name": "Draws"
    },
    {
      "name": "Governance"
    },
    {
      "name": "Meta"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Meta"
        ],
        "summary": "Indexer health",
        "operationId": "health",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pool": {
      "get": {
        "tags": [
          "Pool"
        ],
        "summary": "Pool state",
        "description": "Rate, supply, TVL, claims, lending, insurance, bad debt, APR and APY from the latest snapshot.",
        "operationId": "pool",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pool"
                }
              }
            }
          },
          "503": {
            "description": "No snapshot or stream capacity yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pool/history": {
      "get": {
        "tags": [
          "Pool"
        ],
        "summary": "Daily pool history",
        "operationId": "poolHistory",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "How many days back, 1–365, default 30",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PoolPoint"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/reserves": {
      "get": {
        "tags": [
          "Pool"
        ],
        "summary": "Reserves",
        "description": "Assets against what the pool owes holders and claims, and what it keeps reserved. `covered` is false if assets fall short.",
        "operationId": "reserves",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reserves"
                }
              }
            }
          },
          "503": {
            "description": "No snapshot or stream capacity yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defillama/tvl": {
      "get": {
        "tags": [
          "Pool"
        ],
        "summary": "TVL in Gram",
        "operationId": "defillamaTvl",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefiLlamaTvl"
                }
              }
            }
          },
          "503": {
            "description": "No snapshot or stream capacity yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "tags": [
          "Activity"
        ],
        "summary": "Events",
        "description": "Every event logged by the protocol, newest first.",
        "operationId": "events",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Only events with this name",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "before",
            "in": "query",
            "description": "Return items older than this `lt`, from the last item of the previous page",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1–200, default 50",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Event"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stream": {
      "get": {
        "tags": [
          "Activity"
        ],
        "summary": "Live events",
        "description": "A Server-Sent Events stream of new events, oldest first. Each message has `event: <name>`, `id: <lt>:<index>` and the event as JSON in `data`, the same object as in `/v1/events`. After a reconnect, browsers send the last id as `Last-Event-ID` and the stream resends what was missed, up to 1,000 events; `after` does the same for clients that set no header. A comment line every 15 seconds keeps the connection open.",
        "operationId": "stream",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Only these event names, comma separated",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "owner",
            "in": "query",
            "description": "Only events of this wallet",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "account",
            "in": "query",
            "description": "Only events logged by this contract",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "after",
            "in": "query",
            "description": "Resend events after this id, `<lt>:<index>`",
            "schema": {
              "type": "string",
              "pattern": "^\\d+:\\d+$"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-Sent Events; each data line is a Event as JSON"
                },
                "itemSchema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "No snapshot or stream capacity yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{address}/events": {
      "get": {
        "tags": [
          "Activity"
        ],
        "summary": "Events of an address",
        "operationId": "accountsAddressEvents",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "description": "Any TON address form",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "name",
            "in": "query",
            "description": "Only events with this name",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "before",
            "in": "query",
            "description": "Return items older than this `lt`, from the last item of the previous page",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1–200, default 50",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Event"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{address}/claims": {
      "get": {
        "tags": [
          "Activity"
        ],
        "summary": "Claims of an address",
        "operationId": "accountsAddressClaims",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "description": "Any TON address form",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Claim"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/claims/{index}": {
      "get": {
        "tags": [
          "Activity"
        ],
        "summary": "One claim",
        "operationId": "claimsIndex",
        "parameters": [
          {
            "name": "index",
            "in": "path",
            "description": "Claim index",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Claim"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rounds": {
      "get": {
        "tags": [
          "Lending"
        ],
        "summary": "Validation rounds",
        "description": "Bids, funded loans, Gram lent and what the pool earned, newest first.",
        "operationId": "rounds",
        "parameters": [
          {
            "name": "before",
            "in": "query",
            "description": "Rounds before this election id",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1–200, default 50",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Round"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rounds/{round}": {
      "get": {
        "tags": [
          "Lending"
        ],
        "summary": "One round with every bid and loan",
        "operationId": "roundsRound",
        "parameters": [
          {
            "name": "round",
            "in": "path",
            "description": "Election id",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoundDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{address}/loans": {
      "get": {
        "tags": [
          "Lending"
        ],
        "summary": "Loans of a validator",
        "operationId": "accountsAddressLoans",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "description": "Any TON address form",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Loan"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/vaults": {
      "get": {
        "tags": [
          "Draws"
        ],
        "summary": "Prize vaults",
        "operationId": "vaults",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Vault"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/draws": {
      "get": {
        "tags": [
          "Draws"
        ],
        "summary": "Draws",
        "operationId": "draws",
        "parameters": [
          {
            "name": "vault",
            "in": "query",
            "description": "Only draws of this vault",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1–200, default 50",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Draw"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/vaults/{address}/draws/{id}": {
      "get": {
        "tags": [
          "Draws"
        ],
        "summary": "One draw with every prize",
        "operationId": "vaultsAddressDrawsId",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "description": "Any TON address form",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "id",
            "in": "path",
            "description": "Draw id",
            "schema": {
              "type": "integer"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DrawDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/prizes": {
      "get": {
        "tags": [
          "Draws"
        ],
        "summary": "Prize events",
        "operationId": "prizes",
        "parameters": [
          {
            "name": "before",
            "in": "query",
            "description": "Return items older than this `lt`, from the last item of the previous page",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1–200, default 50",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Event"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/proposals": {
      "get": {
        "tags": [
          "Governance"
        ],
        "summary": "Timelock proposals",
        "operationId": "proposals",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Proposal"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Error",
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "Health": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Health",
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "snapshotAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "eventAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "ok",
          "snapshotAt",
          "eventAt"
        ],
        "additionalProperties": false,
        "description": "When the last pool snapshot and the last event were stored"
      },
      "Pool": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Pool",
        "type": "object",
        "properties": {
          "updatedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix seconds"
          },
          "rate": {
            "type": "string",
            "description": "Gram per takoGRAM"
          },
          "totalCoins": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "totalShares": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "pendingProfit": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Profit still vesting into the rate"
          },
          "tvl": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Balance plus Gram lent to validators"
          },
          "queued": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Gram owed to unredeemed claims"
          },
          "lent": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "insurance": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "badDebt": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "instantLiquidity": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Gram available for instant withdrawals"
          },
          "apr": {
            "description": "Annual rate of the profit vesting now, in percent",
            "type": [
              "number",
              "null"
            ]
          },
          "apy": {
            "type": "object",
            "properties": {
              "week": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "month": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "inception": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "required": [
              "week",
              "month",
              "inception"
            ],
            "additionalProperties": false,
            "description": "Growth of the rate over the last 7 and 30 days and since the first snapshot, annualized, as a fraction"
          }
        },
        "required": [
          "updatedAt",
          "rate",
          "totalCoins",
          "totalShares",
          "pendingProfit",
          "tvl",
          "queued",
          "lent",
          "insurance",
          "badDebt",
          "instantLiquidity",
          "apr",
          "apy"
        ],
        "additionalProperties": false
      },
      "PoolPoint": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/PoolPoint",
        "type": "object",
        "properties": {
          "at": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix seconds"
          },
          "rate": {
            "type": "string"
          },
          "tvl": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "lent": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          }
        },
        "required": [
          "at",
          "rate",
          "tvl",
          "lent"
        ],
        "additionalProperties": false
      },
      "Reserves": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Reserves",
        "type": "object",
        "properties": {
          "updatedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix seconds"
          },
          "assets": {
            "type": "object",
            "properties": {
              "balance": {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              "lent": {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              "total": {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              }
            },
            "required": [
              "balance",
              "lent",
              "total"
            ],
            "additionalProperties": false
          },
          "liabilities": {
            "type": "object",
            "properties": {
              "holders": {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              "claims": {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              "total": {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              }
            },
            "required": [
              "holders",
              "claims",
              "total"
            ],
            "additionalProperties": false
          },
          "reserved": {
            "type": "object",
            "properties": {
              "collateral": {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              "insurance": {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              }
            },
            "required": [
              "collateral",
              "insurance"
            ],
            "additionalProperties": false
          },
          "surplus": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "covered": {
            "type": "boolean",
            "description": "Whether assets cover liabilities and reserves"
          }
        },
        "required": [
          "updatedAt",
          "assets",
          "liabilities",
          "reserved",
          "surplus",
          "covered"
        ],
        "additionalProperties": false
      },
      "Event": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Event",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Event name, for example deposit, prize or loan_funded"
          },
          "account": {
            "type": "string",
            "description": "Contract that logged the event"
          },
          "owner": {
            "anyOf": [
              {
                "type": "string",
                "description": "User-friendly address"
              },
              {
                "type": "null"
              }
            ],
            "description": "Wallet the event concerns, if any"
          },
          "tx": {
            "type": "string",
            "description": "Transaction hash, hex"
          },
          "lt": {
            "type": "string",
            "pattern": "^\\d+$",
            "description": "Logical time of the transaction, the paging cursor"
          },
          "at": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix seconds"
          },
          "data": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Decoded event fields; amounts are nanoGram strings"
          }
        },
        "required": [
          "name",
          "account",
          "owner",
          "tx",
          "lt",
          "at",
          "data"
        ],
        "additionalProperties": false
      },
      "Claim": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Claim",
        "type": "object",
        "properties": {
          "index": {
            "type": "string"
          },
          "owner": {
            "type": "string",
            "description": "User-friendly address"
          },
          "shares": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "amount": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix seconds"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "redeemed"
            ]
          },
          "redeemedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "paid": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "index",
          "owner",
          "shares",
          "amount",
          "createdAt",
          "status",
          "redeemedAt",
          "paid"
        ],
        "additionalProperties": false
      },
      "Vault": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Vault",
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "User-friendly address"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "shares": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ]
          },
          "principal": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ]
          },
          "prize": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ]
          },
          "jackpot": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ]
          },
          "players": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "drawId": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "nextDrawAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "address",
          "updatedAt",
          "shares",
          "principal",
          "prize",
          "jackpot",
          "players",
          "drawId",
          "nextDrawAt"
        ],
        "additionalProperties": false
      },
      "Round": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Round",
        "type": "object",
        "properties": {
          "round": {
            "type": "string",
            "description": "Election id, the unix time the round starts"
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "lent": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null until the round is decided"
          },
          "funded": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Loans funded; null until the round is decided"
          },
          "requests": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "settled": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "poolTake": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "payout": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          }
        },
        "required": [
          "round",
          "decidedAt",
          "lent",
          "funded",
          "requests",
          "settled",
          "poolTake",
          "payout"
        ],
        "additionalProperties": false
      },
      "Loan": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Loan",
        "type": "object",
        "properties": {
          "round": {
            "type": "string"
          },
          "borrower": {
            "type": "string",
            "description": "User-friendly address"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "evicted",
              "unfunded",
              "funded",
              "settled"
            ]
          },
          "amount": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "minPayment": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "collateral": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "requestedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix seconds"
          },
          "principal": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ]
          },
          "fundedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "poolTake": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ]
          },
          "payout": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ]
          },
          "settledAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "round",
          "borrower",
          "status",
          "amount",
          "minPayment",
          "collateral",
          "requestedAt",
          "principal",
          "fundedAt",
          "poolTake",
          "payout",
          "settledAt"
        ],
        "additionalProperties": false
      },
      "RoundDetail": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/RoundDetail",
        "type": "object",
        "properties": {
          "round": {
            "type": "string",
            "description": "Election id, the unix time the round starts"
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "lent": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null until the round is decided"
          },
          "funded": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Loans funded; null until the round is decided"
          },
          "requests": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "settled": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "poolTake": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "payout": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "loans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Loan"
            }
          }
        },
        "required": [
          "round",
          "decidedAt",
          "lent",
          "funded",
          "requests",
          "settled",
          "poolTake",
          "payout",
          "loans"
        ],
        "additionalProperties": false
      },
      "Draw": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Draw",
        "type": "object",
        "properties": {
          "vault": {
            "type": "string",
            "description": "User-friendly address"
          },
          "id": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "closedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "round": {
            "description": "drand round the draw waits for",
            "type": [
              "string",
              "null"
            ]
          },
          "revealedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "randomness": {
            "description": "sha256 of the drand signature, hex",
            "type": [
              "string",
              "null"
            ]
          },
          "principal": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total tickets at the draw"
          },
          "winner": {
            "anyOf": [
              {
                "type": "string",
                "description": "User-friendly address"
              },
              {
                "type": "null"
              }
            ],
            "description": "First winner"
          },
          "prizeTotal": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "prizeCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "vault",
          "id",
          "closedAt",
          "round",
          "revealedAt",
          "randomness",
          "principal",
          "winner",
          "prizeTotal",
          "prizeCount"
        ],
        "additionalProperties": false
      },
      "Prize": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Prize",
        "type": "object",
        "properties": {
          "winner": {
            "type": "string",
            "description": "User-friendly address"
          },
          "shares": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "principal": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "jackpot": {
            "type": "boolean"
          }
        },
        "required": [
          "winner",
          "shares",
          "principal",
          "jackpot"
        ],
        "additionalProperties": false
      },
      "DrawDetail": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/DrawDetail",
        "type": "object",
        "properties": {
          "vault": {
            "type": "string",
            "description": "User-friendly address"
          },
          "id": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "closedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "round": {
            "description": "drand round the draw waits for",
            "type": [
              "string",
              "null"
            ]
          },
          "revealedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          },
          "randomness": {
            "description": "sha256 of the drand signature, hex",
            "type": [
              "string",
              "null"
            ]
          },
          "principal": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$",
                "description": "Amount in nanoGram, as a decimal string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total tickets at the draw"
          },
          "winner": {
            "anyOf": [
              {
                "type": "string",
                "description": "User-friendly address"
              },
              {
                "type": "null"
              }
            ],
            "description": "First winner"
          },
          "prizeTotal": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "prizeCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "prizes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Prize"
            }
          }
        },
        "required": [
          "vault",
          "id",
          "closedAt",
          "round",
          "revealedAt",
          "randomness",
          "principal",
          "winner",
          "prizeTotal",
          "prizeCount",
          "prizes"
        ],
        "additionalProperties": false
      },
      "Proposal": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/Proposal",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Proposal id, 0x-prefixed hex"
          },
          "target": {
            "type": "string",
            "description": "User-friendly address"
          },
          "value": {
            "type": "string",
            "pattern": "^-?\\d+$",
            "description": "Amount in nanoGram, as a decimal string"
          },
          "op": {
            "description": "First 32 bits of the body, 0x-prefixed hex",
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string",
            "description": "Message body, base64 BoC"
          },
          "readyAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix seconds"
          },
          "scheduledAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix seconds"
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "executed",
              "cancelled"
            ]
          },
          "closedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix seconds"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "target",
          "value",
          "op",
          "body",
          "readyAt",
          "scheduledAt",
          "status",
          "closedAt"
        ],
        "additionalProperties": false
      },
      "DefiLlamaTvl": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "#/components/schemas/DefiLlamaTvl",
        "type": "object",
        "properties": {
          "tvl": {
            "type": "string",
            "description": "TVL in Gram"
          },
          "updatedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix seconds"
          }
        },
        "required": [
          "tvl",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    }
  }
}
