Skip to main content

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 an accountId from 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 the posId/accountId parameter entirely. The nextAccountId field 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

accountTypeTo create new accountTo use existing account
SELECTPass accountId=<unused value> from accountIdRangePass accountId=<existing value>
AUTOGENOmit accountId / posId parameterPass posId=<existing ID>

Request

Responses

Next account information