Adjust a borrow position for an end user smart account
Adjusts an existing borrow position for a specific borrow product by supplying collateral, withdrawing collateral, repaying debt, and/or borrowing more of the loan asset from an end user smart account.
The borrowProductId identifies the product whose position to adjust, and the addCollateralAmount, removeCollateralAmount, repayLoanAmount, and borrowLoanAmount fields specify the changes to apply, each expressed as a decimal string in standard unit denomination of the respective token.
A single request must not combine addCollateralAmount with removeCollateralAmount or repayLoanAmount, and must not combine borrowLoanAmount with repayLoanAmount or removeCollateralAmount. Otherwise any subset of the four amount fields may be supplied; at least one is required.
A user operation is broadcast to adjust 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 adjusted 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 adjust an existing borrow position for an end user's smart account on the specified borrow product.
The request can supply collateral, withdraw collateral, repay debt, and/or borrow more of the loan asset, broadcasting a user operation to apply the changes onchain.
A single request must not combine addCollateralAmount with removeCollateralAmount or repayLoanAmount, and must not combine borrowLoanAmount with repayLoanAmount or removeCollateralAmount. Otherwise any subset of the four amount fields may be supplied; at least one is required.
The amount of collateral to add to the position, as a decimal string in standard unit denomination of the collateral token (i.e. "1" for 1 cbBTC). Must not be combined with removeCollateralAmount or repayLoanAmount.
^\+?(?:(?:0*[1-9]\d*)(?:\.\d*)?|0*\.\d*[1-9]\d*)$"1"
The amount of collateral to withdraw from the position, as a decimal string in standard unit denomination of the collateral token (i.e. "1" for 1 cbBTC). Must not be combined with addCollateralAmount or borrowLoanAmount.
^\+?(?:(?:0*[1-9]\d*)(?:\.\d*)?|0*\.\d*[1-9]\d*)$"1"
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 broadcast the user operation to adjust the borrow position.
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"