Subgraph Domain.expiryDate checkup

Querying the subgraph data on mainnet, I noticed that there is no single
“source of truth” for the Domain’s expiryDate for this 3 cases:

  1. Unwrapped name:
    random.eth on ENS
  2. Wrapped name:
    ethscriptions.eth on ENS
  3. Subname:
    vault.kevindot.eth on ENS

Using the query:
https://api.thegraph.com/subgraphs/name/ensdomains/ens/graphql?query=query+FindNames(%24ids%3A+[ID!]!)+{ ++domains(where%3A+{+id_in%3A+%24ids+})+{ ++++expiryDate ++++registration+{ ++++++expiryDate ++++} ++++name ++++id ++++wrappedDomain+{ ++++++expiryDate ++++} ++++ ++} }

with variables:

{
  "ids": [
"0x3dee4851d34e97b3cb441472f42f8940b8ec97301fe686edfaffb9f50fcb9c69",
"0x7671cd365802d7ee122ea2044ff089157f0d82990ab69fb3b6228eba48c54bf4",
"0xe6f3d5dec02a3d662cf5b256010901344aca61b72fc26225cbe4c18d57c4df73"
  ]
}

we get:

Where we can see that “domain.expiryDate” for unwrapped/wrapped names
is actually expiryDate + grace period.

So, my question is:
did I get this things straight? I have to get the correct expiryDate
for unwrapped/wrapped names from “registration.expiryDate”
and for subnames from “wrappedDomain.expiryDate” ?

You can only see this in NameWrapper contract — note: this only applies to ETH2LDs.

I think registration.expiryDate corresponds to BaseRegistrar.{NameRenewed,NameRegistered} events and wrappedDomain.expires corresponds to NameWrapper.ExpiryExtended event.

IMO for expiration: if ETH2LDs, you should consult nameExpires() and use the wrapper expiration for non-ETH2LD wrapped names.

@raffy (note: this is from sepolia graph)

edit:
from the looks of it for this particular name:
domain.expiry seems to be expiry + grace period

registration.expiry seems to be the correct one (name is wrapped)

wrappedDomain.expiry isnt the correct one

but I have an example (could not find the name) where the wrappedDomain one was the correct one and it was not a sub.

duno if the workaround could be:

  1. look at wrappedDomain and registration (for non subs) and just take the one that is >the longest<
  2. For subs always use wrappedDomain

edit2:
domain.expiry also not always seems to include grace… so not sure about that either. I will have a more closer look into graph to see whats up

1 Like

Ok so I checked couple names and came to the following conclusion:

  • domain.expiry includes grace period and gets update on expiryExtended and nameRenew
  • wrapped.expiry includes grace period and gets updated in graph on expiryExdented
  • registration.expiry doenst include grace period and gets updated in graph on nameRenew

Why dont use wrapped.expiry for wrapped names that arent subs:

nameRenew actually only updates the expiry on registration and not on wrappedDomain.

so if a name gets wrapped it inherits the expiry from the domain.expiry (which includes grace) but will not be updated again once I renew my wrapped name.

wrapped.expiry should therefore (atm) only be used to track sub expiries.

2 Likes