Pool

Create a Pool Instance

Geode.Portal.pool(poolID: int)

Initilize the Pool object with an existing pool id:

# You need pool id to create pool object
poolID = 500191....78
myPool = geode.Portal.pool(poolID)

Pool Ownership

property Pool.NAME

NAME is the name of the pool that given from creator of the pool.

myPool.NAME
# Ice Pool
property Pool.CONTROLLER

CONTROLLER ethereum address of the controller of the pool

myPool.CONTROLLER
# '0x2C95BC18Fd9382a07776D416EeF6c2FEb3AD2A8C'
property Pool.initiated

initiated (uint256) is timestamp of initiation time.

myPool.initiated
# 1677379164
# (unix seconds)
property Pool.maintainer

maintainer (address) is the address of the maintainer, set by the owner. Handles day to day operations like delegation of deposited funds.

myPool.maintainer
# 0x2C95BC18Fd9382a07776D416EeF6c2FEb3AD2A8C
property Pool.yieldReceiver

yieldReceiver (address) indicates the ethereum address of the reward collecter.

Warning

If the yieldReceiver is not set (or set to 0x0000000000000000000000000000000000000000 ), yield is distributed among token holders.

myPool.yieldReceiver
# 0x0000000000000000000000000000000000000000

Pool Configuration

property Pool.withdrawalCredential

withdrawalCredential is used while creating the validators to propose.

Warning

Using modified withdrawalContract is not a safe assumption.

myPool.withdrawalCredential
# 0x010000000000000000000000c82ed5ec571673e6b18c4b092c9cbc4ae86c786e
property Pool.withdrawalContract

Any reward of the pool earns will be sent to this withdrawalContract ethereum address. According to Ethereum standards, this address is also at the end of the withdrawal credentials.

myPool.withdrawalContract
# 0xc82Ed5eC571673E6b18c4B092c9cbC4aE86C786e
property Pool.whitelist

Sometimes some maintainers may want to define a whitelist for the pool. In this case, you can see it with the whitelist command. If there is no white list, you will see 0x0000000000000000000000000000000000000000 address.

myPool.whitelist
# 0x0000000000000000000000000000000000000000
property Pool.liquidityPool

Address of the liquidityPool.

myPool.liquidityPool
# 0xEC5B756326f161bdc6506c16800ddF56765E0f3b

Note

Not all pools have whitelist or liquidityPool features.

property Pool.private

private is the boolean value to either the pool is prived pool or public pool.

myPool.private
# False

Pool Fee

property Pool.fee

Returns fee (uint256) How much of the percentage from validator yield will received by the pool owner. DENOMINATOR: 1e10 (100%).

myPool.fee
# 500000000
# PERCENTAGE_DENOMINATOR = 100%

Note

If the pool owner or maintainer wants to update its fee, the operations continue from the value named priorFee for a certain period of time after the fee changes so that it does not manipulate the pool momentarily. This period is 3 days and must be kept in the variable named feeSwitch. At the end of the feeSwitch period, the updated fee comes into play, so users have the freedom to leave the pool according to their own interests.

property Pool.priorFee

priorFee replaces fee when feeSwitch is reached.

myPool.priorFee
# 400000000
# PERCENTAGE_DENOMINATOR = 100%
property Pool.feeSwitch

feeSwitch is set to 3 days after the function call, meaning there will be 3 days delay on every time fee is changed.

myPool.feeSwitch
# 1709191201
# (unix seconds)

ERC20 Tokens (middlewares)

Pool.middlewaresList()

middlewaresList list of (address)es

Warning

To avoid malfunctions, utilizing our standard middlewares is expected by the pool owners.

myPool.middlewaresList()
# ['0xdaED82d9a6a0282D9084375eb1Dc8c09440e2aB3']
Pool.middlewares(index: uint256)

middlewares returns you the middleware corresponding to the given index. If the index is too large, it will throw an error.

myPool.middlewares(0)
# 0xdaED82d9a6a0282D9084375eb1Dc8c09440e2aB3
property Pool.middlewaresLen

middlewaresLen returns the length of the middlewaresList. If you want to achieve multiple middlewares, it can be used to set the limits of the loop before executing the above code.

myPool.middlewaresLen
# 1

Operator Marketplace

Pool.allowance(operatorId: int)

allowance allowance’s of the operators that given ID.

myOperator = geode.Portal.operator(operatorID)
myPool.allowance(operator=myOperator.ID)
## 12
Pool.validators(index: uint256)

validators Returns the pubkey of the validator corresponding to the given index.

## In bytes
print("Pubkey:",myPool.validators(0))

Pubkey: b'\x93&\xf6\xc0\x7f\x8a\xbd\x08.\xf8+\x19\'\x9c\xbb\xa7ak\x03\x95\xfb\x94}P\xcd-_\xef0=\xd6\x13\xab\xe3\x10\x87\x07zg\xfa\xa4w\xc0c\x1c\xc7"\x8d'

## In hex string
print("Pubkey:", myPool.validators(0).hex())

Pubkey: '9326f6c07f8abd082ef82b19279cbba7616b0395fb947d50cd2d5fef303dd613abe31087077a67faa477c0631cc7228d'
property Pool.validatorsList

Returns validatorsList (List(bytes32)) All validator pubkeys that registered to this pool.

myPool.validatorsList
# [b'\x93&\xf6\xc0\x7f\x8a\xbd\x08.\xf8+\x19\'\x9c\xbb\xa7ak\x03\x95\xfb\x94}P\xcd-_\xef0=\xd6\x13\xab\xe3\x10\x87\x07zg\xfa\xa4w\xc0c\x1c\xc7"\x8d']
property Pool.validatorsLen

validatorsLen (uint256) number of validators in the pool. Size of validatorsList array.

myPool.validatorsLen
# 1
Pool.activeValidators(operatorId: int)

activeValidators Number of validators that currently active, according to Portal.

myOperator = geode.Portal.operator(operatorID)
myPool.activeValidators(operator=myOperator.ID)

Note

More than one operator can work in a pool. And each operator will have their own validators. You can get this information with the operator’s ID.

Pool.proposedValidators(operatorId: int)

proposedValidators Number of validators that not active, but waiting to be activated, according to Portal.

myOperator = geode.Portal.operator(operatorID)
myPool.proposedValidators(operator=myOperator.ID)
Pool.alienValidators(operatorId: int)

alienValidators Number of validators that are dedected as faulty, according to Oracle.

myOperator = geode.Portal.operator(operatorID)
myPool.alienValidators(operator=myOperator.ID)

Internal Wallet

property Pool.wallet
Every ID has its own internal wallet within Portal.
It accrues fees, makes things safer and easier for Node Operators when creating validators etc.
wallet (uint256) amount (in wei) in the internal wallet of the pool
print("wallet:",myPool.wallet)
# wallet: 10000000000000
# (as wei) (1e18 = 1 ether)

Note

CONTROLLER of an ID can increase the internal wallet by depositing ether with portal.functions.increaseWalletBalance(id).
Also, can decrease by reclaiming the ether that is accrued with portal.functions.decreaseWalletBalance(id).

Fallback Operator

Warning

Fallback Operator mechnanism is for advanced users. Most of the applications, will not need these functionalities.

property Pool.fallbackOperator

fallbackOperator (uint256) is the ID of selected Operator as fallback.

myPool.fallbackOperator
# 500191....78
property Pool.fallbackThreshold

fallbackThreshold (uint256) means when fallbackThreshold``% of allowances are filled, ``fallbackOperator will have unlimited allowance.

print("fallbackThreshold:",myPool.fallbackThreshold)
# 800000000000
# 80% as PERCENTAGE_DENOMINATOR = 100%

More

Next step: Checkout Staking Pool Handbook.