Exact timestamp data: Position analytics based on any timestamp
This entity returns the fields in the interval data schema based on a 10 digit timestamp (formatted in SECONDS) that is keyed in by a user. We use the Unix timestamp format to populate all of our interval data snapshot fields as of that timestamp.
This data lends itself nicely to creating end of week/month/year statements.
Note:
This entity, while querying it, will throw an error if:
- The timestamp provided as a parameter is not in 10 digits (formatted in SECONDS)
- The timestamp provided is less than the timestamp of the first position snapshot
There will be no results returned if the position itself does not exist
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]
Exact Interval Data Query Example
query ExactIntervalData(
$blueprintId: String!,
$userIdentifier: String!,
$positionIdentifier: StringIdentifier!
) {
exactIntervalData(
blueprintId: $blueprintId,
userIdentifier: $userIdentifier,
positionIdentifier: $positionIdentifier
timestamp: 1665690410
) {
requestId
indexingStatus {
headBlock
headTimestamp
lastSyncedBlock
lastSyncedTimestamp
}
item {
positionIdentifier
userIdentifier
blueprintId
hasException
date
positionAgeSeconds
blockNumber
timestamp
intervalDataType
positionSharesAtBlock
basePositionShares
positionShareChange
positionShareChangeUsd
avgOpenInterestUsd
cumulativeCollectedIncomeUsd
pendingIncomeUsd
incomeApyInception
positionShareAPY
positionShareUsdAPY
netMarketGainUsd
netMarketGainPct
positionUsdValueAtBlock
hodlValueUsd
ifHeldAllAmountBtc
ifHeldAllAmountBtcValueUsd
ifHeldAllAmountEth
ifHeldAllAmountEthValueUsd
basePositionCostUsd
basePositionUnitCostUsd
roiVsHodlUsd
roiVsHodlPct
btcPriceUsd
btcPriceSource
ethPriceUsd
ethPriceSource
exitRatio
exitedSessionLength
exitedPositionSharesAtBlock
exitedBasePositionShares
exitedPositionShareChange
exitedPositionShareChangeUsd
exitedPositionShareAPY
exitedPositionShareUsdAPY
exitedCostUsd
exitedValueUsd
exitedNetGainUsd
exitedNetGainPct
exitedCollectedIncomeUsd
exitedIncomeAPY
exitedRoiVsHodlUsd
exitedRoiVsHodlPct
exitedHodlValueUsd
exitedIfHeldAllAmountBtcValueUsd
exitedIfHeldAllAmountEthValueUsd
isLiabilityPosition
warning
tokens {
tokenName
tokenAddress
tokenType
tag
netTokenAmount
priceUsd
priceSource
pendingIncomeAmount
collectedIncomeAmount
cumulativeCollectedIncomeUsd
exitedCumulativeCollectedIncomeAmount
exitedCumulativeCollectedIncomeUsd
totalIncomeAmount
tokenAmountAtBlock
exitedTokenAmount
ifHeldAmountToken
exitedIfHeldAmountToken
exitedIfHeldAllAmountToken
ifHeldAllAmountToken
ifHeldAllAmountTokenValueUsd
tokenValueUsd
isVirtualToken
warning
}
}
}
}
{
"blueprintId":"aave_v2_eth",
"userIdentifier":"0x375B8Af157230ee02A84f5069451E033E3EDB0f5",
"positionIdentifier":"0x6c3c78838c761c6ac7be9f59fe808ea2a6e4379d"
}
Here is the sample exactIntervalData response
{
"data": {
"exactIntervalData": {
"requestId": "f243fb9b-11d1-5435-a786-bd0d6416b2ab",
"indexingStatus": {
"headBlock": 20511049,
"headTimestamp": 1723447775,
"lastSyncedBlock": 20484244,
"lastSyncedTimestamp": 1723124639
},
"item": {
"positionIdentifier": "0x6c3c78838c761c6ac7be9f59fe808ea2a6e4379d",
"userIdentifier": "0x375b8af157230ee02a84f5069451e033e3edb0f5",
"blueprintId": "aave_v2_eth",
"date": "2022-10-13T19:46:50+00:00",
"positionAgeSeconds": 99,
"blockNumber": 15741369,
"timestamp": 1665690410,
"intervalDataType": "on_demand",
"positionSharesAtBlock": "20.000001184733929995",
"basePositionShares": "20",
"positionShareChange": "0.000001184733929995",
"positionShareChangeUsd": "-0.000001183394347809",
"avgOpenInterestUsd": "-19.977385940379428",
"cumulativeCollectedIncomeUsd": "0",
"pendingIncomeUsd": "0",
"incomeApyInception": "0",
"positionShareAPY": "-1.8869580412284",
"positionShareUsdAPY": "-1.8869580412290369",
"netMarketGainUsd": "-0.000001183394347809",
"netMarketGainPct": "-0.000005923669649977",
"positionUsdValueAtBlock": "-19.977387123773773809",
"hodlValueUsd": "-19.977385940379428",
"ifHeldAllAmountBtc": "-0.00103144740592445216",
"ifHeldAllAmountBtcValueUsd": "-19.977367223016085492",
"ifHeldAllAmountEth": "-0.01549877529710267657",
"ifHeldAllAmountEthValueUsd": "-19.977388154573986817",
"basePositionCostUsd": "-19.977385940379426",
"basePositionUnitCostUsd": "-0.9988692970189713",
"roiVsHodlUsd": "-0.000001183394345809",
"roiVsHodlPct": "-0.000005923669639966",
"btcPriceUsd": "19368.2849055314",
"btcPriceSource": "coingecko_dex_intimate",
"ethPriceUsd": "1288.96559706292",
"ethPriceSource": "coingecko_dex_intimate",
"exitRatio": null,
"exitedSessionLength": null,
"exitedPositionSharesAtBlock": null,
"exitedBasePositionShares": null,
"exitedPositionShareChange": null,
"exitedPositionShareChangeUsd": null,
"exitedPositionShareAPY": null,
"exitedPositionShareUsdAPY": null,
"exitedCostUsd": null,
"exitedValueUsd": null,
"exitedNetGainUsd": null,
"exitedNetGainPct": null,
"exitedCollectedIncomeUsd": null,
"exitedIncomeAPY": null,
"exitedRoiVsHodlUsd": null,
"exitedRoiVsHodlPct": null,
"exitedHodlValueUsd": null,
"exitedIfHeldAllAmountBtcValueUsd": null,
"exitedIfHeldAllAmountEthValueUsd": null,
"isLiabilityPosition": true,
"tokens": [
{
"tokenName": "dai",
"tokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"tokenType": "non_receipt",
"tag": "tracked_underlying",
"netTokenAmount": "-20",
"priceUsd": "0.9988692970189713",
"priceSource": "aave_v2_eth",
"pendingIncomeAmount": null,
"collectedIncomeAmount": null,
"cumulativeCollectedIncomeUsd": null,
"exitedCumulativeCollectedIncomeAmount": null,
"exitedCumulativeCollectedIncomeUsd": null,
"totalIncomeAmount": null,
"tokenAmountAtBlock": "20.000001184733929995",
"exitedTokenAmount": null,
"ifHeldAmountToken": "20",
"exitedIfHeldAmountToken": "0",
"exitedIfHeldAllAmountToken": null,
"ifHeldAllAmountToken": "20",
"ifHeldAllAmountTokenValueUsd": "19.977385940379426",
"tokenValueUsd": "19.977387123773773809",
"isVirtualToken": false
},
{
"tokenName": "variabledebtdai",
"tokenAddress": "0x6c3c78838c761c6ac7be9f59fe808ea2a6e4379d",
"tokenType": "receipt",
"tag": "",
"netTokenAmount": "-20",
"priceUsd": "0.9988692970189713",
"priceSource": "coingecko",
"pendingIncomeAmount": null,
"collectedIncomeAmount": null,
"cumulativeCollectedIncomeUsd": null,
"exitedCumulativeCollectedIncomeAmount": null,
"exitedCumulativeCollectedIncomeUsd": null,
"totalIncomeAmount": null,
"tokenAmountAtBlock": "20.000001184733929995",
"exitedTokenAmount": null,
"ifHeldAmountToken": null,
"exitedIfHeldAmountToken": null,
"exitedIfHeldAllAmountToken": null,
"ifHeldAllAmountToken": null,
"ifHeldAllAmountTokenValueUsd": null,
"tokenValueUsd": "19.977387123773774",
"isVirtualToken": false
}
]
}
}
}
}