Understanding gAVAX

gAVAX is a Database of Balances and Prices with extra Scalability

Creation of a Staking Pool requires only two main parameters:
  • Balances of the Stakers
  • Price of the yield bearing asset of the Pool
To achieve this every Staking Pool that is created with Geode Portal, uses a non-upgradable ERC1155 contract, a multi-token standard.
ERC1155 allows Geode to keep track of multiple Staking Pools. gAVAX is just the artificial name of these sets of tokens.


gAVAX acts as a Database for the amount of staked Avax that is represented by multiple Maintainers.
Balances for the depositors of a single type of gAVAX, are tracked with a predetermined ID. IDs are the main separators of the different types of gAVAX, thus different maintainers.
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
Balances can be directly changed by Interfaces that are implemented and approved by the given ID's maintainer.


The balance of users, that is stored in _balances parameter of the gAVAX contract, doesn’t change while the amount of underlying Avax changes, expectedly increasing over time thanks to Staking Rewards.
Every different ID of gAVAX has a different _pricePerShare value.
// shows the underlying Avax for 1 staked Avax for given Representative
mapping(uint256 => uint256) private _pricePerShare;


Basically, a variable that represents the equivalent of 1 x-gAVAX in terms of underlying Avax.
_pricePerShare is used while minting new tokens through Portal and updated by an Oracle contract with the data coming from the Avalanche P-Chain, collected by Telescope.
function setPricePerShare(uint256 pricePerShare_, uint256 _id)
require(hasRole(ORACLE, _msgSender()), "gAVAX: must have ORACLE to set");
_pricePerShare parameter is one of the key components for the support of DeFi.


ERC1155 Interfaces are one of the most important concepts introduced by Geode.fi.
ERC-1155 tokens are not compatible within the DeFi ecosystem, thus they need to be mutated for public usage.
Every gAVAX token has a different use-case, depending on the represented Protocol, therefore it doesn’t come with a preset implementation.
Interfaces are external contracts used to manage the underlying asset(data) for different purposes, allowing Protocols to use the stored data with infinite flexibility!
There can be multiple Interfaces for one gAvax ID.
* Mapping from Representative IDs to interface addresses
mapping(uint256 => mapping(address => bool)) private _interfaces;
Only the Maintainer of a given ID can set new Interfaces.
function _setInterface(
address _Interface,
uint256 _id,
bool isSet
) internal virtual {
_interfaces[_id][_Interface] = isSet;
Transactions that are conducted with Interfaces can bypass the ERC1155 requirements while other non-compatible contracts can not receive them.
function _doSafeTransferAcceptanceCheck(...) private {
if (to.isContract() && !isInterface(operator, id))

See our case studies about gAVAX interfaces here: