mirror of
https://github.com/uniwhale-io/DefiLlama-yield-server.git
synced 2026-01-12 22:45:36 +08:00
* migration * remove balancer pools from exclusion list * bug fix serverless * remove timestamp from median, update for tests * update get distinct id controller * update distinctID controller, remove dep * move confirm into scripts * testing url * remove Pg suffix from lambda names * change to existing api host * add comments * revert service name, bucketsg * put pack fantom rpc
22 lines
608 B
JavaScript
22 lines
608 B
JavaScript
const fs = require('fs');
|
|
const crypto = require('crypto');
|
|
|
|
const data = JSON.parse(fs.readFileSync('./yield_snapshot_last.json'));
|
|
const uniquePools = new Set(data.map((p) => p.pool));
|
|
console.log('nb of unique pools: ', uniquePools.size);
|
|
|
|
const uuidMapping = {};
|
|
for (const pool of uniquePools) {
|
|
uuidMapping[pool] = crypto.randomUUID();
|
|
}
|
|
console.log(
|
|
'nb of unique pools in mapping: ',
|
|
new Set(Object.keys(uuidMapping)).size
|
|
);
|
|
console.log(
|
|
'nb of unique uuids in mapping: ',
|
|
new Set(Object.values(uuidMapping)).size
|
|
);
|
|
|
|
fs.writeFileSync('./created_uuids.json', JSON.stringify(uuidMapping));
|