Skip to main content

Read

totalAssets

function totalAssets(
) external view returns (uint256 gooTokens, uint256 gobblerMult);

Return Values:

NameTypeDescription
gooTokensuint256The total amount of Goo owned.
gobblerMultuint256The total multiple of all Gobblers owned.

convertToFractions

function convertToFractions(
uint256 gooTokens,
uint256 gobblerMult
) external view returns (uint256 fractions);

Parameters:

NameTypeDescription
gooTokensuint256The amount of Goo to simulate.
gobblerMultuint256The amount of Gobbler mult in to simulate.

Return Values:

NameTypeDescription
fractionsuint256The 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:

NameTypeDescription
fractionsuint256The amount of fractions to simulate converting.

Return Values:

NameTypeDescription
gooTokensuint256The amount of Goo out.
gobblerMultuint256The 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:

NameTypeDescription
_gooReserveuint256The amount of Goo in the tank for the pool.
_gobblerReserveuint256The total multiplier of all Gobblers in the pool.
_blockTimestampLastuint32The 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:

NameTypeDescription
gobblersuint256[]Array of Gobbler ids.
gooTokensuint256Amount of Goo to deposit.

Return Values:

NameTypeDescription
fractionsuint256Amount 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:

NameTypeDescription
gobblersuint256[]Array of Gobbler ids.
gooTokensuint256Amount of Goo to withdraw.

Return Values:

NameTypeDescription
fractionsuint256Amount 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:

NameTypeDescription
gobblersInuint256[]Array of Gobbler ids to swap in.
gooInuint256Amount of Goo to swap in.
gobblersOutuint256[]Array of Gobbler ids to swap out.
gooOutuint256Amount of Goo to swap out.

Return Values:

NameTypeDescription
erroneousGooint256The amount in wei by which to increase or decrease gooIn/Out to balance the swap.