mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-01-12 22:43:12 +08:00
Add Punk.Coffee adapter (#16636)
This commit is contained in:
32
projects/punk_coffee/index.js
Normal file
32
projects/punk_coffee/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
const { getLogs } = require('../helper/cache/getLogs');
|
||||
const { sumTokens2 } = require('../helper/unwrapLPs');
|
||||
const ADDRESSES = require('../helper/coreAssets.json');
|
||||
|
||||
const configs = [
|
||||
{ factory: "0xF7262C7eb1737f7701130C0151C0697Ad7c7A94D", fromBlock: 63795651 },
|
||||
]
|
||||
|
||||
const tvl = async (api) => {
|
||||
const logs = []
|
||||
|
||||
for (const { factory, fromBlock } of configs) {
|
||||
console.log(factory, fromBlock)
|
||||
logs.push(await getLogs({
|
||||
api,
|
||||
target: factory,
|
||||
topics: ['0x6aea19a4f371dcfa42b8124294d37b93095008d69bd2bacd16067d364acaddae'],
|
||||
eventAbi: 'event MarketCreated (address indexed creator, uint256 indexed marketId, address indexed marketAddress, (string, uint256, string, uint256, string[], bool))',
|
||||
onlyArgs: true,
|
||||
fromBlock,
|
||||
}))
|
||||
}
|
||||
let markets = logs.flat().map(log => log.marketAddress)
|
||||
console.log(markets)
|
||||
return sumTokens2({ api, owners: markets, token: ADDRESSES.bsc.USDT })
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
bsc: {
|
||||
tvl,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user