G-Derivatives

G-Derivatives are Databases of Balances and Prices with extra Scalability (interfaces).

a special ERC1155 contract

Balances

Acts as a Database for the amount of staked Ether that is represented by multiple Maintainers.

Balances for the depositors are tracked with a predetermined ID. IDs are the main separators of the different types of gETH, thus different maintainers.

mapping(uint256 => mapping(address => uint256)) private _balances;

Pricing

The balance of users, doesn’t change while the amount of the underlying tokens increase over time thanks to Staking Rewards.

Every different ID of gETH has a different _pricePerShare value.

mapping(uint256 => uint256) private _pricePerShare;

_pricePerShare

Basically, a variable that represents the equivalent of 1 gETH, in terms of underlying Ether.

_pricePerShare is used by Geode on minting / burning operations, and can be used by other contracts with peace of mind.

It's value is updated by an Oracle.

πŸ”­Oracles

The _pricePerShare parameter is one of the key components that supports DeFi.

Interfaces

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 Derivative 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 assets for different purposes. Unlocking infinite flexibility!

mapping(uint256 => mapping(address => bool)) private _interfaces;
  function _doSafeTransferAcceptanceCheck(...) private {
    if (to.isContract() && !isInterface(operator, id)) 
    {
    ...
    }

Learn more about other cool gETH functionalities:

gETH vs gAVAX

See our case studies about some interfaces here:

🎭Current Interfaces

Last updated