Gloop
WebsiteTwitterDiscord
  • gLoop Litepaper v2
    • Introduction
    • The Two Tokens
    • Roadmap
  • PRODUCTS
    • GM Index
      • Providing/Removing Liquidity
      • Fees and Reflection
      • Deposit/Withdrawal Examples
    • GM Lend/Borrow
      • Lending USDC
      • Depositing Collateral Assets
      • Withdrawing Assets
      • Borrowing USDC
      • Repaying Debt
      • gLooping GM Assets
      • Position Management
        • Withdrawing Assets
        • Health Factor and Liquidations
      • Lending/Borrowing GMI (Coming Soon)
      • Frequently Asked Questions (FAQs)
    • GLOOP Staking (Coming Soon)
  • GM Points (COMING SOON)
  • Technical
    • Gloop Protocol Parameters
    • Gloop Parameters
    • Contracts
      • GM Lending and Looping
        • GM Lending Pool
        • GM Price Oracle
        • GM Vaults
        • GM Interest Rate Model
        • GM Incentives
      • GMI
        • GM Index
        • GMI USDC Zap
        • Token Banks
        • Token Oracles
        • Fees
  • FREQUENTLY ASKED QUESTIONS (FAQs)
    • GM Index (GMI)
    • GM Lending/Looping
    • GLOOP Staking (Coming Soon)
  • GLoop Ecosystem
    • Tokenomics
  • Security and Risk
    • Risks
    • Audits
  • Social
    • Socials
Powered by GitBook
On this page
  • migrate
  • deposit
  1. Technical
  2. Contracts
  3. GMI

Token Banks

How the token banks work

PreviousGMI USDC ZapNextToken Oracles

Last updated 7 months ago

Before an asset is added to the Index, a bank contract for the token needs to be deployed. At deployment, the constructor stores the _manager address and the IERC20 interface type of the _token. The _manager address will normally be the address of the GM Index. The constructor then approves the manager to spend any amount of the token on behalf of the Bank. Once the token’s bank contract has been deployed, and a GM market and price oracle contract exist for the token, the token can be added to the Index (see main section for adding tokens).

migrate

function migrate(address newVault) external

Transfers all tokens in the Bank contract to a new Bank contract. This function can only be called by the manager.

Parameters:

Name
Type
Description

newVault

address

The address of the new Bank contract that all tokens will be transferred to

deposit

function deposit(uint256 _amount) external

Deposits an _amount of tokens into the Bank contract. This function can only be called by the manager, which is normally the GM Index contract. The tokens are sent from the depositor to the GM Index and then immediately sent to the token’s Bank contract.

Parameters:

Name
Type
Description

_amount

uint256

The amount of tokens to deposit

GM Index