Integrating with Glue requires zero code for most projects. Adding collateral to a Glue is as simple as sending tokens - no special functions, no complex implementations, no approvals needed. Just transfer ETH or any ERC20 token to the Glue address, exactly like sending to any other address.
The same simplicity applies to withdrawing collateral. The unglue function needs only three basic parameters:
All the complex math happens automatically inside Glue. No need to calculate proportions, no need to track total supply changes, no need to handle decimals. The protocol handles everything internally.
Glue is designed to work in the real world where code isn't always perfect. Sending an address with zero balance in the withdrawal list? No problem - Glue skips it. Accidentally included the same token address twice? Glue handles it gracefully. Trying to withdraw a token that isn't in the Glue? The transaction continues with the valid tokens.
This robustness means developers don't need to be perfectionists. There's no need to meticulously validate every input or handle every edge case. Glue's contract logic is built to handle messy inputs without breaking or reverting unnecessarily.
One of Glue's most powerful features is its ability to understand and adapt to different token implementations. During the first interaction with a token, Glue learns:
This self-learning happens automatically and gets stored in the contract. Once Glue learns about a token, it remembers the optimal way to handle it forever. No need for developers to specify token characteristics or handle different token standards.
Despite its sophisticated internal mechanics, Glue achieves exceptional gas efficiency. Ungluing multiple tokens costs surprisingly little gas - often withdrawing 5 different tokens from a Glue costs about the same as doing 2 token swaps on Uniswap V2. This efficiency comes from optimized contract design and careful gas considerations in every operation.