{
  "openapi": "3.0.1",
  "info": {
    "title": "DeFi Data: Yields, Hacks, TVL & Protocols",
    "description": "DeFi-wide data: where a token earns and what it really pays, every recorded hack and exploit, which chains hold the capital and stablecoin dry powder, and any protocol's TVL trend with its security history.",
    "version": "1.0",
    "x-build-id": "OyNQsYeXqNBtpjdBC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/stlakchain~defi-yields-hacks-tvl/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-stlakchain-defi-yields-hacks-tvl",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/stlakchain~defi-yields-hacks-tvl/runs": {
      "post": {
        "operationId": "runs-sync-stlakchain-defi-yields-hacks-tvl",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/stlakchain~defi-yields-hacks-tvl/run-sync": {
      "post": {
        "operationId": "run-sync-stlakchain-defi-yields-hacks-tvl",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "dataset"
        ],
        "properties": {
          "dataset": {
            "title": "Dataset",
            "enum": [
              "defi-hacks",
              "defi-yields",
              "chain-health",
              "chain-trend",
              "chain-activity",
              "chain-metric-history",
              "protocol-report",
              "protocol-fees",
              "chain-revenue",
              "dex-volumes",
              "stablecoins",
              "perps-markets",
              "perps-funding",
              "perps-wallet",
              "perps-leaderboard",
              "perps-candles",
              "perps-open-interest"
            ],
            "type": "string",
            "description": "What to fetch. Each dataset uses the fields below marked for it; fields for other datasets are ignored.",
            "default": "defi-hacks"
          },
          "wallets": {
            "title": "Wallet addresses",
            "type": "array",
            "description": "0x wallet address. Add as many as you need; each wallet is looked up in turn. Used by: perps-wallet.",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Query",
            "type": "string",
            "description": "Protocol or project name to match. Used by: defi-hacks, protocol-fees, dex-volumes."
          },
          "chain": {
            "title": "Chain",
            "enum": [
              "solana",
              "ethereum",
              "base",
              "bsc",
              "monad",
              "hyperliquid",
              "robinhood",
              "arbitrum",
              "optimism",
              "unichain",
              "zksync_era",
              "linea",
              "scroll",
              "ink",
              "worldchain",
              "soneium",
              "mantle",
              "polygon_pos",
              "celo",
              "starknet",
              "taiko",
              "megaeth",
              "plume",
              "ronin",
              "mode",
              "metis",
              "manta",
              "lisk",
              "gravity",
              "fraxtal",
              "arbitrum_nova"
            ],
            "type": "string",
            "description": "Narrow to one chain. One of solana, ethereum, base, bsc, monad, hyperliquid, robinhood. Used by: defi-hacks, defi-yields, chain-trend, chain-metric-history, protocol-fees, chain-revenue, dex-volumes, stablecoins, perps-open-interest."
          },
          "limit": {
            "title": "Limit",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Incidents to return (default 20). Used by: defi-hacks, defi-yields, chain-activity, protocol-fees, dex-volumes, stablecoins, perps-markets, perps-leaderboard, perps-open-interest.",
            "default": 50
          },
          "symbol": {
            "title": "Symbol",
            "type": "string",
            "description": "Token ticker such as SOL, USDC, ETH. Matches pools containing it, so a pair like SOL-USDC is included. Used by: defi-yields."
          },
          "minTvlUsd": {
            "title": "Min TVL USD",
            "minimum": 0,
            "type": "integer",
            "description": "Ignore pools smaller than this (default 100,000) — small pools show inflated rates. Used by: defi-yields."
          },
          "stablesOnly": {
            "title": "Stables only",
            "type": "boolean",
            "description": "Only stablecoin pools, for parking money rather than taking price risk. Used by: defi-yields."
          },
          "chains": {
            "title": "Chains",
            "type": "array",
            "description": "Chains to compare (default: all). One of solana, ethereum, base, bsc, monad, hyperliquid, robinhood. Used by: chain-health, chain-activity."
          },
          "weeks": {
            "title": "Weeks",
            "minimum": 1,
            "maximum": 52,
            "type": "integer",
            "description": "Weekly points in the series (default 12). Used by: chain-trend."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "daa",
              "txcount",
              "fees",
              "txcosts",
              "profit",
              "app_revenue",
              "throughput",
              "tvl",
              "stables_mcap",
              "revenue",
              "volume",
              "openInterest",
              "funding",
              "fundingNegative",
              "change",
              "changeNegative",
              "pnl",
              "roi",
              "losses",
              "accountValue"
            ],
            "type": "string",
            "description": "Rank rows by this figure (default daa, active addresses). Used by: chain-activity, protocol-fees, perps-markets, perps-leaderboard."
          },
          "metric": {
            "title": "Metric",
            "enum": [
              "daa",
              "txcount",
              "fees",
              "txcosts",
              "profit",
              "app_revenue",
              "throughput",
              "tvl",
              "stables_mcap"
            ],
            "type": "string",
            "description": "One of: daa (active addresses), txcount (transactions), fees (fees paid by users (USD)), txcosts (median transaction cost (USD)), profit (onchain profit: fees kept after the chain's own costs (USD)), app_revenue (revenue of the apps on the chain (USD)), throughput (throughput (gas per second)), tvl (total value secured (USD)), stables_mcap (stablecoins on the chain (USD)). Used by: chain-metric-history."
          },
          "granularity": {
            "title": "Granularity",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ],
            "type": "string",
            "description": "Point spacing (default daily). Used by: chain-metric-history."
          },
          "days": {
            "title": "Days",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "How far back the series goes (default 90). Used by: chain-metric-history, perps-funding."
          },
          "protocol": {
            "title": "Protocol",
            "type": "string",
            "description": "Protocol name or slug, e.g. jupiter, aave, raydium. Used by: protocol-report."
          },
          "top": {
            "title": "Top",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Top earning protocols to list per chain (default 5). Used by: chain-revenue."
          },
          "coins": {
            "title": "Coins",
            "type": "array",
            "description": "Only these markets (BTC, HYPE, TSLA, xyz:NVDA). Used by: perps-markets, perps-funding.",
            "items": {
              "type": "string"
            }
          },
          "venue": {
            "title": "Venue",
            "enum": [
              "crypto",
              "stocks",
              "all"
            ],
            "type": "string",
            "description": "crypto (default): the main perps; stocks: the builder markets (stocks, indices, commodities); all: both. Used by: perps-markets."
          },
          "fills": {
            "title": "Fills",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Recent fills to include (default 20, 0 for none). Used by: perps-wallet."
          },
          "window": {
            "title": "Window",
            "enum": [
              "day",
              "week",
              "month",
              "allTime"
            ],
            "type": "string",
            "description": "Period (default week). Used by: perps-leaderboard."
          },
          "minAccountValueUsd": {
            "title": "Min account value USD",
            "minimum": 0,
            "type": "integer",
            "description": "Leave out smaller accounts (default 100,000, which keeps tiny accounts from topping ROI). Used by: perps-leaderboard."
          },
          "coin": {
            "title": "Coin",
            "type": "string",
            "description": "Market: BTC, HYPE, TSLA, xyz:NVDA. Used by: perps-candles."
          },
          "interval": {
            "title": "Interval",
            "enum": [
              "1m",
              "5m",
              "15m",
              "1h",
              "4h",
              "1d"
            ],
            "type": "string",
            "description": "Candle size (default 1h). Used by: perps-candles."
          },
          "hours": {
            "title": "Hours",
            "minimum": 1,
            "maximum": 4320,
            "type": "integer",
            "description": "How far back (default 24; capped at 500 candles). Used by: perps-candles."
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many rows, whatever the inputs would produce. Caps the cost of a run.",
            "default": 1000
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}