跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.chainstream.io/llms.txt

Use this file to discover all available pages before exploring further.

概述

ChainStream GraphQL 提供三个用于预测市场数据的 Cube,主要覆盖 Polygon。这些 Cube 覆盖预测市场从创建、交易到结算的完整生命周期。
预测市场 Cube 位于 EVM 链组中,通常与 network: polygon 一起使用。

PredictionTrades

近期预测市场交易

query {
  EVM(network: polygon) {
    PredictionTrades(
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Transaction { Hash }
      Trade {
        Buyer
        Seller
        Amount
        Price
        Fee
      }
      Prediction {
        Condition { Id Outcomes }
        Question { Id }
        Outcome
        Marketplace { ProtocolName }
      }
    }
  }
}

指定条件的交易

query {
  EVM(network: polygon) {
    PredictionTrades(
      conditionId: {is: "CONDITION_ID"}
      limit: {count: 50}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Trade { Buyer Seller Amount Price }
      Prediction { Outcome OutcomeToken { SmartContract } }
    }
  }
}

按交易平台的成交量

query {
  EVM(network: polygon) {
    PredictionTrades(
      marketplace: {is: "Polymarket"}
      limit: {count: 100}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Trade { Amount Price }
      Prediction {
        Question { Id }
        Marketplace { ProtocolName }
      }
      count
      sum(of: Trade_Amount)
    }
  }
}

PredictionManagements

市场创建与结算事件

query {
  EVM(network: polygon) {
    PredictionManagements(
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Transaction { Hash }
      Management {
        EventType
        Description
        Group
        Prediction {
          Condition { Id }
          Question { Id }
          Marketplace { ProtocolName }
        }
      }
    }
  }
}

按事件类型筛选

query {
  EVM(network: polygon) {
    PredictionManagements(
      eventType: {is: "ConditionResolution"}
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Management {
        EventType
        Description
        Prediction { Condition { Id Outcomes } }
      }
    }
  }
}

PredictionSettlements

近期结算

query {
  EVM(network: polygon) {
    PredictionSettlements(
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Transaction { Hash }
      Settlement {
        EventType
        Holder
        OutcomeTokenIds
        Amounts
        Prediction {
          Condition { Id }
          CollateralToken { SmartContract Symbol }
          Marketplace { ProtocolName }
        }
      }
    }
  }
}

指定持有人的结算

query {
  EVM(network: polygon) {
    PredictionSettlements(
      holder: {is: "0xHOLDER_ADDRESS"}
      limit: {count: 50}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Settlement {
        EventType
        Amounts
        Prediction { Condition { Id } }
      }
    }
  }
}

相关文档

数据 Cube

预测市场 Cube 的详细字段结构。

链组

预测类 Cube 仅支持 EVM,主要在 Polygon 上。