Geode Finance

Connect Your Frontend

Connect to Fuji

User Operations

What is your ID ?

At this point your ID will be shared with you by our Developers after the approval of the Senate.
You can easily check your id with the following function:
Portal.getIdFromName( {your name} )

Get Important Stats about your Planet from Portal

gAVAX address


Maintainer Address

Portal.getMaintainerFromId(uint256 id);

Maintainer fee as a percentage

Portal.getMaintainerFeeFromId(uint256 id) / Portal.getFeeDenominator() * 100 ;

Current ERC1155 Interface

Note, this function can be used in your frontend but you should probably hard code your Interfaces, as you can have multiple interfaces and this function is not reliable for most cases.
Portal.planetCurrentInterface(uint256 id);

Withdrawal Pool address

Portal.planetWithdrawalPool(uint256 id);

Withdrawal Pool LP token address

Portal.planetLPToken(uint256 id);

Current activeOperator

Portal.planetActiveOperator(uint256 id);
Note, there can be multiple operators that are still operating on your pool. Please refer to the next code for such cases:
// get all operators( type 4 )
allOps = Portal.getIdsByType(4);
uint256 planetId,
uint256 allOps[i] ) <= now.timestamp
return currentOperators;
Currently we are working on Avalanche Portal to improve Staking Pool - Node Operator interactions. With an incoming update, Portal will adopt the Open Market approach that is implemented in Ethereum.
Which means activeOperator approach will be abandoned soon.
Learn more here:

Last reported OraclePrice

Portal.planetOraclePrice( uint256 planetId );

Surplus and Debt

Portal.planetClaimableSurplus(uint256 planetId);
Portal.planetDebt(uint256 planetId);

Staking might be paused for your Pool (only by your Maintainer)

Portal.isStakingPausedForPool(uint256 planetId);


The Portal finds the best price for your users, however it is not always predictable. We advise trusting the Oracle Price as the "minimum amount" that will be received by the staker. However, while we make sure it will not be lower than that, it can be drastically more than that according to the debt of your pool. We have not implemented any functions to guess the output.

Easy way of calculating:

price = Portal.planetOraclePrice( uint256 planetId );
return AvaxStakedAmount / price * 1e18;

A better way of calculating:

WPaddress= Portal.planetWithdrawalPool(uint256 id);
WPool = web3.eth.Contract( abi, WPaddress );
debt = Portal.planetDebt(uint256 planetId);
if( AvaxStakedAmount <= debt )
// In such case take a look at the second code piece that routes directly to WP
return WPool.calculateSwap(AvaxStakedAmount );
buyAmount = WPool.calculateSwap(debt);
mintAmount = (AvaxStakedAmount - debt) / price * 1e18;
return buyAmount + mintAmount ;


uint256 planetId,
uint256 minGavax,
uint256 deadline
If AvaxStakedAmount <= debt, you can route your use directly to WP and save them gas fees :)
WPaddress= Portal.planetWithdrawalPool(uint256 id);
WPool = web3.eth.Contract( abi, WPaddress );
0, // caution 0(avax) to 1(gAVAX)
uint256 amount,
uint256 minGavax,
uint256 deadline


There is no complexity as all withdrawals finalize in the Withdrawal Pools.
WPaddress= Portal.planetWithdrawalPool(uint256 id);
WPool = web3.eth.Contract( abi, WPaddress );
1, // caution 1(gAVAX) to 0(avax)
uint256 amount,
uint256 minGavax,
uint256 deadline