transfers_for_token
Schema: lib
Description
The transfers_for_token
function is used to retrieve data on token transfers within a specified time frame and for a specific token contract. It returns information on individual transfers, including the sender, recipient, amount transferred, etc..
Usage
Signature
lib.transfers_for_token(
token_contract text,
start_time timestamptz,
end_time timestamptz,
token_chain text
)
Parameters
Name | Type | Description |
---|---|---|
token_contract | text | The address of the token contract for which transfers will be retrieved. |
start_time | timestamptz | The starting point for the data search. Only transfers that occurred at or after this time will be included. |
end_time | timestamptz | The endpoint for the data search. Only transfers that occurred at or before this time will be included. |
token_chain | text | (Optional) The chain on which the token contract is located. If not specified, transfers from all chains will be included. |
Results
Name | Type | Description |
---|---|---|
id | text | The unique identifier for the transfer. |
chain | text | The chain on which the transfer occurred. |
transaction_hash | text | The hash of the transaction in which the transfer occurred. |
log_index | integer | The index of the transfer within the transaction log. |
consensus_time | timestamptz | The time at which the transfer was confirmed by the network. |
contract | text | The address of the token contract. |
aliased_contract | text | The alias of the token contract, if one exists. Otherwise, the contract address will be used. |
entrypoint_contract | text | The address of the entrypoint contract, if applicable. |
aliased_entrypoint_contract | text | The alias of the entrypoint contract, if one exists. Otherwise, the entrypoint contract address will be used. |
sender | text | The address of the sender of the transfer. |
aliased_sender | text | The alias of the sender, if one exists. Otherwise, the sender address will be used. |
recipient | text | The address of the recipient of the transfer. |
aliased_recipient | text | The alias of the recipient, if one exists. Otherwise, the recipient address will be used. |
val | numeric | The amount of tokens transferred. |
decimaled_val | numeric | The amount of tokens transferred, converted to the appropriate decimal value based on the token's metadata. |
Examples
Retrieve the last day of transfers for the HOV token
The HOV
token has address 0xce82db637a2d750380ef27063518eaa263fbe10e
select *
from lib.transfers_for_token(
'0xce82db637a2d750380ef27063518eaa263fbe10e', -- HOV token address
now() - '24 hours'::interval,
now()
);
Retrieve the last day of transfers for the HOV token from the Kava chain only
The HOV
token has address 0xce82db637a2d750380ef27063518eaa263fbe10e
select *
from lib.transfers_for_token(
'0xce82db637a2d750380ef27063518eaa263fbe10e', -- HOV token address
now() - '24 hours'::interval,
now(),
'kava'
);