Next available sub-account
GET/v1/data/lending/next-account
Discover the next available sub-account or position ID for a given lender and owner.
Different protocols handle sub-accounts differently:
- Euler V2 (
accountType: SELECT): Sub-accounts are derived by XORing the owner's last address byte with an index (0–255). The integrator selects anaccountIdfrom the range. Any unused value automatically creates a new sub-account. - Init Capital (
accountType: AUTOGEN): Position IDs are NFT hashes generated on-chain. To create a new position, omit theposId/accountIdparameter entirely. ThenextAccountIdfield is a preview of the ID that will be generated. - Other lenders (Aave, Morpho, Compound, etc.): Do not support sub-accounts — returns a 400 error.
Integration Guide
accountType | To create new account | To use existing account |
|---|---|---|
SELECT | Pass accountId=<unused value> from accountIdRange | Pass accountId=<existing value> |
AUTOGEN | Omit accountId / posId parameter | Pass posId=<existing ID> |
Request
Responses
- 200
- 400
Next account information
Validation error