Adapter

Simple Treasuries

Fetches treasuries that can be loaded from Zerion without special operations.

Sub-Adapters 47

Preview and test each sub adapter.

1inch (1inch)

Aavegotchi (aavegotchi)

Abracadabra (abracadabra)

Alchemix (alchemix)

API3 (api3)

Aragon (aragon)

Babylon Finance (babylon)

Badger (badger)

Balancer (balancer)

Bankless DAO (bankless)

BarnBridge (barnbridge)

BitDAO (bitdao)

Compound (compound)

Decentraland (decentraland)

Gitcoin (gitcoin)

Fei (fei)

Idle DAO (idle)

Index Coop (index-coop)

KeeperDAO (keeper)

The LAO (lao)

Lido (lido)

Linkswap (linkswap)

MetaCartel Ventures (metacartel-ventures)

mStable (mstable)

Nexus Mutual (nexus)

NFTX (nftx)

Nouns DAO (nouns)

Olympus DAO (olympus)

Paraswap (paraswap)

PieDAO (piedao)

Perpetual Protocol (perpetual)

PleaserDAO (pleaserdao)

PrimeDAO (primedao)

Radicle (radicle)

Rarible (rarible)

ShapeShift (shapeshift)

Stakeborg DAO (stakeborg)

Stargate Finance (Stargate)

SushiSwap (sushi)

Synthetix (synthetix)

Tempus (tempus)

Tornado Cash (tornado)

Uniswap (uniswap)

Unslashed Finance (unslashed)

Yam Finance (yam)

Yearn (yearn)

Aura Finance (aura)

Adapter Code

Check the entire code written for the Adapter.

Source code

Showing TS source.
1export const name = 'Simple Treasuries';
2export const version = '0.3.1';
3export const license = 'MIT';
4export const description = 'Fetches treasuries that can be loaded from Zerion without special operations.';
5export const changeLog = 'Added Tempus Treasury';
6
7interface Org {
8  id: string
9  icon?: string
10  addresses: string[]
11  vestingAddresses?: string[]
12  nativeTokens?: string[]
13  iconType?: string
14  snapshotId?: string
15  governanceSite?: string
16  metadata: any
17  getProposals?: (sdk: Context) => Promise<any>
18}
19
20
21interface PortfolioAsset {
22  address: string
23  amount: number
24  name: string
25  symbol: string
26  // icon: string
27  price: number
28  value: number
29  vesting?: boolean
30}
31
32export async function setup(sdk: Context) {
33  const orgs: Org[] = [
34    {
35      id: '1inch',
36      addresses: ['0x7951c7ef839e26F63DA87a42C9a87986507f1c07'],
37      icon: 'QmebJTDWem5sHs9ZTv7DHtpoTQFQchdN7tXJjwYXabwgTP',
38      snapshotId: '1inch.eth',
39      metadata: {
40        name: '1inch',
41        website: 'https://1inch.io',
42        governanceForum: 'https://gov.1inch.io',
43      },
44    },
45    {
46      id: 'aavegotchi',
47      addresses: [ '0xffe6280ae4e864d9af836b562359fd828ece8020' ],
48      icon: 'QmPe79ZtTxhpLXrRGBCjkhoMaTMrBmb7YDkycEFgcmBNVc',
49      iconType: 'image/png',
50      snapshotId: 'aavegotchi.eth',
51      metadata: {
52        name: 'Aavegotchi',
53        website: 'https://aavegotchi.com/',
54        governanceForum: 'https://dao.aavegotchi.com/',
55      },
56    },
57    {
58      id: 'abracadabra',
59      addresses: ['0x5a7c5505f3cfb9a0d9a8493ec41bf27ee48c406d'],
60      icon: 'QmR8XgrW7cGncTjPQJ2LBnoQHBFBRve7mN1PT6yLjrKX6s',
61      iconType: 'image/png',
62      snapshotId: 'abracadabrabymerlinthemagician.eth',
63      metadata: {
64        name: 'Abracadabra',
65        website: 'https://abracadabra.money/',
66        governanceSite: 'https://snapshot.page/#/abracadabrabymerlinthemagician.eth',
67        governanceForum: 'https://forum.abracadabra.money/',
68        governanceModel: '',
69      },
70    },
71    {
72      id: 'alchemix',
73      addresses: ['0x8392f6669292fa56123f71949b52d883ae57e225'],
74      icon: 'QmSuSUcAvGkxkJ7n5RxnDyqXUchAjXMwTmNioz2xzXVfxo',
75      iconType: 'image/jpeg',
76      snapshotId: 'alchemixstakers.eth',
77      metadata: {
78        name: 'Alchemix',
79        website: 'https://alchemix.fi/',
80        governanceSite: 'https://snapshot.page/#/alchemixstakers.eth',
81        governanceForum: 'https://forum.alchemix.fi',
82        governanceModel: '',
83      },
84    },
85    {
86      id: 'api3',
87      addresses: [
88        '0xe7aF7c5982e073aC6525a34821fe1B3e8E432099', // v1
89        '0xD9F80Bdb37E6Bad114D747E60cE6d2aaF26704Ae', // v2_primary
90        '0x556ECbb0311D350491Ba0EC7E019c354D7723CE0' // v2_secondary
91      ],
92      icon: 'QmVp2hVgfD8sQRFosydPsNAVmttno5tRhun44YiXagNeGX',
93      iconType: 'image/jpeg',
94      metadata: {
95        name: 'API3',
96        website: 'https://api3.org',
97        governanceSite: 'https://api3.eth.link/#/governance',
98        governanceModel: '',
99      },
100    },
101    {
102      id: 'aragon',
103      addresses: ['0xfb633f47a84a1450ee0413f2c32dc1772ccaea3e'],
104      icon: 'QmVCYznBiU8ibk1YuuuhgRu6pWx1PQTYptvvjiVbGGTdyn',
105      iconType: 'image/png',
106      metadata: {
107        name: 'Aragon',
108        website: 'https://aragon.org/',
109        governanceSite: 'https://client.aragon.org/#/budget/0x6c871f1fc69c23809413a96fb359cb428245aa60/',
110      },
111    },
112    {
113      id: 'babylon',
114      addresses: [
115        '0xD7AAf4676F0F52993cb33aD36784BF970f0E1259', 
116      ],
117      icon: 'QmVQFJ6mC1wyeQcfQcVDZGC83a2rVPrc92ncVfeAR5VExE',
118      iconType: 'image/jpeg',
119      metadata: {
120        name: 'Babylon Finance',
121        website: 'https://www.babylon.finance/',
122        governanceSite: 'https://www.withtally.com/governance/eip155:1:0xBEC3de5b14902C660Bd2C7EfD2F259998424cc24',
123      },
124    },
125    {
126      id: 'badger',
127      addresses: [
128        '0x4441776e6a5d61fa024a5117bfc26b953ad1f425',
129        '0x5a54ca44e8f5a1a695f8621f15bfa159a140bb61',
130        '0x8de82c4c968663a0284b01069dde6ef231d0ef9b',
131        '0xb65cef03b9b89f99517643226d76e286ee999e77',
132      ],
133      icon: 'QmSraKiNmctuShFEqgGmLVamKuwZC6TFs26R27959ugExn',
134      iconType: 'image/png',
135      snapshotId: 'badgerdao.eth',
136      metadata: {
137        name: 'Badger',
138        description: 'Badger DAO is dedicated to building products and infrastructure to bring Bitcoin to DeFi.',
139        website: 'https://badger.finance',
140        governanceForum: 'https://forum.badger.finance',
141        governanceModel: '',
142      },
143    },
144    {
145      id: 'balancer',
146      addresses: [
147        '0x10A19e7eE7d7F8a52822f6817de8ea18204F2e4f', // ecosystem fund
148        '0xce88686553686DA562CE7Cea497CE749DA109f9F', // protocol fee collector
149      ],
150      icon: 'Qma9agewDVEhZjnLrY2aWy3ZHvYmUtZ5uXM3tCHZu5eDM2',
151      metadata: {
152        name: 'Balancer',
153        website: 'https://balancer.finance',
154        governanceSite: 'https://vote.balancer.finance',
155        governanceForum: 'https://forum.balancer.fi/',
156        governanceModel: '',
157      },
158    },
159    {
160      id: 'bankless',
161      addresses: [ '0xf26d1bb347a59f6c283c53156519cc1b1abaca51' ],
162      icon: 'QmfXpfiEavuqHB9wHxeup9QHttaeindCzwtnFvN756vnQW',
163      iconType: 'image/png',
164      snapshotId: 'banklessvault.eth',
165      metadata: {
166        name: 'Bankless DAO',
167        website: 'https://www.bankless.community/',
168        governanceForum: 'https://forum.bankless.community/',
169      },
170    },
171    {
172      id: 'barnbridge',
173      addresses: ['0x4cAE362D7F227e3d306f70ce4878E245563F3069'],
174      icon: 'QmWD4Eg6AdYmyAb9aSfELP7L4cU2uTFYoejHVsWjerYWZo',
175      metadata: {
176        name: 'BarnBridge',
177        website: 'https://barnbridge.com/',
178        governanceSite: 'https://app.barnbridge.com/governance',
179        governanceForum: 'https://forum.barnbridge.com/',
180        governanceModel: '',
181      },
182    },
183    {
184      id: 'bitdao',
185      addresses: ['0x78605Df79524164911C144801f41e9811B7DB73D'],
186      icon: 'QmVG1ziAPLtJkX7xogmLVxwnBiT5qEEy1P9aHWPM9J9Y17',
187      metadata: {
188        name: 'BitDAO',
189        website: 'https://bitdao.io',
190        governanceSite: 'https://snapshot.org/#/bitdao.eth',
191        governanceForum: 'https://discourse.bitdao.io/',
192        governanceModel: '',
193      },
194    },
195    {
196      id: 'compound',
197      addresses: ['0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b'],
198      vestingAddresses: ['0x2775b1c75658Be0F640272CCb8c72ac986009e38'],
199      icon: 'QmZpZsg829EnBxE2MPZykZpAfsxyRsu6EuGbtfTkf2EFNj',
200      metadata: {
201        name: 'Compound',
202        website: 'https://compound.finance',
203        governanceSite: 'https://compound.finance/governance',
204        governanceForum: 'https://www.comp.xyz',
205        governanceModel: '',
206      },
207    },
208    {
209      id: 'decentraland',
210      addresses: ['0x9a6ebe7e2a7722f8200d0ffb63a1f6406a0d7dce'],
211      icon: 'QmQGRHYnYF6gGSrAvou945hcVi2nygTar6U6hwPuC2vyfi',
212      iconType: 'image/png',
213      metadata: {
214        name: 'Decentraland',
215        website: 'https://decentraland.org/',
216        governanceSite: 'https://client.aragon.org/#/0xf47917b108ca4b820ccea2587546fbb9f7564b56/0x41e83d829459f99bf4ee2e26d0d79748fb16b94f/',
217        governanceForum: 'https://forum.decentraland.org/c/governance/13',
218      },
219    },
220    {
221      id: 'gitcoin',
222      addresses: [
223        '0x57a8865cfB1eCEf7253c27da6B4BC3dAEE5Be518', // Treasury
224        '0xde21F729137C5Af1b01d73aF1dC21eFfa2B8a0d6', // Grants
225      ],
226      vestingAddresses: ['0x44aa9c5a034c1499ec27906e2d427b704b567ffe'],
227      icon: 'QmR8nFrnSu7Mby5tdPPdUrTZttaK7L3TVsZheuwZ1KPUCT',
228      snapshotId: 'gitcoindao.eth',
229      metadata: {
230        name: 'Gitcoin',
231        website: 'https://gitcoin.co',
232        governanceForum: 'https://gov.gitcoin.co',
233      },
234    },
235    {
236      id: 'fei',
237      addresses: [
238        '0x8d5ed43dca8c2f7dfb20cf7b53cc7e593635d7b9', // Core
239        '0xd51dba7a94e1adea403553a8235c302cebf41a3c', // Timelock
240      ],
241      icon: 'QmaeWtW4HDNCKRMTrtE3kabu2xQDtb5iaZduEEm68F7rqR',
242      snapshotId: 'fei.eth',
243      metadata: {
244        name: 'Fei',
245        website: 'https://fei.money',
246        governanceForum: 'https://tribe.fei.money',
247      },
248    },
249
250    { 
251      id: 'idle', 
252      addresses:[
253        '0x69a62C24F16d4914a48919613e8eE330641Bcb94', // Fee Treasury 
254        '0xbecc659bfc6edca552fa1a67451cc6b38a0108e4', // Fee Collector 
255        '0x076ff8e6402b02855ff82119b53e59bbdd67f0ee', // SUSHI Collector
256        '0x107A369bc066c77FF061c7d2420618a6ce31B925', // LongTerm Fund 
257        '0xb0aA1f98523Ec15932dd5fAAC5d86e57115571C7', // Ecosystem Fund 
258        '0x031f71B5369c251a6544c41CE059e6b3d61e42C6', // Reservoir 
259        '0xFb3bD022D5DAcF95eE28a6B07825D4Ff9C5b3814', // Treasury League Multisig 
260        '0xe8eA8bAE250028a8709A3841E0Ae1a44820d677b', // Dev League Multisig Wallet 
261      ], 
262      icon: 'QmQZypfk7tLvAo68dtzEwqte2AAsn5SbzxSj48wwva2FdZ',
263      iconType: 'image/png',
264      snapshotId: 'idlefinance.eth' , 
265
266      metadata: { 
267        name: 'Idle DAO',
268        description:'Idle is a decentralized protocol dedicated to bringing automatic asset allocation and yield aggregation to the interest-bearing tokens economy.',
269        website: 'https://idle.finance', 
270        governanceForum: 'https://gov.idle.finance', 
271      },
272    },
273
274    {
275      id: 'index-coop',
276      addresses: ['0x9467cfADC9DE245010dF95Ec6a585A506A8ad5FC'],
277      icon: 'QmcatsG9WgkB6m9vSF3mbgwXFJyG8qSDNsZyi2mEGRk4oa',
278      snapshotId: 'index-coop.eth',
279      metadata: {
280        name: 'Index Coop',
281        website: 'https://indexcoop.com',
282        governanceForum: 'https://gov.indexcoop.com',
283        governanceModel: '',
284      },
285    },
286    {
287      id: 'keeper',
288      addresses: ['0x9a67f1940164d0318612b497e8e6038f902a00a4'],
289      nativeTokens: ['0xfa5047c9c78b8877af97bdcb85db743fd7313d4a'],
290      icon: 'QmQ8Fxi73dFhyYb5LncV7133q4XBwXNvR1hK9aW6aHaQWQ',
291      snapshotId: 'rook.eth',
292      metadata: {
293        name: 'KeeperDAO',
294        website: 'https://keeperdao.com',
295        governanceForum: 'https://forum.keeperdao.com',
296      },
297    },
298    {
299      id: 'lao',
300      addresses: ['0x8f56682a50becb1df2fb8136954f2062871bc7fc'],
301      icon: 'QmcBBSvXC4nUQHSRy5BcGvX7RGWyhzeUifyHNR3e4q26T2',
302      iconType: 'image/jpeg',
303      metadata: {
304        name: 'The LAO',
305        website: 'https://linkswap.app',
306        governanceSite: 'https://app.daohaus.club/dao/0x1/0x8f56682a50becb1df2fb8136954f2062871bc7fc',
307      },
308    },
309    {
310      id: 'lido',
311      addresses: ['0x3e40d73eb977dc6a537af587d48316fee66e9c8c'],
312      icon: 'QmcsGcopqrVyzTLXETtecJuhqxqxbzUvuFMqBd27yFKCMt',
313      metadata: {
314        name: 'Lido',
315        website: 'https://lido.fi',
316        governanceForum: 'https://research.lido.fi',
317        governanceSite: 'https://mainnet.lido.fi/#/lido-dao.aragonid.eth',
318      },
319    },
320    {
321      id: 'linkswap',
322      addresses: ['0xE69A81b96FBF5Cb6CAe95d2cE5323Eff2bA0EAE4'],
323      icon: 'QmdAhG1qWuW6wEcuW29ZjAvqPz8grSYHsR7HZJLSkqkGQ5',
324      snapshotId: 'yflink.eth',
325      metadata: {
326        name: 'Linkswap',
327        website: 'https://linkswap.app',
328        governanceModel: '',
329      },
330    },
331    {
332      id: 'metacartel-ventures',
333      addresses: ['0x4570b4faf71e23942b8b9f934b47ccedf7540162'],
334      icon: 'QmRfpPMV471hsVE4Zz6dTxoAyoNmc2UZPjDr6X8o34QAZz',
335      iconType: 'image/jpeg',
336      metadata: {
337        name: 'MetaCartel Ventures',
338        website: 'https://metacartel.xyz',
339        governanceSite: 'https://app.daohaus.club/dao/0x1/0x4570b4faf71e23942b8b9f934b47ccedf7540162',
340      },
341    },
342    {
343      id: 'mstable',
344      addresses: [
345        '0x3dd46846eed8D147841AE162C8425c08BD8E1b41',
346        '0xfcf455d6eb48b3289a712c0b3bc3c7ee0b0ee4c6', // Funding subDAO
347        '0x67905d3e4fec0c85dce68195f66dc8eb32f59179', // Asset Management subDAO
348      ],
349      icon: 'QmTkxsvMnSPb7A2bPUxA4uJRwJefkyzFgGar5NVxV5UJjr',
350      metadata: {
351        name: 'mStable',
352        website: 'https://mstable.org',
353        governanceSite: 'https://snapshot.page/#/mstable',
354        governanceForum: 'https://forum.mstable.org',
355        governanceModel: '',
356      },
357    },
358    {
359      id: 'nexus',
360      addresses: ['0x586b9b2F8010b284A0197f392156f1A7Eb5e86e9'],
361      icon: 'QmWA5VaHWMH96mLmoaLKaxKVf86GLUJQVBp6BfaUoLH81g',
362      metadata: {
363        name: 'Nexus Mutual',
364        website: 'https://nexusmutual.io/',
365        governanceSite: 'https://app.nexusmutual.io/governance',
366        governanceForum: 'https://forum.nexusmutual.io/',
367        governanceModel: '',
368      },
369    },
370    {
371      id: 'nftx',
372      addresses: ['0x40d73df4f99bae688ce3c23a01022224fe16c7b2'],
373      icon: 'QmU4gtLcxZ4q3Vq27AU1hPdUSxi1o87UESwjNC8DXmCnpH',
374      iconType: 'image/png',
375      metadata: {
376        name: 'NFTX',
377        website: 'https://nftx.io/',
378        governanceForum: 'https://forum.nftx.org/',
379        governanceSite: 'https://client.aragon.org/#/nftx/0xf20e3d05813ce460d42994d26eb4b7d85381d117/',
380      },
381    },
382    {
383      id: 'nouns',
384      addresses: ['0x0BC3807Ec262cB779b38D65b38158acC3bfedE10'],
385      icon: 'QmXCYbSzPAWTUiNuHaFt6AxRkwhq9ho1cDfJ2Vc1Yeb4Js',
386      metadata: {
387        name: 'Nouns DAO',
388        website: 'https://nouns.wtf',
389        governanceSite: 'https://nouns.wtf/vote',
390        governanceForum: 'https://discourse.nouns.wtf',
391      },
392    },
393    {
394      id: 'olympus',
395      addresses: [
396        '0x9A315BdF513367C0377FB36545857d12e85813Ef', // Olympus Treasury v2
397        '0x31F8Cc382c9898b273eff4e0b7626a6987C846E8', // Olympus Treasury v1
398        '0xde7b85f52577b113181921a7aa8fc0c22e309475', // Frax Allocator
399        '0xdbf0683fc4fc8ac11e64a6817d3285ec4f2fc42d', // Convex Allocator - Updated
400        '0x3df5a355457db3a4b5c744b8623a7721bf56df78', // Convex Allocator - Old
401        '0xdFC95aaf0a107DaAe2b350458DED4b7906E7f728', // Convex Holder
402        '0x0316508a1b5abf1CAe42912Dc2C8B9774b682fFC', // Onsen Allocator
403        '0x0e1177e47151Be72e5992E0975000E73Ab5fd9D4', // Aave Allocator
404      ],
405      icon: 'QmbtqUKno2FATf4RFPXAvWCamYrRT6UAKurKiNCuMCJw1J',
406      snapshotId: 'olympusdao.eth',
407      metadata: {
408        name: 'Olympus DAO',
409        website: 'https://olympusdao.finance',
410      },
411    },
412    {
413      id: 'paraswap',
414      addresses: [
415        '0x5a61d9214adefd7669428a03a4e8734a00e9f464', // Main Paraswap MultiSig
416        '0x6DF5e7b236a4F14e08C27E09202B4d1865905e9b', // Operational MultiSig
417      ],
418      vestingAddresses: [
419        '0x6a3CCa09b1C2B83834124c8646a68b9Bad2a07b9', // PSP Reserve Vesting Contract Y1
420        '0x348aa814a72970e76d5756a2cda16e7e8f245aab', // PSP Reserve Vesting Contract Y2
421        '0xb074094d2e858b25d129989644248f9f6946e081', // PSP Reserve Vesting Contract Y3
422        '0x51d2f2c65d043118eb4329fcbc738943f494609f', // PSP Reserve Vesting Contract Y4
423      ],
424      icon: 'QmaxpaLjvz27n3t4piqqR8upEAxmUbX8mixo2cPmR56mbw',
425      iconType: 'image/jpeg',
426      snapshotId: 'paraswap-dao.eth',
427      metadata: {
428        name: 'Paraswap',
429        website: 'https://paraswap.io/',
430        governanceForum: 'https://gov.paraswap.network/',
431      },
432    },
433    {
434      id: 'piedao',
435      addresses: ['0x3bcf3db69897125aa61496fc8a8b55a5e3f245d5'],
436      icon: 'QmahuQPfbqJEE9tXZKfubWPviy5wxesdfBbdUXhf8JRcN4',
437      snapshotId: 'piedao.eth',
438      metadata: {
439        name: 'PieDAO',
440        website: 'https://piedao.org',
441        governanceForum: 'https://forum.piedao.org/',
442      },
443    },
444    {
445      id: 'perpetual',
446      addresses: ['0xd374225abb84dca94e121f0b8a06b93e39ad7a99'],
447      icon: 'QmQf19AsfwAAozFtvhtQmzX4aowJeLDyEB9KV52z5ZKycZ',
448      iconType: 'image/png',
449      snapshotId: 'vote-perp.eth',
450      metadata: {
451        name: 'Perpetual Protocol',
452        website: 'https://www.perp.com/',
453        governanceForum: 'https://gov.perp.fi/',
454      },
455    },
456    {
457      id: 'pleaserdao',
458      addresses: ['0xf5c27c6fe782cbb5c85989ea3e75754748153459'],
459      icon: 'QmQDpmGaDJey2nDzziNUdoVqy76FCqg5XsP1y8ciTpwq7N',
460      iconType: 'image/jpg',
461      metadata: {
462        name: 'PleaserDAO',
463        website: 'https://pleasr.org/',
464      },
465    },
466    {
467      id: 'primedao',
468      addresses: ['0x567d220B0169836cBF351DF70A9c517096ec9De7'],
469      icon: 'QmeYo2DNFPDqYQdDJNwbcHn4zr1eQUTh6zQQapeiRj4HyK',
470      iconType: 'image/png',
471      snapshotId: 'primexyz.eth',
472      metadata: {
473        name: 'PrimeDAO',
474        website: 'https://www.prime.xyz/',
475        governanceForum: 'https://forum.prime.xyz/',
476      },
477    },
478    {
479      id: 'radicle',
480      addresses: ['0x8da8f82d2bbdd896822de723f55d6edf416130ba'],
481      icon: 'QmWQrRGqXBoyMixvVXDfAFEashjX6dj1JZq27qEcAXDoCC',
482      iconType: 'image/jpg',
483      snapshotId: 'gov.radicle.eth',
484      metadata: {
485        name: 'Radicle',
486        website: 'https://radicle.xyz/',
487        governanceForum: 'https://radicle.community/',
488      },
489    },
490    {
491      id: 'rarible',
492      addresses: [
493        '0xfdff6b56cce39482032b27140252ff4f16432785', // RARI treasury
494        '0x1cf0df2a5a20cd61d68d4489eebbf85b8d39e18a'  // other treasury
495      ],
496      icon: 'QmcpJWurowq4eQqCU9mbsxmd7yYfvpgdmv14yz9nDXiRya',
497      iconType: 'image/jpeg',
498      snapshotId: 'rarible.eth',
499      metadata: {
500        name: 'Rarible',
501        website: 'https://rarible.com/',
502        governanceForum: 'https://gov.rarible.org/',
503      },
504    },
505    {
506      id: 'shapeshift',
507      addresses: ['0x90A48D5CF7343B08dA12E067680B4C6dbfE551Be'],
508      nativeTokens: ['0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d'],
509      icon: 'QmWTua7CSYcgb1YZCZZFQ2CvHxJxFyTK3SC1V86czCBTjL',
510      snapshotId: 'shapeshiftdao.eth',
511      metadata: {
512        name: 'ShapeShift',
513        website: 'https://shapeshift.com',
514        governanceForum: 'https://forum.shapeshift.com',
515      },
516    },
517    {
518      id: 'stakeborg',
519      addresses: ['0xF0E1015C33dA062E53fEF545631e75eAD91a5456'],
520      nativeTokens: [
521        '0xDA0c94c73D127eE191955FB46bACd7FF999b2bcd',
522        '0x0acc0fee1d86d2cd5af372615bf59b298d50cd69'
523      ],
524      snapshotId: 'stakeborgdao.eth',
525      icon: 'QmPV95Fa5krahTh17aFTmdUSJcRT5WpVw45SL295LivTWd',
526      iconType: 'image/png',
527      metadata: {
528        name: 'Stakeborg DAO',
529        website: 'https://stakeborgdao.xyz/',
530        governanceForum: 'https://stakeborgdao.xyz/forums/'
531      }
532    },
533    {
534      id: 'Stargate',
535      addresses: [
536        '0x65bb797c2B9830d891D87288F029ed8dACc19705', // treasury on Ethereum
537        '0x6e690075eedBC52244Dd4822D9F7887d4f27442F', // treasury on BSC        
538        '0x2B065946d41ADf43BBc3BaF8118ae94Ed19D7A40', // treasury on Avalanche
539        '0x47290DE56E71DC6f46C26e50776fe86cc8b21656', // treasury on Polygon
540        '0x9CD50907aeb5D16F29Bddf7e1aBb10018Ee8717d', // treasury on Arbitrum       
541        '0x392AC17A9028515a3bFA6CCe51F8b70306C6bd43', // treasury on Optimism
542        '0x33B3639C51ABA98776673a42B95a02E444a4A9e5', // treasury on Fantom
543      ],
544      icon: 'QmatzgfJ9gKkEiMHft4vNTEfKvP2DGM1eavk1yPP5L3qCJ',
545      iconType: 'image/png',
546      snapshotId: 'stgdao.eth',
547      metadata: {
548        name: 'Stargate Finance',
549        website: 'https://stargate.finance',
550        governanceForum: 'https://commonwealth.im/stargatetoken',
551      }
552    },
553    {
554      id: 'sushi',
555      addresses: ['0xe94b5eec1fa96ceecbd33ef5baa8d00e4493f4f3'],
556      icon: 'QmVAko4auvE2NDr8kfnovVqTqujrJ69YrUZQFPZeREMWk5',
557      snapshotId: 'sushigov.eth',
558      metadata: {
559        name: 'SushiSwap',
560        website: 'https://sushi.com',
561        governanceForum: 'https://forum.sushi.com/',
562        governanceModel: '',
563      },
564    },
565    {
566      id: 'synthetix',
567      addresses: [
568        '0xEb3107117FEAd7de89Cd14D463D340A2E6917769', // synthetix DAO
569        '0xeb9a82736cc030fC4A4CD4b53e9B2c67e153208d', // grants council
570        '0x99f4176ee457afedffcb1839c7ab7a030a5e4a92', // treasury council
571      ],
572      icon: 'QmYPqFXTqYcynD5hT9sZbsoPZXbvjSfL7WWQPL7EwYAyE5',
573      metadata: {
574        name: 'Synthetix',
575        website: 'https://synthetix.io',
576        governanceSite: 'https://staking.synthetix.io/gov',
577        governanceForum: 'https://research.synthetix.io',
578        governanceModel: '',
579      },
580    },
581    {
582        id: 'tempus',
583        addresses: [
584            '0xf41f9fC0B622Eb112445fD7b32fc5190d0c0D3f4', // Treasury
585        ],
586        vestingAddresses: [
587            '0xCa65E71EE7Fb8E85eDe0E7Ef30F029efa8FE4a08', // Vesting Contract
588        ],
589        icon: 'QmQTDzja23zxUd52KEE3ErVCvFLWdjH2RdmqTUR8hTaPZZ',
590        snapshotId: 'tempusgov.eth',
591        metadata: {
592            name: 'Tempus',
593            website: 'https://tempus.finance/',
594            governanceSite: 'https://vote.tempus.finance/',
595            governanceForum: 'https://forum.tempus.finance/',
596        },
597    },
598    {
599      id: 'tornado',
600      addresses: ['0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce'],
601      vestingAddresses: ['0x179f48C78f57A3A78f0608cC9197B8972921d1D2'],
602      icon: 'QmeUzPPCdpqEYArWyMdUVZJk4GUmuR4TAkK6U4eb9vZDPa',
603      metadata: {
604        name: 'Tornado Cash',
605        website: 'https://tornado.cash',
606        governanceSite: 'https://app.tornado.cash/governance',
607        governanceForum: 'https://torn.community',
608        governanceModel: '',
609      },
610    },
611    {
612      id: 'uniswap',
613      addresses: [
614        '0x1a9c8182c09f50c8318d769245bea52c32be35bc', // treasury
615      ],
616      vestingAddresses: [
617        '0x4750c43867ef5f89869132eccf19b9b6c4286e1a',
618        '0xe3953d9d317b834592ab58ab2c7a6ad22b54075d',
619        '0x4b4e140d1f131fdad6fb59c13af796fd194e4135',
620        '0x3d30b1ab88d487b0f3061f40de76845bec3f1e94',
621      ],
622      icon: 'QmPXoiG66a9gCDX1NX51crWV7UAijoFd5wycHrfRKM6Y1n',
623      metadata: {
624        name: 'Uniswap',
625        website: 'https://uniswap.org',
626        governanceSite: 'https://app.uniswap.org/#/vote',
627        governanceForum: 'https://gov.uniswap.org',
628        governanceModel: '',
629      },
630      getProposals: async (sdk: Context) => {
631        const query = `{
632          proposals(
633            first: 5,
634            orderBy: creationTime,
635            orderDirection: desc
636          ) {
637            id
638            description
639            creationTime
640            status
641          }
642        }`
643        const { proposals } = await sdk.graph.query('arr00/uniswap-governance-v3', query);
644        return proposals.map((proposal: any) => ({
645          title: proposal.description.split(/\n|  /)[0],
646          start: proposal.creationTime,
647          state: proposal.status,
648          link: `https://app.uniswap.org/#/vote/${proposal.id.replace('.', '/')}`,
649        }))
650      }
651    },
652    {
653      id: 'unslashed',
654      addresses: ['0xf5be8b4c82b8a681bacf357cfb712ab9e9296cb2'],
655      icon: 'QmUjoauefQRJZCoEbDL7wRQYGkr4FbpYfHu4HC7LLJ4Qmc',
656      iconType: 'image/jpg',
657      snapshotId: 'unslashed.eth',
658      metadata: {
659        name: 'Unslashed Finance',
660        website: 'https://unslashed.finance/',
661        governanceForum: 'https://forum.unslashed.finance/',
662      },
663    },
664    {
665      id: 'yam',
666      addresses: [
667        '0x97990B693835da58A281636296D2Bf02787DEa17', // treasury
668        '0xd67c05523d8ec1c60760fd017ef006b9f6e496d0', // sushiTreasury
669        '0x205cc7463267861002b27021c7108bc230603d0f', // stakedDPI
670        '0xd67c05523d8ec1c60760fd017ef006b9f6e496d0', // randomHoldings
671      ],
672      icon: 'QmcPjtA1Q9QhnAeruXkrsYU3HZ5b8sm3eU78VUjHDXhior',
673      iconType: 'image/png',
674      snapshotId: 'yam',
675      metadata: {
676        name: 'Yam Finance',
677        website: 'https://yam.finance',
678        governanceForum: 'https://forum.yam.finance',
679        governanceModel: '',
680      },
681    },
682    {
683      id: 'yearn',
684      addresses: [
685        '0xfeb4acf3df3cdea7399794d0869ef76a6efaff52', // ychad.eth
686        '0x93A62dA5a14C80f265DAbC077fCEE437B1a0Efde', // treasury.ychad.eth
687        '0xd42e1cb8b98382df7db43e0f09dfe57365659d16', // DSProxy
688      ],
689      icon: 'QmYGdvDA6jM5AV1yBvQKUAz74wqGeBUwVohBWEgbwqXpjk',
690      snapshotId: 'yearn',
691      metadata: {
692        name: 'Yearn',
693        website: 'https://yearn.finance',
694        governanceForum: 'https://gov.yearn.finance',
695        governanceModel: '',
696      },
697    },
698    {
699      id: 'aura',
700      addresses: ['0xfc78f8e1af80a3bf5a1783bb59ed2d1b10f78ca9'],
701      icon: 'QmciKQazuPRpAoyQyjgzfrSisTKUwEok4i2tiKinVJhCCt',
702      iconType: 'image/png',
703      snapshotId: 'aurafinance.eth',
704      metadata: {
705        name: 'Aura Finance',
706        website: 'https://aura.finance/',
707        governanceForum: 'https://vote.aura.finance/',
708        governanceModel: '',
709      },
710    }
711  ];
712
713  async function getSnapshotProposals(id: string) {
714    const response = await sdk.http.post('https://hub.snapshot.org/graphql', {
715      query: `query Proposals($space: String!) {
716        proposals (
717          first: 5,
718          skip: 0,
719          where: { space_in: [$space] },
720          orderBy: "created",
721          orderDirection: desc
722        ) {
723          id
724          title
725          start
726          end
727          state
728          link
729        }
730      }`,
731      variables: { space: id },
732    });
733
734    return response.data.proposals;
735  }
736
737  const getPortfolio = async (addresses: string[]): Promise<any> => {
738    const portfolios = await Promise.all(addresses.map(address => 
739      sdk.http.get(`https://portfolio-api.cryptostats.community/api/${address}`)
740    ));
741
742    const finalPortfolio: PortfolioAsset[] = [];
743    const assetsByAddr: { [address: string]: PortfolioAsset } = {};
744
745    for (const portfolio of portfolios) {
746      for (const item of portfolio.holdings) {
747        if (assetsByAddr[item.address]) {
748          assetsByAddr[item.address].amount += item.amount;
749          assetsByAddr[item.address].value += item.value;
750        } else {
751          const asset = {
752            address: item.address,
753            amount: item.amount,
754            name: item.name,
755            symbol: item.symbol, 
756            icon: null, 
757            price: item.price,
758            value: item.value,
759          };
760          assetsByAddr[item.address] = asset;
761          finalPortfolio.push(asset);
762        }
763      }
764    }
765
766    return finalPortfolio;
767  }
768
769  const createTreasuryLoader = (addresses: string[]) => async () => {
770    const portfolio = await getPortfolio(addresses)
771
772    let totalValue = 0;
773
774    for (const portItem of portfolio) {   
775      totalValue += portItem.value;
776    }
777
778    return totalValue
779  }
780
781  const createPortfolioLoader = (addresses: string[], vestingAddresses?: string[]) => async () => {
782    const [portfolio, vestingPortfolio] = await Promise.all([
783      getPortfolio(addresses),
784      vestingAddresses ? getPortfolio(vestingAddresses) : []
785    ]);
786
787    const fullPortfolio: PortfolioAsset[] = [
788      ...portfolio,
789      ...vestingPortfolio.map(asset => {
790        asset.vesting = true;
791        return asset;
792      }),
793    ];
794
795    return fullPortfolio;
796  };
797
798  for (const org of orgs) {
799    let recentProposals = async () => []
800    if (org.getProposals) {
801      recentProposals = () => org.getProposals!(sdk)
802    } else if (org.snapshotId) {
803      recentProposals = () => getSnapshotProposals(org.snapshotId!)
804    }
805
806    sdk.register({
807      id: org.id,
808      queries: {
809        currentTreasuryUSD: createTreasuryLoader([...org.addresses, ...(org.vestingAddresses || [])]),
810        currentLiquidTreasuryUSD: createTreasuryLoader(org.addresses),
811        currentTreasuryPortfolio: createPortfolioLoader(org.addresses, org.vestingAddresses),
812        recentProposals,
813      },
814      metadata: {
815        ...org.metadata,
816        governanceSite: org.snapshotId
817          ? `https://snapshot.org/#/${org.snapshotId}`
818          : org.governanceSite || null,
819        icon: org.icon ? sdk.ipfs.getDataURILoader(org.icon, org.iconType || 'image/svg+xml') : 0,
820        category: 'app',
821        treasuries: [...org.addresses, ...(org.vestingAddresses || [])],
822      },
823    });
824  }
825}
826

It's something off?

Report it to the discussion board on Discord, we will take care of it.

Adapter Info

Version

0.3.1

License

MIT

IPFS CID

QmYC9pfVkWrR7r3X68VcDEqxB4k51iaGcLgvfFAxYsW3kh

CID (source)

QmVnMrUvavW6hos1rRb8E9vSxugSa3u2gfes59nEiiFZQJ

Collections

Author

mihal.eth