Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Desyn strategy Pools #12136

Merged
merged 92 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
a60ba76
add desyn protocol
santinoYoung Dec 21, 2023
50f19c2
update lpposition token
santinoYoung Dec 21, 2023
1e8bda7
Update index.js
santinoYoung Dec 21, 2023
439f98d
Update index.js
santinoYoung Dec 21, 2023
cfa6529
add tvl
santinoYoung Dec 21, 2023
324b3bb
Update index.js
santinoYoung Dec 21, 2023
a6535f2
code refactor
g1nt0ki Dec 21, 2023
0561dfb
update desyn chain
santinoYoung Jun 21, 2024
4f87ed8
update desyn chain
santinoYoung Jun 21, 2024
fa84f71
update bitlayer chain
santinoYoung Jul 2, 2024
e6c4f82
disable merlin
g1nt0ki Jul 3, 2024
cb2a180
Merge branch 'main' into desyn
g1nt0ki Jul 3, 2024
1967a18
add desyn hallmarks
santinoYoung Jul 4, 2024
fd8b504
add desyn restaking and desyn yeild Methodology
santinoYoung Jul 8, 2024
3f9bd0e
Merge branch 'main' into desyn
santinoYoung Jul 9, 2024
775bcc8
update bitlayer doublecounted is false
santinoYoung Jul 16, 2024
65c9c54
update bitlayer doublecounted
santinoYoung Jul 16, 2024
32c3362
update bitlayer doublecounted
santinoYoung Jul 16, 2024
8851818
update desyn mode chain
santinoYoung Jul 19, 2024
c679703
Merge branch 'main' into desyn
santinoYoung Jul 19, 2024
1ccf6a9
reset methodology text
santinoYoung Jul 20, 2024
a256542
Merge branch 'desyn' of https://github.com/santinoYoung/DefiLlama-Ada…
santinoYoung Jul 20, 2024
ed607f3
add desyn zhlink chain
santinoYoung Aug 2, 2024
8d25e1c
Merge branch 'main' into desyn
santinoYoung Aug 2, 2024
36fda05
update add core chain factory
santinoYoung Oct 18, 2024
4cbaf72
Merge branch 'main' into desyn
santinoYoung Oct 18, 2024
5a92032
update core add doublecounted
santinoYoung Oct 25, 2024
4c93684
Merge branch 'desyn' of https://github.com/santinoYoung/DefiLlama-Ada…
santinoYoung Oct 25, 2024
6856246
Merge branch 'main' into desyn
santinoYoung Oct 25, 2024
95cb497
redution core chain doublecounted
santinoYoung Oct 25, 2024
834082f
Merge branch 'desyn' of https://github.com/santinoYoung/DefiLlama-Ada…
santinoYoung Oct 25, 2024
3c4a9e9
add core strategy pool
santinoYoung Oct 25, 2024
ee725d1
update get pool tokens
santinoYoung Oct 25, 2024
d3075b9
update tvl
santinoYoung Oct 25, 2024
cb706e4
update return value total
santinoYoung Oct 28, 2024
1b03486
update sumTokens
santinoYoung Oct 28, 2024
f4b3194
update tvl
santinoYoung Oct 28, 2024
abee5c4
update tvl
santinoYoung Oct 28, 2024
dd89cbf
tvl total
santinoYoung Oct 28, 2024
a151825
update tvl
santinoYoung Oct 28, 2024
96e632f
desyn tvl
santinoYoung Oct 28, 2024
be9b368
update
santinoYoung Oct 28, 2024
1775433
desyn tvl update
santinoYoung Oct 28, 2024
2ada524
update abi
santinoYoung Oct 28, 2024
edfeafc
update tvl
santinoYoung Oct 28, 2024
8e0ed02
update getbalance
santinoYoung Oct 28, 2024
df17cc6
.
santinoYoung Oct 28, 2024
e8de60b
update farm
santinoYoung Oct 28, 2024
2f3bcbc
desyn mode getbalance
santinoYoung Oct 28, 2024
0dab4c9
muticall target pools
santinoYoung Oct 28, 2024
7b21ba1
update tvl
santinoYoung Oct 28, 2024
f903eab
api call
santinoYoung Oct 28, 2024
048684a
api call
santinoYoung Oct 28, 2024
9620618
api muticall
santinoYoung Oct 28, 2024
3633595
update multicall
santinoYoung Oct 28, 2024
c782b8b
update multicall
santinoYoung Oct 28, 2024
75ec592
update multicall
santinoYoung Oct 28, 2024
e26d95b
update multicall
santinoYoung Oct 28, 2024
941b7b0
update getBalance
santinoYoung Oct 28, 2024
811629b
update getBalance
santinoYoung Oct 28, 2024
30814cc
update getBalance
santinoYoung Oct 28, 2024
b7cfc9b
update getBalance
santinoYoung Oct 28, 2024
06e8ae5
update getBalance
santinoYoung Oct 28, 2024
030d325
update getBalance
santinoYoung Oct 28, 2024
07ec47c
update getBalance
santinoYoung Oct 28, 2024
3080ba3
update getBalance
santinoYoung Oct 28, 2024
8983e0f
update getBalance
santinoYoung Oct 28, 2024
40107fc
update getBalance
santinoYoung Oct 28, 2024
a281777
update getBalance
santinoYoung Oct 28, 2024
72f21fb
code refactor
g1nt0ki Oct 28, 2024
cbd9fc2
update getBalance
santinoYoung Oct 28, 2024
8c62f3a
update getBalance
santinoYoung Oct 28, 2024
3a655b8
bugfix
g1nt0ki Oct 28, 2024
a791f07
update getBalance
santinoYoung Oct 28, 2024
7d5fbe2
Merge branch 'desyn' of https://github.com/santinoYoung/DefiLlama-Ada…
santinoYoung Oct 28, 2024
f3dc77d
bugfix
g1nt0ki Oct 28, 2024
6132df2
update ethereum and arbitrum tvl calculation
santinoYoung Oct 30, 2024
cd84db4
reset hallmarks
santinoYoung Oct 30, 2024
1b82a9c
Merge branch 'main' into desyn
santinoYoung Oct 30, 2024
0b55dea
update aSTETH TVL
santinoYoung Oct 30, 2024
164ad6c
Merge branch 'desyn' of https://github.com/santinoYoung/DefiLlama-Ada…
santinoYoung Oct 30, 2024
c565dbd
bitlayer delete methodology
santinoYoung Oct 31, 2024
4ac786f
readd doublecounted
santinoYoung Oct 31, 2024
c416c4e
update desyn strategy pools
santinoYoung Nov 1, 2024
31ca6fb
eslint Mixed spaces and tabs no-mixed-spaces-and-tabs
santinoYoung Nov 1, 2024
247b2a3
update rest api config pool
santinoYoung Nov 4, 2024
9f847e0
update tvl
santinoYoung Nov 4, 2024
5c83936
modified rest api config pool
santinoYoung Nov 4, 2024
890ee14
update desyn rest api stragegy pools
santinoYoung Nov 5, 2024
807f9f2
code refactor
g1nt0ki Nov 7, 2024
a121fc0
update chain array
santinoYoung Nov 8, 2024
e7063e5
.
santinoYoung Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions projects/desyn-basisTrading/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { getTvlFunction, chains } = require("../desyn-farm/helper");

module.exports = {
doublecounted: true,
methodology: 'Combines on-chain airdrops with stable returns from basis trading on Binance.',
}

chains.forEach(chain => {
module.exports[chain] = {
tvl: getTvlFunction('StrategyType3', true)
}
})
59 changes: 59 additions & 0 deletions projects/desyn-farm/helper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const { getConfig } = require('../helper/cache')

const chains = ["ethereum", "arbitrum", "btr", "mode", "zklink", "core", "ailayer", "linea", "merlin", "scroll"];

const abi = {
getBalance: "function getBalance(address) view returns (uint256)"
}

async function getInfoListPool(strategy_type, chain) {
const data = await getConfig('desyn/' + strategy_type, `https://api.desyn.io/etf/defillama/get_pool_list?strategy_type=${strategy_type}`)
return data.data.config[chain]?.safePools
}

// This is aSTETH,
// before the design of the semi-closed soETH,
// the contract in order to limit the closure of the time,
// the user can still deposit,
// so he was given a maximum value of the balance,
// which will become negative after adding any number, blocking the user to put in
const leverageStaking = '0x1982b2F5814301d4e9a8b0201555376e62F82428'


function getTvlFunction(strategy_type, isDoubleCounted) {
return async (api) => {
const pools = await getInfoListPool(strategy_type, api.chain)
if (!pools?.length) return;
const tokens = await api.multiCall({ abi: 'address[]:getCurrentTokens', calls: pools })
const calls = []
const tokensAndOwners = []
const allTokens = []
let i = 0

for (const pool of pools) {
for (const token of tokens[i]) {
if (!isDoubleCounted) {
tokensAndOwners.push([token, pool])
} else {
calls.push({ target: pool, params: token })
allTokens.push(token)
}
}
i++
}

if (!isDoubleCounted) return api.sumTokens({ tokensAndOwners })

const allBals = await api.multiCall({ abi: abi.getBalance, calls })
api.add(allTokens, allBals)

if (strategy_type === 'StrategyType2')
api.removeTokenBalance(leverageStaking)
}
}


module.exports = {
getTvlFunction,
chains
}
46 changes: 9 additions & 37 deletions projects/desyn-farm/index.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,16 @@
const { getLogs } = require('../helper/cache/getLogs')
const { getTvlFunction, chains } = require("./helper");

module.exports = {
doublecounted: true,
methodology: 'On-chain restaking',
hallmarks: [
[1719734400, "Launched on Merlin Chain"],
[1718092800, "DeSyn KelpDAO Restaking Fund Launched"],
[1713340800, "Restaking Fund Series Launched"]
],
methodology: 'Focused on airdrops from DeSyn and new chains.',
}

const config = {
merlin: { factory: '0x790b4ee7998A93702f29e56f8b615eF35BE5af43', fromBlock: 11260440},
}

const abi = {
getBalance: "function getBalance(address) view returns (uint256)"
}

Object.keys(config).forEach(chain => {
const {factory, fromBlock, } = config[chain]
chains.forEach(chain => {
module.exports[chain] = {
tvl: async (api) => {
const logs = await getLogs({
api,
target: factory,
eventAbi: 'event LOG_NEW_POOL (address indexed caller, address indexed pool)',
onlyArgs: true,
fromBlock,
})

const pools = logs.map(i=>i.pool)
const tokens = await api.multiCall({ abi: 'address[]:getCurrentTokens', calls: pools})
const calls = []
const allTokens = []
let i = 0
for (const pool of pools) {
for (const token of tokens[i]) {
calls.push({ target: pool, params: token })
allTokens.push(token)
}
i++
}
const allBals = await api.multiCall({ abi: abi.getBalance, calls })
api.add(allTokens, allBals)
}
tvl: getTvlFunction('StrategyType1', false)
}
})
48 changes: 0 additions & 48 deletions projects/desyn-farm1/index.js

This file was deleted.

12 changes: 12 additions & 0 deletions projects/desyn-yieldAggregator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { getTvlFunction, chains } = require("../desyn-farm/helper");

module.exports = {
doublecounted: true,
methodology: 'Engages with DeFi protocols like Lending, DEX, and Restaking, offering both airdrops and structured yield options.',
}

chains.forEach(chain => {
module.exports[chain] = {
tvl: getTvlFunction('StrategyType2', true)
}
})
39 changes: 0 additions & 39 deletions projects/desyn/index.js

This file was deleted.

Loading