Documentation/Earn and launch

Earn

Put idle USDG into a Morpho vault that lends it out and pays interest every block. Ghostdex lists the vaults with real deposits and lets you deposit and withdraw from your main wallet or from a ghost.

1 min read

What a vault is

A Morpho Vault V2 is a contract that takes deposits of one asset, here USDG, and allocates them to lending markets chosen by its curator. Borrowers pay interest, which raises the value of each vault share. The vault follows the ERC-4626 standard: you receive shares when you deposit and redeem them for USDG when you withdraw.

Ghostdex shows each vault on the chain that holds at least $25,000, with its total deposits, the USDG available to withdraw right now, and its APY after the vault's own performance fee. The figures come from Morpho's public API and refresh every few minutes.

Depositing

  1. 1
    Pick a vault

    Open Earn. Compare APY, size and available liquidity. A larger vault usually has more room to withdraw at any moment.

  2. 2
    Approve USDG

    The vault needs permission to take the amount. The app asks only if your current allowance is too small.

  3. 3
    Deposit

    One transaction calls deposit(assets, onBehalf) on the vault with the signing address, your main wallet or the ghost you act as. Shares arrive at that address.

Withdrawing

Withdraw any amount up to your balance in one transaction. A withdrawal is paid from the USDG the vault has not lent out. When nearly everything is borrowed, a large withdrawal can wait for repayments or new deposits. The available liquidity is shown on each vault.

The rate

APY is the vault's current rate after its fee. It moves with how much is borrowed from the markets the vault lends to, sometimes within a day. It is not a promise and Ghostdex does not set it.

Vault calls
deposit(uint256 assets, address onBehalf) returns (uint256 shares)
withdraw(uint256 assets, address receiver, address onBehalf) returns (uint256 shares)
redeem(uint256 shares, address receiver, address onBehalf) returns (uint256 assets)
// USDG 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168, 6 decimals; vault shares use 18

Ghostdex takes no fee on deposits or withdrawals. The risk is the vault's: its curator's choice of markets, those markets' collateral and oracles, and the contracts themselves.