Create a borrow position for an end user smart account
Creates a borrow position for a specific borrow product, by posting collateral from an end user smart account and borrowing a loan against it. One position can be opened per borrow product for a given smart account.
A borrow product is a protocol-native representation of a borrowable market, such as a Morpho Blue market that lends USDC against cbBTC. The borrowProductId identifies the product to borrow against, and the collateralAmount and loanAmount specify the collateral to post and the loan to take, both expressed as decimal strings in standard unit denomination of their respective tokens.
A user operation is broadcast to open the position onchain. Poll getUserOperationWithEndUserAccount with the returned userOpHash until it reaches a terminal state. Once the user operation succeeds onchain, use the borrow positions list endpoint to view the user’s active positions.
Authorizations
Headers
A JWT signed using your Wallet Secret, encoded in base64. Refer to the Generate Wallet Token section of our Authentication docs for more details on how to generate your Wallet Token.
Path Parameters
Query Parameters
Body
A request to create a borrow position for an end user's smart account for the specified borrow product. The smart account posts collateral and borrows against it, broadcasting a user operation to open the position onchain.
Paymaster URL to use for the user operation. Must not be set when useCdpPaymaster is true.
If useCdpPaymaster is false and no paymasterUrl is set, the smart account must have sufficient funds to cover network fees.
11 - 2048^https?://.*$"https://api.developer.coinbase.com/rpc/v1/base/AbCdEf123456"
Response
Successfully created the borrow position and broadcast the user operation.
A smart account operation response.
The hash of the user operation. This is not the transaction hash, as a transaction consists of multiple user operations. The user operation hash is the hash of this particular user operation which gets signed by the owner of the Smart Account.
^0x[0-9a-fA-F]{64}$"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"