Skip to content

Add Gloop Protocol Adapter #15553

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add Gloop Protocol Adapter #15553

wants to merge 2 commits into from

Conversation

timrolsh
Copy link

Name (to be shown on DefiLlama):

Gloop

Twitter Link:

gloopfinance

List of audit links if any:

https://docs.gloop.finance/security-and-risk/audits

https://4294231757-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO8ZzD5wMG29TFZ8cFA1x%2Fuploads%2F5Ar8ogbj5s0gFw6Pltj4%2Fgloop_gmi_audit_final.pdf?alt=media&token=bedacf89-7591-497c-97d7-a495cd3162a0

https://4294231757-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO8ZzD5wMG29TFZ8cFA1x%2Fuploads%2Fgdtx2WAFxZdJF42WV647%2FGM%20Lending%20Audit%20-%20Final.pdf?alt=media&token=d1af5708-d7db-4ea2-9680-d1075986f3f7

https://4294231757-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO8ZzD5wMG29TFZ8cFA1x%2Fuploads%2FHfhMckdsiXIjzSvzkHDg%2F3_14_25_Gloop_Final_Report.pdf?alt=media&token=00fd2e16-495f-47aa-8c0e-f92dd357fb97

Website Link:

https://gloop.finance/

Logo (High resolution, will be shown with rounded borders):

gloop_img1

Image is an SVG File.

Current TVL:

99.5k-100k ish,

Chain:

Arbitrum only

Short Description (to be shown on DefiLlama):

A DeFi suite consisting of two flagship products: 1. An index token protocol that allows users to invest in a basket of GMX liquidity providing assets by interacting with the protocol's Index contract. It manages various GM assets, calculates their weights, and allows users to mint, burn, and redeem index tokens.

Token address and ticker if any:

GLOOP: 0x4d48d503ed04d50418C9aBF163b1168FF834E47c
GMI: 0xAad4187a81689AF72d91966c8119756E425cD7CF

Category (full list at https://defillama.com/categories) *Please choose only one:

Lending

methodology (what is being counted as tvl, how is tvl being calculated):

Gloop TVL consists of two parts: (1) GMI Index TVL from totalControlledValue() which tracks GM tokens in the index, and (2) GM Lending TVL from totalUnderlying() for each supported token (GM BTC, GM ETH, GM SOL, USDC) in the lending pools.

  • Total TVL:

    • To get GMI TVL, call gmIndex.totalControlledValue(bool) with true as the boolean argument.
    • To get GM Lending TVL, call lendingPool.totalUnderlying(address), and input the address for GM tokens and USDC, so 4 separate calls, and add the result of each call.
    • Then add these two numbers to get total TVL.
  • Total Borrowed: call lendingPool.totalBorrows(address), with USDC address as argument

  • Total Lent: call lendingPool.totalUnderlying(address), with USDC address as argument

@llamabutler
Copy link

The adapter at projects/gloop exports TVL:

arbitrum                  99.78 k

total                    99.78 k 

for (let i = 0; i < maxVaults; i++) {
try {
const vaultName = await api.call({
abi: "function treasuryVaults(uint256) view returns (bytes32)",
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use this string form of abi throughout the rest of the adapter

token !== "0x0000000000000000000000000000000000000000"
) {
// Get the balance in this vault
const vaultBalance = await api.call({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please ensure that the balance used here is supply - borrow (available liquidity)

api.add(token, vaultBalance);
}
}
} catch (e) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please remove all try/catch

// A little after Lending Pool contract was deployed
start: 1744340400,
arbitrum: {
tvl,
Copy link
Collaborator

Choose a reason for hiding this comment

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

please also export a borrowed property, summing the borrowed amounts

@waynebruce0x waynebruce0x self-assigned this Jul 21, 2025
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.

3 participants