Skip to content

Commit

Permalink
Add siblingProtocols to child data and update protocolInfoKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Jan 16, 2025
1 parent ff6b30b commit 070180d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions defi/src/api2/cron-task/dimensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ function mergeChildRecords(protocol: any, childProtocolData: any[]) {
childProtocolData.forEach(({ records, info: childData }: any) => {

const versionKey = childData.name ?? childData.displayName ?? childData.versionKey
childData.siblingProtocols = info.childProtocols.filter((name: any) => name !== versionKey)
if (!versionKey) console.log('versionKey is missing', childData)

// update child metadata and chain info
Expand Down
2 changes: 1 addition & 1 deletion defi/src/api2/routes/dimensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export async function getOverviewProcess2({
response.change_7dover7d = getPercentage(summary.total7d, summary.total14dto7d)
response.change_30dover30d = getPercentage(summary.total30d, summary.total60dto30d)

const protocolInfoKeys = ['defillamaId', 'name', 'disabled', 'displayName', 'module', 'category', 'logo', 'chains', 'protocolType', 'methodologyURL', 'methodology', 'latestFetchIsOk', 'childProtocols', 'parentProtocol', 'slug',]
const protocolInfoKeys = ['defillamaId', 'name', 'disabled', 'displayName', 'module', 'category', 'logo', 'chains', 'protocolType', 'methodologyURL', 'methodology', 'latestFetchIsOk', 'childProtocols', 'parentProtocol', 'slug', 'siblingProtocols',]
const protocolDataKeys = ['total24h', 'total48hto24h', 'total7d', 'total14dto7d', 'total60dto30d', 'total30d', 'total1y', 'totalAllTime', 'average1y', 'change_1d', 'change_7d', 'change_1m', 'change_7dover7d', 'change_30dover30d', 'breakdown24h', 'total14dto7d', 'total7DaysAgo', 'total30DaysAgo'] // TODO: missing breakdown24h/fix it?

response.protocols = Object.entries(protocolSummaries).map(([_id, { summaries, info }]: any) => {
Expand Down

0 comments on commit 070180d

Please sign in to comment.