Actions APIVaultsSlugLoop

Build ordered authorizations, approvals, and a wallet-executed Bundler3 loop.

POST
/vaults/{slug}/loop/build-tx

Path Parameters

slug*string
Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

chainId*integer
Range0 < value
marketId*string
Match^0x[0-9a-fA-F]{64}$
sender*string

Position owner and signer of every returned transaction. Relayed execution is not supported.

Match^0x[a-fA-F0-9]{40}$
maxAssetInput*string

Maximum loan tokens that the bundle may pull from the wallet.

Match^\d{1,78}$
maxShareInput?string

Maximum existing vault shares that the bundle may pull from the wallet.

Match^\d{1,78}$
Default"0"
slippageBps?integer

Share-price slippage in basis points (50 = 0.5%). Supply this or the raw price limit, never both.

Range0 <= value <= 9999
maxSharePriceE27?string

Maximum mint price in raw asset/share units, scaled by 1e27. A caller-supplied slippage limit.

Match^\d{1,78}$
complianceVersion?string

Value in

  • "v1"
  • "v2"
riskPreset?string

Risk policy enforced on the resulting position. Defaults to the frontend selection, max_risk.

Default"max_risk"

Value in

  • "safe"
  • "standard"
  • "max_risk"
mode?"target"
Default"target"

Value in

  • "target"
targetDebtAssets*string

Desired total Morpho debt in raw loan-token units.

Match^\d{1,78}$
targetCollateralShares*string

Desired total collateral in raw vault-share units.

Match^\d{1,78}$
skipSimulation?boolean
Defaultfalse

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/vaults/nest-wisdom-vault/loop/build-tx" \  -H "Content-Type: application/json" \  -d '{    "chainId": 1,    "marketId": "string",    "sender": "string",    "maxAssetInput": "string",    "targetDebtAssets": "string",    "targetCollateralShares": "string"  }'
{  "data": {    "slug": "string",    "chainId": 0,    "marketId": "string",    "sender": "string",    "blockNumber": "string",    "vaultAddress": "string",    "loanToken": "string",    "shareToken": "string",    "mode": "target",    "leverageBps": 0,    "complianceVersion": "v1",    "bundlerAddress": "string",    "adapterAddress": "string",    "targetDebtAssets": "string",    "targetCollateralShares": "string",    "borrowAssets": "string",    "mintShares": "string",    "walletAssetInput": "string",    "walletShareInput": "string",    "maxSharePriceE27": "string",    "risk": {      "preset": "safe",      "maxLeverageBps": 0,      "oracleLeverageBps": "string",      "vaultLeverageBps": "string"    },    "transactions": [      {        "label": "approve",        "description": "string",        "to": "string",        "data": "string",        "value": "0",        "complianceExpiresAt": 1      }    ]  }}