What it offers
- deposit: Deposit token pair into Gamma Hypervisor via UniProxy
- withdraw: Withdraw liquidity from Hypervisor
Notes
- Each Hypervisor is a vault for a specific token pair
- Deposit via UniProxy (not directly on Hypervisor) - UniProxy handles deposit ratio enforcement
- Use getDepositAmount() to find correct token1 amount for your token0 deposit
- The uint256[4] minIn/minAmounts array provides slippage protection (use zeros for no limit)
- Approve both token0 and token1 to UniProxy before depositing
- The Ethereum UniProxy is an older deployment; its
deposithas nominIn: call it throughUniProxyLegacyABI,deposit(deposit0, deposit1, to, pos).
Its names in a program
On Ethereum,Gamma is a namespace: its contracts need no import.
Deployments
ABI
HypervisorABI
import HypervisorABI from "./protocols/gamma/HypervisorABI.json";
withdraw(uint256 shares, address to, address from, uint256[4] minAmounts) returns (uint256 amount0, uint256 amount1)balanceOf(address account) view returns (uint256)totalSupply() view returns (uint256)getTotalAmounts() view returns (uint256 total0, uint256 total1)
UniProxyABI
import UniProxyABI from "./protocols/gamma/UniProxyABI.json"; Speaks for: uniProxy.
deposit(uint256 deposit0, uint256 deposit1, address to, address pos, uint256[4] minIn) returns (uint256 shares)getDepositAmount(address pos, address token, uint256 _deposit) view returns (uint256 amountStart, uint256 amountEnd)
UniProxyLegacyABI
import UniProxyLegacyABI from "./protocols/gamma/UniProxyLegacyABI.json"; Speaks for: uniProxy.
deposit(uint256 deposit0, uint256 deposit1, address to, address pos) returns (uint256 shares)getDepositAmount(address pos, address token, uint256 _deposit) view returns (uint256 amountStart, uint256 amountEnd)
Next steps
- Protocols: the other protocols, by what they do.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Glossary: the words these pages use, in plain terms.
