Credit Debit
Fungible Credit Debit
The Fungible credit debit model combines erc20 and native token transfers, allowing you to easily track the inflows and outflows of every fungible token belonging to all addresses.
Credit Debit vs Transfers
Credit Debit tables contain the amount and direction (credit/debit) of every transfer event of all assets (NATIVE, ERC20, ERC721 and ERC1155).
This table will include two rows for every event, with one row representing credit and one row representing debit.
Example Using an ERC20 token as an example, a token transfer will be represented as follows:
from_address | to_address | amount | event |
---|---|---|---|
X | Y | 1250 | X transfers 1250 tokens to Y |
In credit debit, it will be represented two rows.
address | counterparty_address | amount | event |
---|---|---|---|
X | Y | -1250 | X decrease 1250 tokens to Y |
Y | X | 1250 | Y increase 1250 tokens from X |
Table Columns
Unique Key: unique_id
Column Name | Data Type | Description |
---|---|---|
token_type | VARCHAR | Type of the token (‘NATIVE’ or ‘ERC20’), converted to uppercase |
from_address | VARCHAR | The address sending the tokens |
to_address | VARCHAR | The address receiving the tokens |
token_address | VARCHAR | Token address of the token |
token_name | VARCHAR | Name of the token |
token_symbol | VARCHAR | Token symbol |
raw_amount_str | VARCHAR | Amount of tokens moved (unnormalized) in string |
raw_amount | FLOAT | Amount of tokens moved (unnormalized) |
amount_str | VARCHAR | Amount of tokens moved, normalized in string |
amount | FLOAT | Amount of tokens moved, normalized by the decimal points defined in the token contract |
usd_amount | FLOAT | The amount of tokens moved, in $USD |
usd_exchange_rate | FLOAT | The price of a single token, in USD |
transaction_from_address | VARCHAR | The address that initiated the transaction |
transaction_to_address | VARCHAR | The address that received the transaction |
transaction_hash | VARCHAR | Transaction hash that this transfer belongs to |
transaction_index | BIGINT | The position of this transaction in the block. The first transaction has index 0 |
log_index | BIGINT | The position of this log within the block (null for native tokens) |
call_type | VARCHAR | Type of the call that generated this transfer (null for ERC20 tokens and Tron chain) |
transfer_type | VARCHAR | Type of the transfer (‘value_transfer’ for ERC20 tokens) |
block_timestamp | TIMESTAMP_NTZ(9) | The timestamp of the block that contains this transfer |
block_number | BIGINT | The block number that contains this transfer |
block_hash | VARCHAR | The block hash that contains this transfer |
unique_id | VARCHAR | Unique id for each transfer |
_tokens_updated_at | TIMESTAMP_NTZ(9) | Timestamp when token metadata was last updated (null for native tokens) |
_created_at | TIMESTAMP_NTZ(9) | Timestamp when this record was created |
_updated_at | TIMESTAMP_NTZ(9) | Timestamp when this record was last updated |
_changed_since_full_refresh | BOOLEAN | Indicates if the record has changed since the last full refresh |