Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DefiLlama/DefiLlama-Adapters
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: yoko-live/DefiLlama-Adapters
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 10, 2025

  1. Add files via upload

    yoko-live authored Jan 10, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    0413c7d View commit details

Commits on Jan 13, 2025

  1. code refactor

    g1nt0ki committed Jan 13, 2025
    Copy the full SHA
    29d6a75 View commit details
Showing with 19 additions and 0 deletions.
  1. +1 −0 projects/helper/utils.js
  2. +18 −0 projects/yoko-live/index.js
1 change: 1 addition & 0 deletions projects/helper/utils.js
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ function isLP(symbol, token, chain) {
if (chain === 'ethereumclassic' && symbol === 'ETCMC-V2') return true
if (chain === 'shibarium' && ['SSLP', 'ChewyLP'].includes(symbol)) return true
if (chain === 'omax' && ['OSWAP-V2'].includes(symbol)) return true
if (chain === 'sonic' && symbol.endsWith(' spLP')) return true
let label

if (symbol.startsWith('ZLK-LP') || symbol.includes('DMM-LP') || (chain === 'avax' && 'DLP' === symbol) || symbol === 'fChe-LP')
18 changes: 18 additions & 0 deletions projects/yoko-live/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { sumTokens2 } = require("../helper/unwrapLPs");

const AGENT_FACTORY_ADDRESS = "0xc4aA72712E22D06fBdF54b5413d4270B1A965Ef2";

async function tvl(api) {
const agents = await api.fetchList({ lengthAbi: 'totalAgents', itemAbi: 'allAgentTokens', target: AGENT_FACTORY_ADDRESS })
const veTokens = await api.fetchList({ lengthAbi: 'totalAgents', itemAbi: 'allVeTokens', target: AGENT_FACTORY_ADDRESS })
const liquidityPools = await api.multiCall({ abi: 'address[]:liquidityPools', calls: agents })
const ownerTokens = veTokens.map((agent, i) => [liquidityPools[i], agent])
return sumTokens2({ ownerTokens, api, resolveLP: true, })
}

module.exports = {
methodology: "Calculates TVL by summing the value of all tokens in UniV2 liquidity pools associated with agent tokens",
sonic: {
tvl
}
};