A lightweight Python library and CLI for minting and redeeming USDm via RFQ endpoints.
pip install .Configuration is loaded from environment variables (with USDM_ prefix) or a .env file.
| Variable | Description |
|---|---|
USDM_RPC_URL |
Ethereum RPC endpoint URL |
USDM_PRIVATE_KEY |
Private key for signing (0x-prefixed, 64 hex chars) |
| Variable | Description | Default |
|---|---|---|
USDM_API_URL |
RFQ API base URL | https://public.api.megausd.money/ |
USDM_MINTING_CONTRACT |
USDm minting contract address (used for EIP-712 and allowances) | 0xE0406beE6D58bCd7C1cA78191b6fde9CA060F6f2 |
USDM_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
USDM_PRIVATE_KEY=0x...usdm mint --size 1000usdm redeem --size 1000Automatically approve the required allowance before minting/redeeming:
usdm mint --size 1000 --auto-approve
usdm redeem --size 1000 --auto-approveBuild and sign an order without submitting:
usdm mint --size 1000 --dry-run
usdm redeem --size 1000 --dry-runusdm allowance check --token 0x...
usdm allowance approve --token 0x... --amount 1000000000Install from git:
pip install git+https://github.com/ethena-labs/usdm-minting-client.gitOr add to requirements.txt:
usdm-minting-client @ git+https://github.com/ethena-labs/usdm-minting-client.git
Or add to pyproject.toml:
dependencies = [
"usdm-minting-client @ git+https://github.com/ethena-labs/usdm-minting-client.git",
]from usdm.config import Settings
from usdm.rfq.client import RfqClient
from usdm.rfq.order import build_order
from usdm.signer import sign_order
settings = Settings()
client = RfqClient(settings)
# Get quote
quote = client.get_quote(side="mint", size=1000)
# Build and sign order
order = build_order(quote)
signed = sign_order(order, settings.private_key)
# Submit
result = client.submit_order(signed)- Python >= 3.10
- Ethereum mainnet RPC access
- Private key for signing
MIT