On-chain staking helpers for the Morpheus AI capital pool. Wraps DepositPool.stake() with referrer support (MRC 73 unlocked-MOR rewards).
Project description
hypnex-staking (Python)
On-chain helpers for the Morpheus AI capital pool on Ethereum mainnet. Wraps DepositPool.stake() and claimReferrerTier() so a Python developer can stake stETH/USDC/USDT/wBTC and capture MRC 73 unlocked-MOR referral rewards.
pip install hypnex-staking
Why this exists
Morpheus's app.mor.org UI requires AWS Cognito email signup. The capital pool's on-chain interface is wallet-native and supports referrer attribution, but no Python tooling exists for it. This package fills that gap.
The single most under-marketed mechanic: referral MOR is unlocked, while own-stake MOR is delayed 90 days (MRC 73 vs MRC 46). Refer once, earn liquid MOR for as long as the referee stays staked.
Quickstart
Read-only (no key needed)
from hypnex_staking import Staker
s = Staker() # public RPC, no signer
# Inspect the live tier table
for tier in s.get_referrer_tiers("USDC"):
print(tier)
# Look up an existing position
print(s.get_position("0xSomeAddress...", "USDC"))
# Look up someone's referrer data
print(s.get_referrer_data("0xReferrer...", "USDC"))
With a signer (moves real funds)
import os
from hypnex_staking import Staker
s = Staker(
rpc_url=os.environ["ETH_RPC_URL"],
private_key=os.environ["PRIVATE_KEY"],
default_referrer="0xYourHypnexLabsAddress", # or set HYPNEX_REFERRER env
)
# Always dry-run first — returns calldata, doesn't broadcast
print(s.stake("USDC", amount=1000, claim_lock_end=0, dry_run=True))
# When ready, drop dry_run for the real tx
tx = s.stake("USDC", amount=1000, claim_lock_end=0)
print("submitted:", tx)
Claim accumulated MRC 73 unlocked-MOR
# Per MRC 73, this MOR has no 90-day lockup — claimable immediately.
tx = s.claim_referrer_rewards("USDC")
Verified contracts (Ethereum mainnet)
| Contract | Address |
|---|---|
| USDC DepositPool | 0x6cCE082851Add4c535352f596662521B4De4750E |
| USDT DepositPool | 0x3B51989212BEdaB926794D6bf8e9E991218cf116 |
| wBTC DepositPool | 0xdE283F8309Fd1AA46c95d299f6B8310716277A42 |
| wETH DepositPool | 0x9380d72aBbD6e0Cc45095A2Ef8c2CA87d77Cb384 |
| DistributorV2 | 0xDf1AC1AC255d91F5f4B1E3B4Aef57c5350F64C7A |
| ChainLinkDataConsumer | 0xd182263d06FDC463c96190005D6359CC3d3Bbc5e |
Sourced from MorpheusAIs/SmartContracts v7 deploy script — verified against the on-chain bytecode by tests/test_read_only.py.
Public API
Staker(w3=..., rpc_url=..., account=..., private_key=..., default_referrer=...)
# read (no signer)
.get_pool_address(asset) -> str
.get_token_address(asset) -> str
.get_decimals(asset) -> int
.get_position(address, asset) -> Position
.get_referrer_data(referrer, asset) -> ReferrerData
.get_referrer_tiers(asset) -> list[ReferrerTier]
.quote_tier(asset, virtual_amount_staked) -> ReferrerTier | None
# write (signer required)
.approve(asset, amount, dry_run=False) -> str (tx hash)
.stake(asset, amount, claim_lock_end=0, referrer=None, auto_approve=True, dry_run=False) -> str
.claim_referrer_rewards(asset, receiver=None, layerzero_fee_wei=0, dry_run=False) -> str
asset is one of "USDC" | "USDT" | "WBTC" | "WETH".
Environment variables
ETH_RPC_URL— Ethereum mainnet RPC (free public default works for reads)PRIVATE_KEY— for write methods onlyHYPNEX_REFERRER— default referrer address (override per-call withreferrer=)
Tests
pip install -e ".[dev]"
pytest # read-only mainnet smoke tests, no key needed
For write-method tests, run a local Anvil fork (anvil --fork-url $ETH_RPC_URL) and set ETH_RPC_URL=http://localhost:8545 plus a funded test key. Test recipes are in tests/test_anvil_fork.py (unimplemented stub — community contributions welcome).
Status & affiliation
Hypnex is not affiliated with the Morpheus AI Foundation. The contracts you sign into are Morpheus's; this is the unofficial Python toolkit for them. Audit your own transactions; the Code4rena audit (report) covers the contracts, not this client.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hypnex_staking-0.1.0.tar.gz.
File metadata
- Download URL: hypnex_staking-0.1.0.tar.gz
- Upload date:
- Size: 211.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7a25c1811510e0f8c147179cae04af2e7a71cbe60e8b31cf55fbeec98b3aa00
|
|
| MD5 |
675dd08f72cfec0dfdcf17c5cbce5e3f
|
|
| BLAKE2b-256 |
d5ef63ac93c07d7c1951ba449a0fed05a6d70e66b7dbc6bf5fa8828e2a014b61
|
File details
Details for the file hypnex_staking-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hypnex_staking-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd37e23e3ec74c87a95885e2e1b13ba08e113ab8c14dc3b8ac384498419b65d6
|
|
| MD5 |
bef977c0162307f2d1e37e6136755d67
|
|
| BLAKE2b-256 |
c1ba569dbc71143163478188ab3068861934867fd63157db15ed480dc38e8b99
|