Read
totalAssets
function totalAssets(
) external view returns (uint256 gooTokens, uint256 gobblerMult);
Return Values:
Name | Type | Description |
---|---|---|
gooTokens | uint256 | The total amount of Goo owned. |
gobblerMult | uint256 | The total multiple of all Gobblers owned. |
convertToFractions
function convertToFractions(
uint256 gooTokens,
uint256 gobblerMult
) external view returns (uint256 fractions);
Parameters:
Name | Type | Description |
---|---|---|
gooTokens | uint256 | The amount of Goo to simulate. |
gobblerMult | uint256 | The amount of Gobbler mult in to simulate. |
Return Values:
Name | Type | Description |
---|---|---|
fractions | uint256 | The fractions, without any fees assessed, which would be returned for a deposit. |
convertToAssets
function convertToAssets(
uint256 fractions
) external view returns (uint256 gooTokens, uint256 gobblerMult);
Parameters:
Name | Type | Description |
---|---|---|
fractions | uint256 | The amount of fractions to simulate converting. |
Return Values:
Name | Type | Description |
---|---|---|
gooTokens | uint256 | The amount of Goo out. |
gobblerMult | uint256 | The amount of Gobbler mult out. |
getReserves
Gets the vault reserves of Goo and Gobbler mult, along with the last update time.
tip
This can be used to calculate slippage on a swap of certain sizes using Uni V2 style liquidity math.
function getReserves(
) external view returns (uint256 _gooReserve, uint256 _gobblerReserve, uint32 _blockTimestampLast);
Return Values:
Name | Type | Description |
---|---|---|
_gooReserve | uint256 | The amount of Goo in the tank for the pool. |
_gobblerReserve | uint256 | The total multiplier of all Gobblers in the pool. |
_blockTimestampLast | uint32 | The last time that the oracles were updated. |
previewDeposit
Previews a deposit of the supplied Gobblers and Goo.
function previewDeposit(
uint256[] calldata gobblers,
uint256 gooTokens
) external view returns (uint256 fractions);
Parameters:
Name | Type | Description |
---|---|---|
gobblers | uint256[] | Array of Gobbler ids. |
gooTokens | uint256 | Amount of Goo to deposit. |
Return Values:
Name | Type | Description |
---|---|---|
fractions | uint256 | Amount of fractions created. |
previewWithdraw
Previews a withdraw of the requested Gobblers and Goo tokens from the vault.
function previewWithdraw(
uint256[] calldata gobblers,
uint256 gooTokens
) external view returns (uint256 fractions);
Parameters:
Name | Type | Description |
---|---|---|
gobblers | uint256[] | Array of Gobbler ids. |
gooTokens | uint256 | Amount of Goo to withdraw. |
Return Values:
Name | Type | Description |
---|---|---|
fractions | uint256 | Amount of fractions withdrawn. |
previewSwap
Simulates a swap.
function previewSwap(
uint256[] calldata gobblersIn,
uint256 gooIn,
uint256[] calldata gobblersOut,
uint256 gooOut
) external view returns (int256 erroneousGoo);
Parameters:
Name | Type | Description |
---|---|---|
gobblersIn | uint256[] | Array of Gobbler ids to swap in. |
gooIn | uint256 | Amount of Goo to swap in. |
gobblersOut | uint256[] | Array of Gobbler ids to swap out. |
gooOut | uint256 | Amount of Goo to swap out. |
Return Values:
Name | Type | Description |
---|---|---|
erroneousGoo | int256 | The amount in wei by which to increase or decrease gooIn/Out to balance the swap. |