Position snapshot entity: Transaction metrics
Part of what a blueprint does is classify each transaction an address makes within the scope of the blueprint. The scope of a blueprint is usually a protocol, but some protocols can be split up into multiple blueprints if needed. The position snapshot entity returns the key transaction data for all the operations. This is where the protocol stores what tokens and how many tokens went from where to where and how much they were worth at that time. The affects of the transactions on the position as a whole are also tracked in the fields of the position entity.
Many of the calculations and analytics found in our interval data rely on the data returned by the positions 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]
For the latest entity information and schema please see the embedded tabs on the GraphQL endpoint: https://beta.archiveprotocol.com/graphql
Positions query example
query transactionHistory {
positions(
blueprintId: "uniswap_v3_arbitrum"
positionIdentifier: "181102"
userIdentifier: "0xe3ea96bee65513b2d0091f1827237ae10e04eace"
) {
requestId
indexingStatus {
headBlock
headTimestamp
lastSyncedBlock
lastSyncedTimestamp
}
items {
id
chainId
blueprintId
userIdentifier
positionIdentifier
snapshotData {
id
blockNumber
timestamp
txFeeUsd
gasTokenAmount
txHash
basePositionCostUsd
basePositionUnitCostUsd
positionUsdValueAtBlock
positionSharesAtBlock
basePositionShares
exitRatio
exitedCostUsd
exitedValueUsd
exitedHodlValueUsd
ifHeldAllAmountEth
ifHeldAllAmountBtc
isNewSession
isFullyExitedSession
isLiabilityPosition
warning
operations {
operationType
operationValueUsd
adjustmentValueUsd
warning
tokens {
tokenName
tokenAddress
tokenDirection
tokenType
tag
isVirtualToken
tokenAmountAtBlock
decimals
tokenRawAmount
totalAmountDeposited
amountDepositedChange
totalAmountWithdrawn
amountWithdrawnChange
netTokenAmount
amountIncomeChange
tokenIncomeUsd
tokenPriceUsd
tokenPriceSource
tokenValueUsd
ifHeldAmountToken
ifHeldAllAmountToken
exitedIfHeldAmountToken
exitedIfHeldAllAmountToken
warning
}
}
}
}
}
}
{
"data": {
"positions": {
"requestId": "21c9df94-5018-5e19-b289-4407ed3e3326",
"indexingStatus": {
"headBlock": 242018522,
"headTimestamp": 1723447373,
"lastSyncedBlock": 242018522,
"lastSyncedTimestamp": 1723447373
},
"items": [
{
"id": "1157476",
"chainId": 42161,
"blueprintId": "uniswap_v3_arbitrum",
"userIdentifier": "0xe3ea96bee65513b2d0091f1827237ae10e04eace",
"positionIdentifier": "181102",
"snapshotData": [
{
"id": "4591283",
"blockNumber": 36695926,
"timestamp": 1668019577,
"txFeeUsd": "0.248918588584554297",
"gasTokenAmount": "0.0002124842",
"txHash": "0x90f6f6550b5274ed04a168f4ac7f04ae520e3a5b9763d5f2247be4b22e20fffe",
"basePositionCostUsd": "20.172507740898461819",
"basePositionUnitCostUsd": "68479161.88808456000024171409",
"positionUsdValueAtBlock": "20.172507740898461819",
"positionSharesAtBlock": "0.000000294578776736",
"basePositionShares": "0.000000294578776736",
"exitRatio": null,
"exitedCostUsd": null,
"exitedValueUsd": null,
"exitedHodlValueUsd": null,
"ifHeldAllAmountEth": "0.01721984361912210173",
"ifHeldAllAmountBtc": "0.00118189262268670443",
"isNewSession": true,
"isFullyExitedSession": false,
"isLiabilityPosition": false,
"operations": [
{
"operationType": "deposit",
"operationValueUsd": "20.172507740898463065",
"adjustmentValueUsd": "0",
"tokens": [
{
"tokenName": "usdc",
"tokenAddress": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
"tokenDirection": "input",
"tokenType": "non_receipt",
"tag": "tracked_underlying",
"isVirtualToken": false,
"tokenAmountAtBlock": "9.997355",
"decimals": 6,
"tokenRawAmount": "9997355",
"totalAmountDeposited": "9.997355",
"amountDepositedChange": "9.997355",
"totalAmountWithdrawn": "0",
"amountWithdrawnChange": "0",
"netTokenAmount": "9.997355",
"amountIncomeChange": null,
"tokenIncomeUsd": null,
"tokenPriceUsd": "1.0006850705123185",
"tokenPriceSource": "coingecko",
"tokenValueUsd": "10.004203893111679918",
"ifHeldAmountToken": "9.997355",
"ifHeldAllAmountToken": "20.158697611598008",
"exitedIfHeldAmountToken": null,
"exitedIfHeldAllAmountToken": null
},
{
"tokenName": "weth",
"tokenAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"tokenDirection": "input",
"tokenType": "non_receipt",
"tag": "tracked_underlying",
"isVirtualToken": false,
"tokenAmountAtBlock": "0.008679962074105881",
"decimals": 18,
"tokenRawAmount": "8679962074105881",
"totalAmountDeposited": "0.008679962074105881",
"amountDepositedChange": "0.008679962074105881",
"totalAmountWithdrawn": "0",
"amountWithdrawnChange": "0",
"netTokenAmount": "0.008679962074105881",
"amountIncomeChange": null,
"tokenIncomeUsd": null,
"tokenPriceUsd": "1171.4686954820843",
"tokenPriceSource": "coingecko",
"tokenValueUsd": "10.168303847786783147",
"ifHeldAmountToken": "0.008679962074105881",
"ifHeldAllAmountToken": "0.0172198436191221",
"exitedIfHeldAmountToken": null,
"exitedIfHeldAllAmountToken": null
}
]
}
]
},
{
"id": "4591284",
"blockNumber": 115519361,
"timestamp": 1690477193,
"txFeeUsd": "0.474748105719528312",
"gasTokenAmount": "0.0002539643",
"txHash": "0xfb83312c90574a13d72431d6b1d34d8dd9a6763ccc1699970b2e165047b91e51",
"basePositionCostUsd": "20.172507740898461819",
"basePositionUnitCostUsd": "68479161.88808456000024171409",
"positionUsdValueAtBlock": "25.486228022691587032",
"positionSharesAtBlock": "0.000000294578776736",
"basePositionShares": "0.000000294578776736",
"exitRatio": null,
"exitedCostUsd": null,
"exitedValueUsd": null,
"exitedHodlValueUsd": null,
"ifHeldAllAmountEth": "0.01721984361912210173",
"ifHeldAllAmountBtc": "0.00118189262268670443",
"isNewSession": false,
"isFullyExitedSession": false,
"isLiabilityPosition": false,
"operations": [
{
"operationType": "income",
"operationValueUsd": "0.632644194608279938",
"adjustmentValueUsd": "0",
"tokens": [
{
"tokenName": "usdc",
"tokenAddress": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
"tokenDirection": "output",
"tokenType": "income",
"tag": "trade_fees",
"isVirtualToken": false,
"tokenAmountAtBlock": null,
"decimals": 6,
"tokenRawAmount": "285028",
"totalAmountDeposited": null,
"amountDepositedChange": null,
"totalAmountWithdrawn": null,
"amountWithdrawnChange": null,
"netTokenAmount": null,
"amountIncomeChange": "0.285028",
"tokenIncomeUsd": "0.285328706048717449",
"tokenPriceUsd": "1.0010550052932254",
"tokenPriceSource": "uniswapv3_arbitrum",
"tokenValueUsd": "0.285328706048717449",
"ifHeldAmountToken": null,
"ifHeldAllAmountToken": null,
"exitedIfHeldAmountToken": null,
"exitedIfHeldAllAmountToken": null
},
{
"tokenName": "weth",
"tokenAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"tokenDirection": "output",
"tokenType": "income",
"tag": "trade_fees",
"isVirtualToken": false,
"tokenAmountAtBlock": null,
"decimals": 18,
"tokenRawAmount": "185794811750755",
"totalAmountDeposited": null,
"amountDepositedChange": null,
"totalAmountWithdrawn": null,
"amountWithdrawnChange": null,
"netTokenAmount": null,
"amountIncomeChange": "0.000185794811750755",
"tokenIncomeUsd": "0.347315488559562489",
"tokenPriceUsd": "1869.3497697098699",
"tokenPriceSource": "uniswapv3_arbitrum",
"tokenValueUsd": "0.347315488559562489",
"ifHeldAmountToken": null,
"ifHeldAllAmountToken": null,
"exitedIfHeldAmountToken": null,
"exitedIfHeldAllAmountToken": null
}
]
}
]
},
{
"id": "4591285",
"blockNumber": 115519655,
"timestamp": 1690477268,
"txFeeUsd": "0.521865627469996496",
"gasTokenAmount": "0.0002791696",
"txHash": "0x0d75d21084cb1c232719c08a547bf55a8af4bc99bf5320ca2808f36a8f61e068",
"basePositionCostUsd": "5.04312693522515884062",
"basePositionUnitCostUsd": "68479161.88809193847979167813",
"positionUsdValueAtBlock": "6.371541137255414739",
"positionSharesAtBlock": "0.000000073644694184",
"basePositionShares": "0.000000073644694184",
"exitRatio": "0.75",
"exitedCostUsd": "15.12938080567330297838",
"exitedValueUsd": "19.114623411766244216",
"exitedHodlValueUsd": "19.675298304219740716",
"ifHeldAllAmountEth": "0.004304960904780525",
"ifHeldAllAmountBtc": "0.000295473155671676",
"isNewSession": false,
"isFullyExitedSession": false,
"isLiabilityPosition": false,
"operations": [
{
"operationType": "withdraw",
"operationValueUsd": "19.114623411766240993",
"adjustmentValueUsd": "0",
"tokens": [
{
"tokenName": "usdc",
"tokenAddress": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
"tokenDirection": "output",
"tokenType": "non_receipt",
"tag": "tracked_underlying",
"isVirtualToken": false,
"tokenAmountAtBlock": "3.18243",
"decimals": 6,
"tokenRawAmount": "9547293",
"totalAmountDeposited": "9.997355",
"amountDepositedChange": "0",
"totalAmountWithdrawn": "9.547293",
"amountWithdrawnChange": "9.547293",
"netTokenAmount": "0.450062",
"amountIncomeChange": null,
"tokenIncomeUsd": null,
"tokenPriceUsd": "1.0010493743567928",
"tokenPriceSource": "uniswapv3_arbitrum",
"tokenValueUsd": "9.557311684450987402",
"ifHeldAmountToken": "2.49933875",
"ifHeldAllAmountToken": "5.039674402899502",
"exitedIfHeldAmountToken": "7.49801625",
"exitedIfHeldAllAmountToken": "15.119023208698506"
},
{
"tokenName": "weth",
"tokenAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"tokenDirection": "output",
"tokenType": "non_receipt",
"tag": "tracked_underlying",
"isVirtualToken": false,
"tokenAmountAtBlock": "0.00170421321211233",
"decimals": 18,
"tokenRawAmount": "5112639636614706",
"totalAmountDeposited": "0.008679962074105881",
"amountDepositedChange": "0",
"totalAmountWithdrawn": "0.005112639636614706",
"amountWithdrawnChange": "0.005112639636614706",
"netTokenAmount": "0.003567322437491175",
"amountIncomeChange": null,
"tokenIncomeUsd": null,
"tokenPriceUsd": "1869.3497697098699",
"tokenPriceSource": "uniswapv3_arbitrum",
"tokenValueUsd": "9.557311727315253591",
"ifHeldAmountToken": "0.00216999051852647",
"ifHeldAllAmountToken": "0.004304960904780525",
"exitedIfHeldAmountToken": "0.006509971555579411",
"exitedIfHeldAllAmountToken": "0.012914882714341575"
}
]
}
]
},
{
"id": "4591286",
"blockNumber": 115520234,
"timestamp": 1690477426,
"txFeeUsd": "0.411578664431538447",
"gasTokenAmount": "0.0002201721",
"txHash": "0xf92c283461b3966633066c95fa6b69979f6fffb49701b67a3d4be6bd7518e6a5",
"basePositionCostUsd": "13.05145470608256363362",
"basePositionUnitCostUsd": "78524963.8337448181100419496",
"positionUsdValueAtBlock": "14.37988795529245213",
"positionSharesAtBlock": "0.000000166207713686",
"basePositionShares": "0.000000166207713686",
"exitRatio": null,
"exitedCostUsd": null,
"exitedValueUsd": null,
"exitedHodlValueUsd": null,
"ifHeldAllAmountEth": "0.00859184263599549527",
"ifHeldAllAmountBtc": "0.00056879730696064186",
"isNewSession": false,
"isFullyExitedSession": false,
"isLiabilityPosition": false,
"operations": [
{
"operationType": "deposit",
"operationValueUsd": "8.008327770857404293",
"adjustmentValueUsd": "0",
"tokens": [
{
"tokenName": "usdc",
"tokenAddress": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
"tokenDirection": "input",
"tokenType": "non_receipt",
"tag": "tracked_underlying",
"isVirtualToken": false,
"tokenAmountAtBlock": "7.18236",
"decimals": 6,
"tokenRawAmount": "3999944",
"totalAmountDeposited": "13.997299",
"amountDepositedChange": "3.999944",
"totalAmountWithdrawn": "9.547293",
"amountWithdrawnChange": "0",
"netTokenAmount": "4.450006",
"amountIncomeChange": null,
"tokenIncomeUsd": null,
"tokenPriceUsd": "1.0010551090778776",
"tokenPriceSource": "uniswapv3_arbitrum",
"tokenValueUsd": "4.004164377225402039",
"ifHeldAmountToken": "6.49928275",
"ifHeldAllAmountToken": "13.039561420342808",
"exitedIfHeldAmountToken": null,
"exitedIfHeldAllAmountToken": "13.039561420342808"
},
{
"tokenName": "weth",
"tokenAddress": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"tokenDirection": "input",
"tokenType": "non_receipt",
"tag": "tracked_underlying",
"isVirtualToken": false,
"tokenAmountAtBlock": "0.00384622675264466",
"decimals": 18,
"tokenRawAmount": "2142008659114374",
"totalAmountDeposited": "0.010821970733220255",
"amountDepositedChange": "0.002142008659114374",
"totalAmountWithdrawn": "0.005112639636614706",
"amountWithdrawnChange": "0",
"netTokenAmount": "0.005709331096605549",
"amountIncomeChange": null,
"tokenIncomeUsd": null,
"tokenPriceUsd": "1869.3497697098699",
"tokenPriceSource": "uniswapv3_arbitrum",
"tokenValueUsd": "4.004163393632002254",
"ifHeldAmountToken": "0.004311999177640844",
"ifHeldAllAmountToken": "0.008588978749178007",
"exitedIfHeldAmountToken": null,
"exitedIfHeldAllAmountToken": "0.008588978749178007"
}
]
}
]
}
]
}
]
}
}
}