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

Add TradingStrategy.ai #9966

Closed

Conversation

miohtama
Copy link

Internal PR to see what CI says

@llamatester
Copy link

The adapter at projects/trading-strategy exports TVL:

polygon                   13.28 k
ethereum                  0
bsc                       0
base                      0
arbitrum                  0

total                    13.28 k 

Copy link
Member

@g1nt0ki g1nt0ki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, your app has two issues, the open strategies are enzyme contracts, which we already count as part of enzyme tvl

And the hot wallets being hot wallets, we cant include as tvl. So, I am not sure if we can list you :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be reduced to

const { getConfig } = require('../helper/cache')

const chains = ["ethereum", "polygon", "base", "bsc", "arbitrum"]

chains.forEach(chain => {
  module.exports[chain] = {
    tvl: async (api) => {
      const { strategies } = await getConfig('trading-strategy', 'https://tradingstrategy.ai/strategies/tvl')
      const vaults = Object.values(strategies).filter(strat => strat.chain_id === api.chainId && strat.asset_management_mode === 'enzyme').map(i => i.address)
      const tokens = await api.multiCall({ abi: 'address[]:getTrackedAssets', calls: vaults })
      return api.sumTokens({ ownerTokens: tokens.map((t, i) => [t, vaults[i]])})
    }
  }
})

Copy link
Author

@miohtama miohtama Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for getting back @g1nt0ki.

What if I exclude our vaults from Enzyme adapter? I can speak with Enzyme about this, as we are in good terms.

We can also label them Trading Strategy + Enzyme.

There are couple of other digital asset management protocols who have a similar set up and wish we can find a solution for this.

@g1nt0ki g1nt0ki self-assigned this Apr 25, 2024
@miohtama
Copy link
Author

@g1nt0ki ping here - please see the question above

@g1nt0ki
Copy link
Member

g1nt0ki commented Apr 29, 2024

hi @miohtama sorry for the delayed response. Trying to understand the product a bit more, how does TradingStrategy UI interact with emzyme contracts, directly? or you have deployed your own contracts, that act as proxy/controller?

@miohtama
Copy link
Author

miohtama commented May 20, 2024

Thank you for your response @g1nt0ki

  • We use Enzyme vaults
  • You can interact the same vaults through Enzyme frontend and TradingStrategy.ai frontend
  • Vaults that are Trading Strategy enabled have a special configuration on Enzyme - it is an extensible protocol after all
  • The per-vault customisations and configuration changes enabled to have oracle-based asset manager (instead of "human" asset managers that's Enzyme default)
  • There are our own contracts deployed, but they are set as guard and asset manager roles in Enzyme vaults, the core Comproller and Vault contracts are still Enzyme defaults (they are immutable, they cannot be changed in fact)

Hope this helps.

Also I believe you might run into similar questions with Uniswap v4, as multiple protocols are building on the top of its hooks.

@g1nt0ki
Copy link
Member

g1nt0ki commented May 21, 2024

hi @miohtama

Sorry, we cant show tvl in that case. But do you charge some fees? if so, we can pull and show the revenue/fee metric.

Checked with the team, same will be applicable to the teams building on top of uni v4.

@g1nt0ki g1nt0ki closed this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants