On demand data: Real time interval data

This entity returns the fields in the interval data schema for the most recent block available.

Many use cases can be satisfied with just this data so Archive protocol makes it available on its own for speed and a simplified view.

Note that exited positions will not return data from the onDemandIntervalData entity.

🚧

Beta version!

Please, note that the data and infrastructure are currently in beta. If you have any feedback or experience degraded performance feel free to reach out at: [email protected]

On demand interval data query example

query onDemandIntervalData {
  onDemandIntervalData(
    blueprintId: "uniswap_v3_arbitrum"
    userIdentifier: "0xe3EA96BEE65513b2D0091F1827237ae10e04EaCe"
    positionIdentifier: "181102" ) 
    {
    requestId
    indexingStatus {
      headBlock
      headTimestamp
      lastSyncedBlock
      lastSyncedTimestamp
    }
    items {
      positionIdentifier
      date
      positionAgeSeconds
      blockNumber
      timestamp
      intervalDataType
      isLiabilityPosition
      positionSharesAtBlock
      basePositionShares
      positionShareChange
      positionShareChangeUsd
      positionUsdValueAtBlock
      basePositionCostUsd
      basePositionUnitCostUsd
      netMarketGainUsd
      netMarketGainPct
      hodlValueUsd
      roiVsHodlUsd
      roiVsHodlPct
      ethPriceUsd
      ifHeldAllAmountEth
      ifHeldAllAmountEthValueUsd
      btcPriceUsd
      ifHeldAllAmountBtc
      ifHeldAllAmountBtcValueUsd
      avgOpenInterestUsd
      cumulativeCollectedIncomeUsd
      pendingIncomeUsd
      incomeApyInception
      positionShareAPY
      positionShareUsdAPY
      incomeSinceLastSnapshotUsd
      incomeApySinceLastSnapshot
      averageDailyIncomeSinceLastSnapshotUsd
      warning
      tokens {
        tokenName
        tokenAddress
        tokenType
        tag
        priceUsd
        priceSource
        tokenValueUsd
        ifHeldAllAmountTokenValueUsd
        isVirtualToken
        netTokenAmount
        pendingIncomeAmount
        collectedIncomeAmount
        totalIncomeAmount
        tokenAmountAtBlock
        ifHeldAmountToken
        ifHeldAllAmountToken
        warning
      }
    }
  }
}

Here is the sample onDemandInterval data response

{
  "data": {
    "onDemandIntervalData": {
      "requestId": "21c9df94-5018-5e19-b289-4407ed3e3326",
      "indexingStatus": {
        "headBlock": 242018522,
        "headTimestamp": 1723447373,
        "lastSyncedBlock": 242018522,
        "lastSyncedTimestamp": 1723447373
      },
      "items": [
        {
          "positionIdentifier": "181102",
          "date": "2024-08-12T07:24:09+00:00",
          "positionAgeSeconds": 55427796,
          "blockNumber": 242018522,
          "timestamp": 1723447373,
          "intervalDataType": "on_demand",
          "isLiabilityPosition": false,
          "positionSharesAtBlock": "0.000000166207713686",
          "basePositionShares": "0.000000166207713686",
          "positionShareChange": "0",
          "positionShareChangeUsd": "0",
          "positionUsdValueAtBlock": "16.684135481126842488",
          "basePositionCostUsd": "13.05145470608256363362",
          "basePositionUnitCostUsd": "78524963.8337448181100419496",
          "netMarketGainUsd": "3.63268077504427885438",
          "netMarketGainPct": "27.833531639590233424",
          "hodlValueUsd": "17.377475153728831801",
          "roiVsHodlUsd": "-0.693339672601989313",
          "roiVsHodlPct": "-3.989875781541333731",
          "ethPriceUsd": "2528.2",
          "ifHeldAllAmountEth": "0.00859184263599549527",
          "ifHeldAllAmountEthValueUsd": "21.721896552323811142",
          "btcPriceUsd": "58002",
          "ifHeldAllAmountBtc": "0.00056879730696064186",
          "ifHeldAllAmountBtcValueUsd": "32.991381398331149164",
          "avgOpenInterestUsd": "15.936670335704925",
          "cumulativeCollectedIncomeUsd": "0.158161048652069985",
          "pendingIncomeUsd": "0.698556331097511653",
          "incomeApyInception": "3.7347166153320095",
          "positionShareAPY": "0",
          "positionShareUsdAPY": "0",
          "incomeSinceLastSnapshotUsd": "0.69855628841893478",
          "incomeApySinceLastSnapshot": "4.64659118621686201",
          "averageDailyIncomeSinceLastSnapshotUsd": "0.00183061450840051288",
          "tokens": [
            {
              "tokenName": "usdc",
              "tokenAddress": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
              "tokenType": "income",
              "tag": "trade_fees",
              "priceUsd": "0.996399",
              "priceSource": "coingecko",
              "tokenValueUsd": "0.363622861863",
              "ifHeldAllAmountTokenValueUsd": null,
              "isVirtualToken": false,
              "netTokenAmount": null,
              "pendingIncomeAmount": "0.364937",
              "collectedIncomeAmount": "0.071257",
              "totalIncomeAmount": "0.436194",
              "tokenAmountAtBlock": null,
              "ifHeldAmountToken": null,
              "ifHeldAllAmountToken": null
            },
            {
              "tokenName": "usdc",
              "tokenAddress": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
              "tokenType": "non_receipt",
              "tag": "tracked_underlying",
              "priceUsd": "0.996399",
              "priceSource": "coingecko",
              "tokenValueUsd": "8.3537095761",
              "ifHeldAllAmountTokenValueUsd": "12.992605959668153548",
              "isVirtualToken": false,
              "netTokenAmount": "4.450006",
              "pendingIncomeAmount": null,
              "collectedIncomeAmount": null,
              "totalIncomeAmount": null,
              "tokenAmountAtBlock": "8.3839",
              "ifHeldAmountToken": "6.49928275",
              "ifHeldAllAmountToken": "13.039561420342808"
            },
            {
              "tokenName": "weth",
              "tokenAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
              "tokenType": "income",
              "tag": "trade_fees",
              "priceUsd": "2528.2",
              "priceSource": "coingecko",
              "tokenValueUsd": "0.334933469234511653",
              "ifHeldAllAmountTokenValueUsd": null,
              "isVirtualToken": false,
              "netTokenAmount": null,
              "pendingIncomeAmount": "0.000132479024299704",
              "collectedIncomeAmount": "0.000046448702937689",
              "totalIncomeAmount": "0.000178927727237393",
              "tokenAmountAtBlock": null,
              "ifHeldAmountToken": null,
              "ifHeldAllAmountToken": null
            },
            {
              "tokenName": "weth",
              "tokenAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
              "tokenType": "non_receipt",
              "tag": "tracked_underlying",
              "priceUsd": "2528.2",
              "priceSource": "coingecko",
              "tokenValueUsd": "8.330425905026843114",
              "ifHeldAllAmountTokenValueUsd": "21.714656073671837297",
              "isVirtualToken": false,
              "netTokenAmount": "0.005709331096605549",
              "pendingIncomeAmount": null,
              "collectedIncomeAmount": null,
              "totalIncomeAmount": null,
              "tokenAmountAtBlock": "0.00329500273120277",
              "ifHeldAmountToken": "0.004311999177640844",
              "ifHeldAllAmountToken": "0.008588978749178007"
            }
          ]
        }
      ]
    }
  }
}