Skip to main content

address_associations

Schema: public

Description

This table is used to store associations between different addresses. This table is useful for tracking the relationships between addresses and their associated addresses, as well as the context and type of association. This table contains only the current state of known address associations.

Examples of assocations:

  • When an account holder (the address) opens a new smart loan (the associated_address) a record can be stored in this table tying the two addresses together
  • If a protocol opens "child accounts" on your behalf to partition funds, a record can be stored in this table tying your account (the address) with the child account (the associated_address)

Columns

NameTypeDescriptionDefault
idcharacterUnique identifier for the associationNone
updated_timetimestamptzTimestamp for when the association was last updatedNone
chaintextName of the blockchain or cryptocurrencyNone
addresstextAddress for the primary entity in the associationNone
associated_addresstextAddress for the associated entity in the associationNone
protocoltextProtocol used for the associationNone
association_typetextType of association between the two addressesNone
association_removedbooleanFlag for when the association has been removedfalse
contextjsonbAdditional context or information about the associationNone

Examples

Retrieve all address association events for account 0x6962148BCDe900BDEd3C12ce6239AbE404945e33
select aa.*
from address_associations aa
where address = '0x6962148bcde900bded3c12ce6239abe404945e33'
order by aa.updated_time;
Retrieve all address association events for the protocol "DeltaPrime"
select aa.*
from address_associations aa
order by aa.updated_time;
Get all active address associations for account 0x6962148bcde900bded3c12ce6239abe404945e33
  select
aa.id,
aa.updated_time,
aa.chain,
aa.address,
aa.associated_address,
aa.protocol,
aa.association_type,
aa.context,
aa.association_removed
from address_associations aa
where aa.address = '0x6962148bcde900bded3c12ce6239abe404945e33'
and not association_removed
order by aa.address, aa.updated_time desc;