{"openapi":"3.0.3","info":{"title":"Morpho Borrow and Earn API","version":"0.0.1","description":"> [!warning]\n> Expect frequent incompatible changes and unstable behavior. The Borrow and Earn API is in alpha.\n\nBuild and simulate wallet calls for Morpho Borrow and Earn. The API does not submit transactions.\n\n## How actions work\n\n1. POST to your assigned Actions origin (for example, `https://private.api.morpho.org`) with your Morpho-issued `x-api-key` and the wallet as `account`. Keep the key on your server. Do not follow redirects.\n2. If `status` is `signature_required`, authenticate the response and check the chain, typed-data domains, and expiry before showing any signing request. Get the user's approval for each signature. Submit the `continuation` and signature IDs and values to the same endpoint. Leave more than 60 seconds before expiry for finalization and limit the number of signature rounds.\n3. If `status` is `prepared` and `simulation.status` is `success`, verify the response and calls before signing or sending them. Do not send calls from a failed or unavailable simulation in this flow.\n\n## Verify before signing\n\nUse Morpho's calldata verifier SDK to authenticate `Morpho-Action-Proof` and check the ordered calls against what the user requested. Both SDKs verify locally and synchronously, without making HTTP calls. The examples use a Vault V2 deposit of 1 USDC on Base, with ERC-20 funding, no referral fee, and `signature_mode: \"none\"`. Use the account and vault you sent, the chain from your original vault selector, and the asset address you independently know for that vault. Never build the intent from fields echoed in the response.\n\nKeep the exact request method, target (path and query as sent), `Content-Type`, and body bytes. Keep the response status, `Content-Type`, `X-Request-Id`, `Morpho-Action-Proof`, and body bytes after HTTP decompression. Parse the retained bytes; do not reserialize either body for proof verification. Fetch trusted JWKS yourself from `/.well-known/morpho-actions-jwks.json` on your configured Actions origin (for example, `https://private.api.morpho.org/.well-known/morpho-actions-jwks.json`). No API key is needed for JWKS. Cache it for at most 60 seconds and refresh on an unknown key ID. Pass the current Unix time in seconds. Proofs use `ES256`; the canonical production issuer is `https://api.morpho.org/v0/actions`. Use a different issuer only if Morpho supplied it for your environment.\n\n### TypeScript\n\nInstall with `npm install @morpho-org/calldata-verifier@0.3.0 viem`.\n\n```ts\nimport {\n  verifyCalldata,\n  type ActionProofInput,\n  type CalldataCall,\n  type CalldataIntent,\n} from \"@morpho-org/calldata-verifier\";\n\ntype VaultDepositIntent = Extract<CalldataIntent, { action: \"vault_v2.deposit\" }>;\ntype DepositRequest = Pick<VaultDepositIntent, \"account\" | \"amount\" | \"funding\">;\n\nexport async function verifyDeposit(\n  vault: VaultDepositIntent[\"vault\"],\n  asset: VaultDepositIntent[\"asset\"],\n  request: ActionProofInput[\"request\"],\n  response: Response,\n  trustedJwks: unknown,\n) {\n  const { account, amount, funding } = JSON.parse(\n    new TextDecoder().decode(request.body),\n  ) as DepositRequest;\n  const intent: VaultDepositIntent = {\n    action: \"vault_v2.deposit\",\n    chain_id: 8453,\n    account,\n    vault,\n    asset,\n    max_fee_bps: 0,\n    amount,\n    funding,\n  };\n  const body = new Uint8Array(await response.arrayBuffer());\n  const { data } = JSON.parse(new TextDecoder().decode(body)) as {\n    data: { calls: CalldataCall[]; expires_at: number };\n  };\n  if (!Number.isSafeInteger(data.expires_at) || data.expires_at <= 0) {\n    throw new Error(\"Invalid action expiry\");\n  }\n\n  // If reading, parsing, or verification throws, do not sign or send anything.\n  const calls = verifyCalldata(intent, data.calls, {\n    proof: {\n      header: response.headers.get(\"Morpho-Action-Proof\") ?? \"\",\n      jwks: trustedJwks,\n      now: Math.floor(Date.now() / 1000),\n      request,\n      response: {\n        status: response.status,\n        contentType: response.headers.get(\"Content-Type\") ?? \"\",\n        requestId: response.headers.get(\"X-Request-Id\") ?? \"\",\n        body,\n      },\n    },\n  });\n  return { calls, expiresAt: data.expires_at };\n}\n```\n\n### Go\n\nInstall with `go get github.com/morpho-org/calldata-verifier-go@v0.2.0`.\n\n```go\npackage actions\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"time\"\n\n\tverifier \"github.com/morpho-org/calldata-verifier-go\"\n)\n\nfunc verifyDeposit(\n\tvault, asset string,\n\trequest verifier.ActionProofRequest,\n\tresponse verifier.ActionProofResponse,\n\tproofHeader string,\n\ttrustedJWKS json.RawMessage,\n) ([]verifier.DecodedCalldataCall, int64, error) {\n\tvar original struct {\n\t\tAccount string            `json:\"account\"`\n\t\tAmount  verifier.Amount   `json:\"amount\"`\n\t\tFunding *verifier.Funding `json:\"funding\"`\n\t}\n\tif err := json.Unmarshal(request.Body, &original); err != nil {\n\t\treturn nil, 0, err\n\t}\n\tintent := verifier.VaultCalldataIntent{\n\t\tCommonIntent: verifier.CommonIntent{\n\t\t\tAction: \"vault_v2.deposit\", ChainID: 8453, Account: original.Account, MaxFeeBPS: 0,\n\t\t},\n\t\tVault:   vault,\n\t\tAsset:   asset,\n\t\tAmount:  original.Amount,\n\t\tFunding: original.Funding,\n\t}\n\tvar prepared struct {\n\t\tData struct {\n\t\t\tCalls     []verifier.CalldataCall\n\t\t\tExpiresAt int64 `json:\"expires_at\"`\n\t\t}\n\t}\n\tif err := json.Unmarshal(response.Body, &prepared); err != nil {\n\t\treturn nil, 0, err\n\t}\n\tif prepared.Data.ExpiresAt <= 0 || prepared.Data.ExpiresAt > 1<<53-1 {\n\t\treturn nil, 0, errors.New(\"invalid action expiry\")\n\t}\n\tnow := float64(time.Now().Unix())\n\tproof := verifier.ActionProofInput{\n\t\tHeader: proofHeader, JWKS: trustedJWKS, Now: &now,\n\t\tRequest: request, Response: response,\n\t}\n\n\t// If this returns an error, do not sign or send anything.\n\tcalls, err := verifier.VerifyCalldata(intent, prepared.Data.Calls, verifier.VerifyOptions{Proof: &proof})\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\treturn calls, prepared.Data.ExpiresAt, nil\n}\n```\n\nStop on any error. Do not retry verification without the proof. These SDKs only authenticate an approved, prepared response with a successful simulation. They do not verify `signature_required` responses or EIP-712 typed-data requests. Verification does not replace simulation, current chain-state checks, or user consent.\n\nTypeScript v0.3.0 verifies `midnight.make_borrow`, `midnight.make_lend` (including variable-rate market funding), `midnight.make_repay`, and `midnight.make_withdraw`. Go v0.2.0 does not cover these actions.\n\nFor the Vault V2 deposit above, the SDK does not independently compare the deposit share-price bound with `slippage_bps`; the approved proof attests that the API checked it.\n\n### Authenticate responses outside SDK coverage\n\nFor SDK-only verification, omit `signature_mode`. Requests that accept the field default to `\"none\"`. Stop on any response the SDK cannot verify.\n\nIf a response is outside the coverage of your SDK version, verify the proof yourself before acting on that response:\n\n- Accept only an `ES256` signature with protected `typ: \"morpho-action-proof+jwt\"`. Resolve `kid` to exactly one key in the trusted JWKS; never take a key or key URL from the proof.\n- Check `iss` against the configured issuer, `aud` against `morpho-actions-client`, and `sub` against `action-response`. Require safe-integer Unix seconds for `iat` and `exp` with a positive lifetime of at most 300 seconds. Enforce expiration and a maximum age of 60 seconds from `iat`, with at most 5 seconds of clock tolerance.\n- Match `request_id` to `X-Request-Id` and `action_id` and `action` to the response data. Match the signed request method, target and content type, and the response HTTP status and content type. Match both `body_sha256` claims to the unpadded base64url SHA-256 hashes of the retained request and response bytes.\n- Match the signed decision to the response: `signature_required` when `data.status` is `signature_required`; `approved` only when it is `prepared` and `simulation.status` is `success`; `unsimulated` when it is `simulation_unavailable` and `simulation.status` is `unavailable`; `rejected` otherwise. Only `approved` permits sending calls, after independently checking the calls against the user's intent.\n\n## Send verified calls\n\nCheck the wallet account and chain. Submit the verified calls' `to`, `data`, and `value` unchanged and in order. Use an atomic batch if supported, or wait for each transaction to confirm before sending the next. Check the returned `expires_at` (Unix seconds) before every send, including after waiting for a receipt, and stop on failure or expiry. Confirmed approvals and authorizations remain effective; request a new action rather than submitting the remaining calls. Check the wallet or bundler for the outcome of any unconfirmed submission before requesting the action again; it may still land. Let the wallet estimate gas; do not use gas limits or gas prices from the simulation.\n\n## Availability and expiry\n\n- Morpho Blue: `1`, `10`, `130`, `137`, `143`, `196`, `480`, `988`, `999`, `4217`, `4663`, `5042`, `8453`, `42161`, `747474`.\n- Vault V1 deposit and withdraw: `1`, `10`, `130`, `137`, `143`, `480`, `988`, `999`, `8453`, `42161`, `747474`.\n- Vault V2 deposit and withdraw: `1`, `10`, `130`, `137`, `143`, `196`, `480`, `988`, `999`, `4217`, `4663`, `5042`, `8453`, `42161`, `747474`.\n- Vault V2 force-withdraw and in-kind redeem: `1`, `10`, `130`, `137`, `143`, `196`, `480`, `988`, `999`, `4217`, `4663`, `5042`, `8453`, `42161`, `747474`.\n- Midnight: `1`, `4663`, `5042`, `8453`.\n\nUse the returned `expires_at` for calls and continuations. Client-supplied expiry is capped at 2 hours for Blue and 7 days for Vaults.\n\nMidnight actions default to 30 minutes. Quoted actions allow a maximum of 1 hour. Offer publication, cancellation, and direct repayment allow a maximum of 24 hours.\n\n## Amounts and identifiers\n\nUse integer strings in raw units for assets and shares. For Midnight, `assets` means loan-token base units and `units` means credit units for lend and credit withdrawals or debt units for borrow and repay. Use `<chain_id>:<address>` for vaults, `<chain_id>:<market_id>` for markets, and `<chain_id>:<group_id>` for Midnight offer groups. See the operation fields for slippage, guards, and referral fees.\n\n## Signature modes\n\n`none` (default) returns any needed approval or authorization calls. `auto` can request EIP-712 signatures instead. If you change modes, request a new action and show the user the permissions it asks for; approval calls can grant broader permissions than a signature.\n\n## Errors\n\nUnsupported chains return 422 `ACTION_UNSUPPORTED`. On 429, respect `Retry-After`; a JSON error body is not guaranteed. Retry transient 503s. Restart without the continuation on `SIGNATURE_REFRESH_REQUIRED` or `ACTION_CONTINUATION_INVALID`. Action errors use an `{ error: { code, message, details, request_id } }` envelope. For support, include the `X-Request-Id` or `error.request_id`."},"servers":[{"url":"https://private.api.morpho.org"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"Vaults V1","description":"Build and simulate transactions for Morpho Vault V1 (MetaMorpho), the legacy vault version. Use Vaults V2 for new integrations."},{"name":"Vaults V2","description":"Build and simulate transactions for Morpho Vault V2, the current vault version."},{"name":"Blue","description":"Build and simulate transactions for Morpho Blue."},{"name":"Midnight","description":"Build and simulate transactions for Midnight."}],"components":{"headers":{"MorphoActionProof":{"description":"Integrity proof for this response.","schema":{"type":"string"}},"RequestId":{"description":"Request correlation identifier.","schema":{"type":"string"}},"ServerTiming":{"description":"Server processing durations as `name;dur=ms` entries, for diagnostics only. Entry names can change without notice; `total` is the full request duration.","schema":{"type":"string"}}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Send your Morpho-issued key on every action request. JWKS needs no key on every host; public documentation needs no key."}},"schemas":{"ActionAddress":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Checksummed EVM address."},"ActionCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","blue_authorization","blue_borrow","blue_refinance","blue_repay","blue_repay_withdraw_collateral","blue_supply","blue_supply_collateral","blue_supply_collateral_borrow","blue_withdraw","withdraw_funding","blue_withdraw_collateral","erc20_approval","authorize","cancel_and_publish","cancel_offers","redeem","repay_and_withdraw_collateral","supply_collateral","supply_collateral_and_borrow","supply_collateral_with_native","borrow","lend","market_repay_and_withdraw_collateral","withdraw","withdraw_collateral","withdraw_collateral_batch","permit","vault_v1_deposit","vault_v1_in_kind_redeem","vault_v1_migrate_to_v2","vault_v1_redeem","vault_v1_withdraw","vault_v2_deposit","vault_v2_force_redeem","vault_v2_force_withdraw","vault_v2_in_kind_redeem","vault_v2_redeem","vault_v2_withdraw"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"HexBytes":{"type":"string","pattern":"^0x(?:[0-9a-fA-F]{2})*$"},"ActionExpiry":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991,"description":"Unix timestamp in seconds when the action response expires. Unless the request sets `expires_at`, variable-rate market and Midnight actions default to 30 minutes from now. Vault actions default to two hours from now.\n\nQuote-priced Midnight actions can expire earlier based on offer validity or market maturity. Market quotes must still be valid when prepared; offer-group take requires at least 5 minutes. Finalize signature-required actions with more than 60 seconds left. Direct Midnight collateral supply, direct Midnight redemption, and Vault V2 force redeem do not enforce this deadline on-chain."},"ActionId":{"type":"string","minLength":1,"description":"Opaque identifier for this action."},"ActionSignatureRequirement":{"type":"object","properties":{"id":{"type":"string","minLength":1},"kind":{"type":"string","enum":["authorization","permit"]},"typed_data":{"$ref":"#/components/schemas/Eip712TypedData"}},"required":["id","kind","typed_data"],"additionalProperties":false},"Eip712TypedData":{"type":"object","properties":{"domain":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"boolean"}]}},"types":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","minLength":1}},"required":["name","type"],"additionalProperties":false}}},"primaryType":{"type":"string","minLength":1},"message":{"type":"object","additionalProperties":{"nullable":true}}},"required":["domain","types","primaryType","message"],"additionalProperties":false},"BasisPoints":{"type":"integer","minimum":0,"maximum":10000,"description":"A bounded integer number of basis points."},"ChainId":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991,"description":"EVM chain identifier."},"Erc20Asset":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"}},"required":["address"],"additionalProperties":false},"ActionContinuationRequest":{"type":"object","properties":{"continuation":{"type":"string","minLength":1},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/SubmittedActionSignature"},"minItems":1,"description":"Signatures collected for this continuation. Every signature ID must be unique and match one requested signature."}},"required":["continuation","signatures"],"additionalProperties":false},"SubmittedActionSignature":{"type":"object","properties":{"id":{"type":"string","minLength":1},"signature":{"$ref":"#/components/schemas/SignatureHex"}},"required":["id","signature"],"additionalProperties":false},"SignatureHex":{"type":"string","pattern":"^0x(?:[0-9a-fA-F]{2})+$"},"MarketId":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"MarketSelector":{"type":"string","pattern":"^(?:[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990|9007199254740991):0x[0-9a-fA-F]{64}$","description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","example":"8453:0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836"},"MidnightLendTargetValue":{"type":"string","pattern":"^(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-3]|115792089237316195423570985008687907853269984665640564039457584007913129639934)$","description":"Positive target amount in token base units, strictly below maxUint256."},"NativeAsset":{"type":"object","properties":{"type":{"type":"string","enum":["native"]}},"required":["type"],"additionalProperties":false},"ActionFunding":{"oneOf":[{"$ref":"#/components/schemas/ActionFundingErc20"},{"$ref":"#/components/schemas/ActionFundingNative"},{"$ref":"#/components/schemas/ActionFundingAuto"}],"discriminator":{"propertyName":"type","mapping":{"erc20":"#/components/schemas/ActionFundingErc20","native":"#/components/schemas/ActionFundingNative","auto":"#/components/schemas/ActionFundingAuto"}},"description":"Select ERC-20, native-currency, or balance-based automatic funding. Native and auto modes require a maximum native spend."},"ActionFundingErc20":{"type":"object","properties":{"type":{"type":"string","enum":["erc20"]}},"required":["type"],"additionalProperties":false},"ActionFundingNative":{"type":"object","properties":{"type":{"type":"string","enum":["native"]},"max_native_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"}},"required":["type","max_native_assets"],"additionalProperties":false},"UnsignedBaseUnitAmount":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Exact amount in token base units."},"ActionFundingAuto":{"type":"object","properties":{"type":{"type":"string","enum":["auto"]},"max_native_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"}},"required":["type","max_native_assets"],"additionalProperties":false},"PositiveBaseUnitAmount":{"type":"string","pattern":"^[1-9][0-9]*$","description":"Positive amount in token base units."},"WadValue":{"type":"string","pattern":"^[1-9][0-9]*$","description":"WAD-scaled: 1000000000000000000 = 1.0"},"ResolvedFunding":{"type":"object","properties":{"wrapped_asset":{"$ref":"#/components/schemas/ActionAddress"},"max_native_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"erc20_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"native_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"}},"required":["wrapped_asset","max_native_assets","erc20_assets","native_assets"],"additionalProperties":false},"SignatureMode":{"type":"string","enum":["none","auto"],"default":"none","description":"Controls typed-data requirements. The default is \"none\".\n- \"none\" returns prerequisite approval and authorization calls without signature requests.\n- \"auto\" reuses sufficient allowances. Otherwise, it requests ERC-2612 permits when the on-chain domain matches, or uses approval calls instead.\n\nMorpho authorization uses signatures. Smart-contract accounts (excluding EIP-7702 delegated EOAs) receive calls only.","example":"auto"},"ReferralFeeBasisPoints":{"type":"integer","minimum":1,"maximum":200,"description":"Referral fee in basis points, at most 200 (2%). Omit the fee instead of sending zero."},"ReferralFee":{"type":"object","properties":{"bps":{"$ref":"#/components/schemas/ReferralFeeBasisPoints"},"recipient":{"$ref":"#/components/schemas/ReferralFeeRecipient"}},"required":["bps","recipient"],"additionalProperties":false},"ReferralFeeRecipient":{"type":"string","pattern":"^0x(?!0{40}$)[0-9a-fA-F]{40}$","description":"Referral fee recipient address with a checksum. Do not use the zero address."},"SignatureRequiredActionResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","minLength":1},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false}},"required":["data"],"additionalProperties":false},"SimulationAsset":{"oneOf":[{"$ref":"#/components/schemas/SimulationErc20Asset"},{"$ref":"#/components/schemas/NativeAsset"}],"discriminator":{"propertyName":"type","mapping":{"erc20":"#/components/schemas/SimulationErc20Asset","native":"#/components/schemas/NativeAsset"}},"description":"Native currency or ERC-20 token affected by the simulation."},"SimulationErc20Asset":{"type":"object","properties":{"type":{"type":"string","enum":["erc20"]},"address":{"$ref":"#/components/schemas/ActionAddress"}},"required":["type","address"],"additionalProperties":false,"description":"ERC-20 token identified by its contract address."},"SimulationBlockNumber":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Block number used as the simulation execution context."},"ActionSimulationBlock":{"type":"object","properties":{"number":{"$ref":"#/components/schemas/SimulationBlockNumber"},"timestamp":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix timestamp of the simulation execution block, in seconds."}},"required":["number","timestamp"],"additionalProperties":false,"description":"Chain state context used for the successful simulation."},"SignedBaseUnitDifference":{"type":"string","pattern":"^(?:0|-?[1-9][0-9]*)$","description":"Signed change in base units. Positive values increase the balance or position; negative values decrease it."},"BluePositionChanges":{"type":"object","properties":{"supply_shares":{"allOf":[{"$ref":"#/components/schemas/SignedBaseUnitDifference"},{"description":"Change to Morpho Blue supply shares."}]},"borrow_shares":{"allOf":[{"$ref":"#/components/schemas/SignedBaseUnitDifference"},{"description":"Change to Morpho Blue borrow shares."}]},"collateral_assets":{"allOf":[{"$ref":"#/components/schemas/SignedBaseUnitDifference"},{"description":"Change to supplied collateral, in collateral asset base units."}]}},"required":["supply_shares","borrow_shares","collateral_assets"],"additionalProperties":false,"description":"Simulated changes to the wallet's Morpho Blue position."},"VaultPositionChanges":{"type":"object","properties":{"vault_shares":{"allOf":[{"$ref":"#/components/schemas/SignedBaseUnitDifference"},{"description":"Change to the wallet's vault shares, in share base units."}]}},"required":["vault_shares"],"additionalProperties":false,"description":"Simulated change to the wallet's vault position."},"VaultShareDecimals":{"type":"integer","minimum":0,"maximum":255,"description":"Number of decimal places that the vault-share token uses."},"VaultSelector":{"type":"string","pattern":"^(?:[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990|9007199254740991):0x[0-9a-fA-F]{40}$","description":"Vault identifier formatted as <chain_id>:<vault_address>. Send the colon literally or as %3A. Mixed-case addresses must use a valid EIP-55 checksum.","example":"8453:0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9"},"ActionWalletChange":{"type":"object","properties":{"asset":{"$ref":"#/components/schemas/SimulationAsset"},"difference":{"allOf":[{"$ref":"#/components/schemas/SignedBaseUnitDifference"},{"description":"Change to the selected wallet's spendable balance, in asset base units."}]}},"required":["asset","difference"],"additionalProperties":false,"description":"Simulated native-currency or ERC-20 balance change for the selected wallet."},"BlueSupplyRequest":{"oneOf":[{"$ref":"#/components/schemas/BlueSupplyIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"BlueSupplyIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"$ref":"#/components/schemas/ActionRequestedExpiry"},"amount":{"$ref":"#/components/schemas/BlueSupplyIntentAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"funding":{"$ref":"#/components/schemas/ActionFunding"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"}},"required":["account","amount","funding"],"additionalProperties":false},"ActionAccount":{"type":"string","pattern":"^0x(?!0{40}$)[0-9a-fA-F]{40}$","description":"Action wallet address with a checksum. Do not use the zero address."},"CalldataOrigin":{"type":"string","pattern":"^0x[0-9a-fA-F]{8}$","description":"Optional 4-byte tag that identifies your integration. The API appends it to the calldata of the action's final transaction so that onchain activity can be attributed to your integration. Prerequisite calls, such as token approvals, are not tagged. The tag does not change what the transaction does and is not an authentication signal.","example":"0x25afea44"},"ActionRequestedExpiry":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991,"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most two hours from now."},"BlueSupplyIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Gross loan asset amount to supply in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueBorrowRequest":{"description":"Borrow only, supply collateral and borrow in one atomic action, or continue a prepared action with collected signatures.","oneOf":[{"$ref":"#/components/schemas/BlueBorrowIntent"},{"$ref":"#/components/schemas/BlueSupplyCollateralBorrowIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"BlueBorrowIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"$ref":"#/components/schemas/ActionRequestedExpiry"},"amount":{"$ref":"#/components/schemas/BlueBorrowIntentAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"}},"required":["account","amount"],"additionalProperties":false},"BlueBorrowIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Gross loan asset amount to borrow in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueSupplyCollateralBorrowIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"$ref":"#/components/schemas/ActionRequestedExpiry"},"amount":{"$ref":"#/components/schemas/BlueBorrowIntentAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"collateral_amount":{"$ref":"#/components/schemas/BlueBorrowCollateralIntentAmountAssets"},"funding":{"$ref":"#/components/schemas/ActionFunding"}},"required":["account","amount","collateral_amount","funding"],"additionalProperties":false},"BlueBorrowCollateralIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral asset amount to supply in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueBorrowResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BlueBorrowResponseData"}},"required":["data"],"additionalProperties":false},"BlueBorrowResponseData":{"oneOf":[{"$ref":"#/components/schemas/BlueBorrowPreparedData"},{"$ref":"#/components/schemas/BlueBorrowSimulationFailedData"},{"$ref":"#/components/schemas/BlueBorrowSimulationUnavailableData"},{"$ref":"#/components/schemas/BlueBorrowSignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/BlueBorrowPreparedData","simulation_failed":"#/components/schemas/BlueBorrowSimulationFailedData","simulation_unavailable":"#/components/schemas/BlueBorrowSimulationUnavailableData","signature_required":"#/components/schemas/BlueBorrowSignatureRequiredData"}}},"BlueBorrowPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"amount":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets borrowed."}]}},"required":["unit","value"],"additionalProperties":false},"resolved_amount":{"$ref":"#/components/schemas/BlueBorrowResolvedAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueBorrowCall"},"minItems":1,"maxItems":4},"action":{"type":"string","enum":["blue.borrow"]},"collateral_amount":{"$ref":"#/components/schemas/BlueBorrowResponseCollateralAmountAssets"},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved collateral funding. Present only when the request included collateral_amount."}]},"simulation":{"$ref":"#/components/schemas/BlueBorrowSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","amount","resolved_amount","calls","action","simulation"],"additionalProperties":false},"BlueBorrowResolvedAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets borrowed in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueBorrowCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","blue_borrow","blue_supply_collateral_borrow"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"BlueBorrowResponseCollateralAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral asset amount supplied in base units. Present only when the request included collateral_amount."}]}},"required":["unit","value"],"additionalProperties":false},"BlueBorrowSimulation":{"oneOf":[{"$ref":"#/components/schemas/BlueBorrowSimulationSuccess"},{"$ref":"#/components/schemas/BlueBorrowSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/BlueBorrowSimulationSuccess","failed":"#/components/schemas/BlueBorrowSimulationFailure"}}},"BlueBorrowSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/BluePositionChanges"},"effects":{"$ref":"#/components/schemas/BlueBorrowEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"BlueBorrowEffects":{"type":"object","properties":{"gross_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets borrowed before the referral fee, in loan asset base units."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Loan assets paid as the referral fee, in loan asset base units."}]},"net_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets received after the referral fee, in loan asset base units."}]},"ltv_bps":{"type":"integer","minimum":0,"description":"Position loan-to-value after the action, in basis points of the oracle-priced collateral, rounded up."},"max_ltv_bps":{"type":"integer","minimum":0,"description":"Highest loan-to-value the returned calls accept on-chain at execution (the market LLTV minus a 0.5% buffer), in basis points."},"supplied_collateral_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral asset amount supplied in base units. Present only when the request included collateral_amount."}]}},"required":["gross_assets","referral_fee_assets","net_assets","ltv_bps","max_ltv_bps"],"additionalProperties":false,"description":"Borrow amounts confirmed by the simulation."},"BlueBorrowSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"ActionSimulationFailureCode":{"type":"string","enum":["ACCESS_RESTRICTED","CAP_EXCEEDED","EXECUTION_REVERTED","FUNDS_RETAINED","INSUFFICIENT_ALLOWANCE","INSUFFICIENT_BALANCE","INSUFFICIENT_LIQUIDITY","NONCE_ALREADY_USED","POSITION_UNHEALTHY","SIGNATURE_EXPIRED","SIGNATURE_INVALID","SLIPPAGE_EXCEEDED"],"description":"Stable reason why the simulation rejected the prepared action."},"BlueBorrowSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"amount":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets borrowed."}]}},"required":["unit","value"],"additionalProperties":false},"resolved_amount":{"$ref":"#/components/schemas/BlueBorrowResolvedAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["blue.borrow"]},"collateral_amount":{"$ref":"#/components/schemas/BlueBorrowResponseCollateralAmountAssets"},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved collateral funding. Present only when the request included collateral_amount."}]},"simulation":{"$ref":"#/components/schemas/BlueBorrowSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","amount","resolved_amount","action","simulation"],"additionalProperties":false},"BlueBorrowSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"amount":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets borrowed."}]}},"required":["unit","value"],"additionalProperties":false},"resolved_amount":{"$ref":"#/components/schemas/BlueBorrowResolvedAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueBorrowCall"},"minItems":1,"maxItems":4},"action":{"type":"string","enum":["blue.borrow"]},"collateral_amount":{"$ref":"#/components/schemas/BlueBorrowResponseCollateralAmountAssets"},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved collateral funding. Present only when the request included collateral_amount."}]},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","amount","resolved_amount","calls","action","simulation"],"additionalProperties":false},"UnavailableActionSimulation":{"type":"object","properties":{"status":{"type":"string","enum":["unavailable"]},"reason":{"type":"string","enum":["rpc_unavailable","unsupported"]},"skipped_checks":{"type":"array","items":{"type":"string","enum":["execution_and_safety","approval_events","wallet_and_position_changes","action_effects","protocol_state_observations","signature_nonce_freshness","vault_factory_provenance","adapter_provenance","vault_share_eligibility","pre_execution_state_assertions"]},"minItems":1}},"required":["status","reason","skipped_checks"],"additionalProperties":false},"BlueBorrowSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["blue.borrow"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"BlueRefinanceRequest":{"oneOf":[{"$ref":"#/components/schemas/BlueRefinanceIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"BlueRefinanceIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"$ref":"#/components/schemas/ActionRequestedExpiry"},"destination_market":{"allOf":[{"$ref":"#/components/schemas/MarketSelector"},{"description":"Distinct same-chain Morpho Blue destination market."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"}},"required":["account","destination_market"],"additionalProperties":false},"BlueRefinanceResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BlueRefinanceResponseData"}},"required":["data"],"additionalProperties":false},"BlueRefinanceResponseData":{"oneOf":[{"$ref":"#/components/schemas/BlueRefinancePreparedData"},{"$ref":"#/components/schemas/BlueRefinanceSimulationFailedData"},{"$ref":"#/components/schemas/BlueRefinanceSimulationUnavailableData"},{"$ref":"#/components/schemas/BlueRefinanceSignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/BlueRefinancePreparedData","simulation_failed":"#/components/schemas/BlueRefinanceSimulationFailedData","simulation_unavailable":"#/components/schemas/BlueRefinanceSimulationUnavailableData","signature_required":"#/components/schemas/BlueRefinanceSignatureRequiredData"}}},"BlueRefinancePreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["blue.refinance"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAccount"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"source_market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"destination_market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueRefinanceCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/BlueRefinanceSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","source_market","destination_market","calls","simulation"],"additionalProperties":false},"BlueRefinanceCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["authorization","blue_refinance"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"BlueRefinanceSimulation":{"oneOf":[{"$ref":"#/components/schemas/BlueRefinanceSimulationSuccess"},{"$ref":"#/components/schemas/BlueRefinanceSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/BlueRefinanceSimulationSuccess","failed":"#/components/schemas/BlueRefinanceSimulationFailure"}}},"BlueRefinanceSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/BlueRefinancePositionChanges"},"effects":{"$ref":"#/components/schemas/BlueRefinanceEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"BlueRefinancePositionChanges":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/BluePositionChanges"},"destination":{"$ref":"#/components/schemas/BluePositionChanges"}},"required":["source","destination"],"additionalProperties":false,"description":"Simulated position changes in the source and destination markets."},"BlueRefinanceEffects":{"type":"object","properties":{"collateral_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral moved to the destination market, in collateral asset base units."}]},"source_repaid_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets used to repay the source debt, in loan asset base units."}]},"source_repaid_shares":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Borrow shares repaid in the source market."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Additional destination debt used for the referral fee, in loan asset base units."}]},"destination_borrow_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets borrowed from the destination market, in loan asset base units."}]},"destination_borrow_shares":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Borrow shares created in the destination market."}]},"ltv_bps":{"type":"integer","minimum":0,"description":"Position loan-to-value after the action, in basis points of the oracle-priced collateral, rounded up."},"max_ltv_bps":{"type":"integer","minimum":0,"description":"Highest loan-to-value the returned calls accept on-chain at execution (the market LLTV minus a 0.5% buffer), in basis points."}},"required":["collateral_assets","source_repaid_assets","source_repaid_shares","referral_fee_assets","destination_borrow_assets","destination_borrow_shares","ltv_bps","max_ltv_bps"],"additionalProperties":false,"description":"Refinance amounts confirmed by the simulation."},"BlueRefinanceSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"BlueRefinanceSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["blue.refinance"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAccount"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"source_market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"destination_market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"simulation":{"$ref":"#/components/schemas/BlueRefinanceSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","source_market","destination_market","simulation"],"additionalProperties":false},"BlueRefinanceSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["blue.refinance"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAccount"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"source_market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"destination_market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueRefinanceCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","source_market","destination_market","calls","simulation"],"additionalProperties":false},"BlueRefinanceSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["blue.refinance"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"BlueSupplyResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BlueSupplyResponseData"}},"required":["data"],"additionalProperties":false},"BlueSupplyResponseData":{"oneOf":[{"$ref":"#/components/schemas/BlueSupplyPreparedData"},{"$ref":"#/components/schemas/BlueSupplySimulationFailedData"},{"$ref":"#/components/schemas/BlueSupplySimulationUnavailableData"},{"$ref":"#/components/schemas/BlueSupplySignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/BlueSupplyPreparedData","simulation_failed":"#/components/schemas/BlueSupplySimulationFailedData","simulation_unavailable":"#/components/schemas/BlueSupplySimulationUnavailableData","signature_required":"#/components/schemas/BlueSupplySignatureRequiredData"}}},"BlueSupplyPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["blue.supply"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueSupplyResponseAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueSupplyCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/BlueSupplySimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_funding","calls","simulation"],"additionalProperties":false},"BlueSupplyResponseAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Supplied loan asset amount in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueSupplyCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","blue_supply"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"BlueSupplySimulation":{"oneOf":[{"$ref":"#/components/schemas/BlueSupplySimulationSuccess"},{"$ref":"#/components/schemas/BlueSupplySimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/BlueSupplySimulationSuccess","failed":"#/components/schemas/BlueSupplySimulationFailure"}}},"BlueSupplySimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/BluePositionChanges"},"effects":{"$ref":"#/components/schemas/BlueSupplyEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"BlueSupplyEffects":{"type":"object","properties":{"gross_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets supplied before the referral fee, in loan asset base units."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Loan assets paid as the referral fee, in loan asset base units."}]},"net_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets supplied to the market after the referral fee, in loan asset base units."}]}},"required":["gross_assets","referral_fee_assets","net_assets"],"additionalProperties":false,"description":"Supply amounts and funding mode confirmed by the simulation."},"BlueSupplySimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"BlueSupplySimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["blue.supply"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueSupplyResponseAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/BlueSupplySimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_funding","simulation"],"additionalProperties":false},"BlueSupplySimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["blue.supply"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueSupplyResponseAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueSupplyCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_funding","calls","simulation"],"additionalProperties":false},"BlueSupplySignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["blue.supply"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"BlueSupplyPreparedResponse":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["blue.supply"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueSupplyResponseAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueSupplyCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/BlueSupplySimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_funding","calls","simulation"],"additionalProperties":false},{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["blue.supply"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueSupplyResponseAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/BlueSupplySimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_funding","simulation"],"additionalProperties":false},{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["blue.supply"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueSupplyResponseAmountAssets"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueSupplyCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_funding","calls","simulation"],"additionalProperties":false}],"discriminator":{"propertyName":"status","mapping":{}}}},"required":["data"],"additionalProperties":false},"BlueSupplySignatureRequiredResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BlueSupplySignatureRequiredData"}},"required":["data"],"additionalProperties":false},"BlueWithdrawRequest":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"BlueWithdrawIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"$ref":"#/components/schemas/ActionRequestedExpiry"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"amount":{"$ref":"#/components/schemas/BlueWithdrawAmount"}},"required":["account","amount"],"additionalProperties":false},"BlueWithdrawAmount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawAmountShares"},{"$ref":"#/components/schemas/BlueWithdrawAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawAmountAssets","shares":"#/components/schemas/BlueWithdrawAmountShares","all":"#/components/schemas/BlueWithdrawAmountAll"}}},"BlueWithdrawAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact gross loan asset amount to withdraw in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueWithdrawAmountShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact Morpho Blue supply-share amount to burn."}]}},"required":["unit","value"],"additionalProperties":false},"BlueWithdrawAmountAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false,"description":"Withdraws as much of the supply position as current liquidity allows."},"BlueWithdrawResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BlueWithdrawResponseData"}},"required":["data"],"additionalProperties":false},"BlueWithdrawResponseData":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawPreparedData"},{"$ref":"#/components/schemas/BlueWithdrawSimulationFailedData"},{"$ref":"#/components/schemas/BlueWithdrawSimulationUnavailableData"},{"$ref":"#/components/schemas/BlueWithdrawSignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/BlueWithdrawPreparedData","simulation_failed":"#/components/schemas/BlueWithdrawSimulationFailedData","simulation_unavailable":"#/components/schemas/BlueWithdrawSimulationUnavailableData","signature_required":"#/components/schemas/BlueWithdrawSignatureRequiredData"}}},"BlueWithdrawPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["blue.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/BlueWithdrawSimulation"},"amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawAmountShares"},{"$ref":"#/components/schemas/BlueWithdrawAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawAmountAssets","shares":"#/components/schemas/BlueWithdrawAmountShares","all":"#/components/schemas/BlueWithdrawAmountAll"}}},"resolved_amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawResolvedAmountAssets","shares":"#/components/schemas/BlueWithdrawResolvedAmountShares"}}}},"required":["action_id","status","action","chain_id","account","expires_at","market","calls","simulation","amount","resolved_amount"],"additionalProperties":false},"BlueWithdrawCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["authorization","blue_withdraw"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"BlueWithdrawSimulation":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawSimulationSuccess"},{"$ref":"#/components/schemas/BlueWithdrawSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/BlueWithdrawSimulationSuccess","failed":"#/components/schemas/BlueWithdrawSimulationFailure"}}},"BlueWithdrawSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/BluePositionChanges"},"effects":{"$ref":"#/components/schemas/BlueWithdrawEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"BlueWithdrawEffects":{"type":"object","properties":{"gross_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets withdrawn before the referral fee, in loan asset base units."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Loan assets paid as the referral fee, in loan asset base units."}]},"net_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets received after the referral fee, in loan asset base units."}]}},"required":["gross_assets","referral_fee_assets","net_assets"],"additionalProperties":false,"description":"Withdrawal amounts confirmed by the simulation."},"BlueWithdrawSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"BlueWithdrawResolvedAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"BlueWithdrawResolvedAmountShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"BlueWithdrawSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["blue.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"simulation":{"$ref":"#/components/schemas/BlueWithdrawSimulation"},"amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawAmountShares"},{"$ref":"#/components/schemas/BlueWithdrawAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawAmountAssets","shares":"#/components/schemas/BlueWithdrawAmountShares","all":"#/components/schemas/BlueWithdrawAmountAll"}}},"resolved_amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawResolvedAmountAssets","shares":"#/components/schemas/BlueWithdrawResolvedAmountShares"}}}},"required":["action_id","status","action","chain_id","account","expires_at","market","simulation","amount","resolved_amount"],"additionalProperties":false},"BlueWithdrawSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["blue.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawAmountShares"},{"$ref":"#/components/schemas/BlueWithdrawAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawAmountAssets","shares":"#/components/schemas/BlueWithdrawAmountShares","all":"#/components/schemas/BlueWithdrawAmountAll"}}},"resolved_amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawResolvedAmountAssets","shares":"#/components/schemas/BlueWithdrawResolvedAmountShares"}}}},"required":["action_id","status","action","chain_id","account","expires_at","market","calls","simulation","amount","resolved_amount"],"additionalProperties":false},"BlueWithdrawSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["blue.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"BlueWithdrawPreparedResponse":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["blue.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/BlueWithdrawSimulation"},"amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawAmountShares"},{"$ref":"#/components/schemas/BlueWithdrawAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawAmountAssets","shares":"#/components/schemas/BlueWithdrawAmountShares","all":"#/components/schemas/BlueWithdrawAmountAll"}}},"resolved_amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawResolvedAmountAssets","shares":"#/components/schemas/BlueWithdrawResolvedAmountShares"}}}},"required":["action_id","status","action","chain_id","account","expires_at","market","calls","simulation","amount","resolved_amount"],"additionalProperties":false},{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["blue.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"simulation":{"$ref":"#/components/schemas/BlueWithdrawSimulation"},"amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawAmountShares"},{"$ref":"#/components/schemas/BlueWithdrawAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawAmountAssets","shares":"#/components/schemas/BlueWithdrawAmountShares","all":"#/components/schemas/BlueWithdrawAmountAll"}}},"resolved_amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawResolvedAmountAssets","shares":"#/components/schemas/BlueWithdrawResolvedAmountShares"}}}},"required":["action_id","status","action","chain_id","account","expires_at","market","simulation","amount","resolved_amount"],"additionalProperties":false},{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["blue.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawAmountShares"},{"$ref":"#/components/schemas/BlueWithdrawAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawAmountAssets","shares":"#/components/schemas/BlueWithdrawAmountShares","all":"#/components/schemas/BlueWithdrawAmountAll"}}},"resolved_amount":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/BlueWithdrawResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueWithdrawResolvedAmountAssets","shares":"#/components/schemas/BlueWithdrawResolvedAmountShares"}}}},"required":["action_id","status","action","chain_id","account","expires_at","market","calls","simulation","amount","resolved_amount"],"additionalProperties":false}],"discriminator":{"propertyName":"status","mapping":{}}}},"required":["data"],"additionalProperties":false},"BlueWithdrawSignatureRequiredResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BlueWithdrawSignatureRequiredData"}},"required":["data"],"additionalProperties":false},"VaultV2DepositRequest":{"oneOf":[{"$ref":"#/components/schemas/VaultV2DepositIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"VaultV2DepositIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"amount":{"$ref":"#/components/schemas/VaultV2DepositIntentAmountAssets"},"slippage_bps":{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"funding":{"$ref":"#/components/schemas/ActionFunding"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"}},"required":["account","amount","funding"],"additionalProperties":false},"VaultV2DepositIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Gross deposit amount in vault asset base units."}]}},"required":["unit","value"],"additionalProperties":false},"VaultSlippageBasisPoints":{"type":"integer","minimum":0,"maximum":1000,"description":"Slippage bound in basis points."},"VaultV2DepositResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultV2DepositResponseData"}},"required":["data"],"additionalProperties":false},"VaultV2DepositResponseData":{"oneOf":[{"$ref":"#/components/schemas/VaultV2DepositPreparedData"},{"$ref":"#/components/schemas/VaultV2DepositSimulationFailedData"},{"$ref":"#/components/schemas/VaultV2DepositSimulationUnavailableData"},{"$ref":"#/components/schemas/VaultV2DepositSignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/VaultV2DepositPreparedData","simulation_failed":"#/components/schemas/VaultV2DepositSimulationFailedData","simulation_unavailable":"#/components/schemas/VaultV2DepositSimulationUnavailableData","signature_required":"#/components/schemas/VaultV2DepositSignatureRequiredData"}}},"VaultV2DepositPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["vault_v2.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV2DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Effective slippage bound in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2DepositCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/VaultV2DepositSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","calls","simulation"],"additionalProperties":false},"VaultV2DepositResponseAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Deposited asset amount in base units."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV2DepositCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","vault_v2_deposit"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"VaultV2DepositSimulation":{"oneOf":[{"$ref":"#/components/schemas/VaultV2DepositSimulationSuccess"},{"$ref":"#/components/schemas/VaultV2DepositSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/VaultV2DepositSimulationSuccess","failed":"#/components/schemas/VaultV2DepositSimulationFailure"}}},"VaultV2DepositSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/VaultPositionChanges"},"effects":{"$ref":"#/components/schemas/VaultV2DepositEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"VaultV2DepositEffects":{"type":"object","properties":{"gross_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets supplied before the referral fee, in asset base units."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets paid as the referral fee, in asset base units."}]},"net_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets deposited after the referral fee, in asset base units."}]}},"required":["gross_assets","referral_fee_assets","net_assets"],"additionalProperties":false,"description":"Amounts and funding mode confirmed by the simulation."},"VaultV2DepositSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"VaultV2DepositSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["vault_v2.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV2DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Effective slippage bound in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/VaultV2DepositSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","simulation"],"additionalProperties":false},"VaultV2DepositSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["vault_v2.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV2DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Effective slippage bound in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2DepositCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","calls","simulation"],"additionalProperties":false},"VaultV2DepositSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["vault_v2.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"VaultV2DepositPreparedResponse":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["vault_v2.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV2DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Effective slippage bound in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2DepositCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/VaultV2DepositSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","calls","simulation"],"additionalProperties":false},{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["vault_v2.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV2DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Effective slippage bound in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/VaultV2DepositSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","simulation"],"additionalProperties":false},{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["vault_v2.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV2DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Effective slippage bound in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2DepositCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","calls","simulation"],"additionalProperties":false}],"discriminator":{"propertyName":"status","mapping":{}}}},"required":["data"],"additionalProperties":false},"VaultV2DepositSignatureRequiredResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultV2DepositSignatureRequiredData"}},"required":["data"],"additionalProperties":false},"VaultV1DepositRequest":{"oneOf":[{"$ref":"#/components/schemas/VaultV1DepositIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"VaultV1DepositIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"amount":{"$ref":"#/components/schemas/VaultV1DepositIntentAmountAssets"},"slippage_bps":{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"funding":{"$ref":"#/components/schemas/ActionFunding"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"}},"required":["account","amount","funding"],"additionalProperties":false},"VaultV1DepositIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Gross deposit amount in vault asset base units."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV1DepositResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultV1DepositResponseData"}},"required":["data"],"additionalProperties":false},"VaultV1DepositResponseData":{"oneOf":[{"$ref":"#/components/schemas/VaultV1DepositPreparedData"},{"$ref":"#/components/schemas/VaultV1DepositSimulationFailedData"},{"$ref":"#/components/schemas/VaultV1DepositSimulationUnavailableData"},{"$ref":"#/components/schemas/VaultV1DepositSignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/VaultV1DepositPreparedData","simulation_failed":"#/components/schemas/VaultV1DepositSimulationFailedData","simulation_unavailable":"#/components/schemas/VaultV1DepositSimulationUnavailableData","signature_required":"#/components/schemas/VaultV1DepositSignatureRequiredData"}}},"VaultV1DepositPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["vault_v1.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV1DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV1DepositCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/VaultV1DepositSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","calls","simulation"],"additionalProperties":false},"VaultV1DepositResponseAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Deposited loan asset amount in base units."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV1DepositCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","vault_v1_deposit"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"VaultV1DepositSimulation":{"oneOf":[{"$ref":"#/components/schemas/VaultV1DepositSimulationSuccess"},{"$ref":"#/components/schemas/VaultV1DepositSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/VaultV1DepositSimulationSuccess","failed":"#/components/schemas/VaultV1DepositSimulationFailure"}}},"VaultV1DepositSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/VaultPositionChanges"},"effects":{"$ref":"#/components/schemas/VaultV1DepositEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"VaultV1DepositEffects":{"type":"object","properties":{"gross_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets supplied before the referral fee, in asset base units."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets paid as the referral fee, in asset base units."}]},"net_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets deposited after the referral fee, in asset base units."}]}},"required":["gross_assets","referral_fee_assets","net_assets"],"additionalProperties":false,"description":"Amounts and funding mode confirmed by the simulation."},"VaultV1DepositSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"VaultV1DepositSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["vault_v1.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV1DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/VaultV1DepositSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","simulation"],"additionalProperties":false},"VaultV1DepositSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["vault_v1.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV1DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV1DepositCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","calls","simulation"],"additionalProperties":false},"VaultV1DepositSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["vault_v1.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"VaultV1DepositPreparedResponse":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["vault_v1.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV1DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV1DepositCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/VaultV1DepositSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","calls","simulation"],"additionalProperties":false},{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["vault_v1.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV1DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/VaultV1DepositSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","simulation"],"additionalProperties":false},{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["vault_v1.deposit"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV1DepositResponseAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV1DepositCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","amount","slippage_bps","resolved_funding","calls","simulation"],"additionalProperties":false}],"discriminator":{"propertyName":"status","mapping":{}}}},"required":["data"],"additionalProperties":false},"VaultV1DepositSignatureRequiredResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultV1DepositSignatureRequiredData"}},"required":["data"],"additionalProperties":false},"VaultV1WithdrawData":{"oneOf":[{"$ref":"#/components/schemas/VaultV1WithdrawPreparedData"},{"$ref":"#/components/schemas/VaultV1WithdrawSimulationFailedData"},{"$ref":"#/components/schemas/VaultV1WithdrawSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/VaultV1WithdrawPreparedData","simulation_failed":"#/components/schemas/VaultV1WithdrawSimulationFailedData","simulation_unavailable":"#/components/schemas/VaultV1WithdrawSimulationUnavailableData"}}},"VaultV1WithdrawPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"resolved_amount":{"$ref":"#/components/schemas/VaultV1WithdrawResolvedAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV1Call"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/VaultV1ExitSimulation"},"action":{"type":"string","enum":["vault_v1.withdraw"]},"amount":{"$ref":"#/components/schemas/VaultV1WithdrawResponseAmount"},"share_decimals":{"$ref":"#/components/schemas/VaultShareDecimals"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]}},"required":["action_id","status","chain_id","account","expires_at","vault","resolved_amount","calls","simulation","action","amount"],"additionalProperties":false},"VaultV1WithdrawResolvedAmount":{"oneOf":[{"$ref":"#/components/schemas/VaultV1WithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/VaultV1WithdrawResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/VaultV1WithdrawResolvedAmountAssets","shares":"#/components/schemas/VaultV1WithdrawResolvedAmountShares"}}},"VaultV1WithdrawResolvedAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV1WithdrawResolvedAmountShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV1Call":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","vault_v1_withdraw","vault_v1_redeem"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"VaultV1ExitSimulation":{"oneOf":[{"$ref":"#/components/schemas/VaultV1ExitSimulationSuccess"},{"$ref":"#/components/schemas/VaultV1ExitSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/VaultV1ExitSimulationSuccess","failed":"#/components/schemas/VaultV1ExitSimulationFailure"}}},"VaultV1ExitSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/VaultPositionChanges"},"effects":{"$ref":"#/components/schemas/VaultV1ExitEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"VaultV1ExitEffects":{"type":"object","properties":{"gross_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Vault assets withdrawn before the referral fee, in asset base units."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets paid as the referral fee, in asset base units."}]},"net_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Vault assets received after the referral fee, in asset base units."}]}},"required":["gross_assets","referral_fee_assets","net_assets"],"additionalProperties":false,"description":"Withdrawal amounts confirmed by the simulation."},"VaultV1ExitSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"VaultV1WithdrawResponseAmount":{"oneOf":[{"$ref":"#/components/schemas/VaultV1WithdrawResponseAssets"},{"$ref":"#/components/schemas/VaultV1WithdrawResponseShares"},{"$ref":"#/components/schemas/VaultV1WithdrawResponseAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/VaultV1WithdrawResponseAssets","shares":"#/components/schemas/VaultV1WithdrawResponseShares","all":"#/components/schemas/VaultV1WithdrawResponseAll"}}},"VaultV1WithdrawResponseAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV1WithdrawResponseShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV1WithdrawResponseAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"VaultV1WithdrawSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"resolved_amount":{"$ref":"#/components/schemas/VaultV1WithdrawResolvedAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"simulation":{"$ref":"#/components/schemas/VaultV1ExitSimulation"},"action":{"type":"string","enum":["vault_v1.withdraw"]},"amount":{"$ref":"#/components/schemas/VaultV1WithdrawResponseAmount"},"share_decimals":{"$ref":"#/components/schemas/VaultShareDecimals"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]}},"required":["action_id","status","chain_id","account","expires_at","vault","resolved_amount","simulation","action","amount"],"additionalProperties":false},"VaultV1WithdrawSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"resolved_amount":{"$ref":"#/components/schemas/VaultV1WithdrawResolvedAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV1Call"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"action":{"type":"string","enum":["vault_v1.withdraw"]},"amount":{"$ref":"#/components/schemas/VaultV1WithdrawResponseAmount"},"share_decimals":{"$ref":"#/components/schemas/VaultShareDecimals"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]}},"required":["action_id","status","chain_id","account","expires_at","vault","resolved_amount","calls","simulation","action","amount"],"additionalProperties":false},"VaultV2WithdrawData":{"oneOf":[{"$ref":"#/components/schemas/VaultV2WithdrawPreparedData"},{"$ref":"#/components/schemas/VaultV2WithdrawSimulationFailedData"},{"$ref":"#/components/schemas/VaultV2WithdrawSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/VaultV2WithdrawPreparedData","simulation_failed":"#/components/schemas/VaultV2WithdrawSimulationFailedData","simulation_unavailable":"#/components/schemas/VaultV2WithdrawSimulationUnavailableData"}}},"VaultV2WithdrawPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"resolved_amount":{"$ref":"#/components/schemas/VaultV2WithdrawResolvedAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2Call"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/VaultV2ExitSimulation"},"action":{"type":"string","enum":["vault_v2.withdraw"]},"amount":{"$ref":"#/components/schemas/VaultV2WithdrawResponseAmount"},"share_decimals":{"$ref":"#/components/schemas/VaultShareDecimals"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]}},"required":["action_id","status","chain_id","account","expires_at","vault","resolved_amount","calls","simulation","action","amount"],"additionalProperties":false},"VaultV2WithdrawResolvedAmount":{"oneOf":[{"$ref":"#/components/schemas/VaultV2WithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/VaultV2WithdrawResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/VaultV2WithdrawResolvedAmountAssets","shares":"#/components/schemas/VaultV2WithdrawResolvedAmountShares"}}},"VaultV2WithdrawResolvedAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV2WithdrawResolvedAmountShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV2Call":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","vault_v2_withdraw","vault_v2_redeem"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"VaultV2ExitSimulation":{"oneOf":[{"$ref":"#/components/schemas/VaultV2ExitSimulationSuccess"},{"$ref":"#/components/schemas/VaultV2ExitSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/VaultV2ExitSimulationSuccess","failed":"#/components/schemas/VaultV2ExitSimulationFailure"}}},"VaultV2ExitSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/VaultPositionChanges"},"effects":{"$ref":"#/components/schemas/VaultV2ExitEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"VaultV2ExitEffects":{"type":"object","properties":{"gross_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Vault assets withdrawn before the referral fee, in asset base units."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets paid as the referral fee, in asset base units."}]},"net_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Vault assets received after the referral fee, in asset base units."}]}},"required":["gross_assets","referral_fee_assets","net_assets"],"additionalProperties":false,"description":"Withdrawal amounts confirmed by the simulation."},"VaultV2ExitSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"VaultV2WithdrawResponseAmount":{"oneOf":[{"$ref":"#/components/schemas/VaultV2WithdrawResponseAssets"},{"$ref":"#/components/schemas/VaultV2WithdrawResponseShares"},{"$ref":"#/components/schemas/VaultV2WithdrawResponseAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/VaultV2WithdrawResponseAssets","shares":"#/components/schemas/VaultV2WithdrawResponseShares","all":"#/components/schemas/VaultV2WithdrawResponseAll"}}},"VaultV2WithdrawResponseAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV2WithdrawResponseShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV2WithdrawResponseAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"VaultV2WithdrawSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"resolved_amount":{"$ref":"#/components/schemas/VaultV2WithdrawResolvedAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"simulation":{"$ref":"#/components/schemas/VaultV2ExitSimulation"},"action":{"type":"string","enum":["vault_v2.withdraw"]},"amount":{"$ref":"#/components/schemas/VaultV2WithdrawResponseAmount"},"share_decimals":{"$ref":"#/components/schemas/VaultShareDecimals"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]}},"required":["action_id","status","chain_id","account","expires_at","vault","resolved_amount","simulation","action","amount"],"additionalProperties":false},"VaultV2WithdrawSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"resolved_amount":{"$ref":"#/components/schemas/VaultV2WithdrawResolvedAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2Call"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"action":{"type":"string","enum":["vault_v2.withdraw"]},"amount":{"$ref":"#/components/schemas/VaultV2WithdrawResponseAmount"},"share_decimals":{"$ref":"#/components/schemas/VaultShareDecimals"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]}},"required":["action_id","status","chain_id","account","expires_at","vault","resolved_amount","calls","simulation","action","amount"],"additionalProperties":false},"VaultV2ForceWithdrawData":{"oneOf":[{"$ref":"#/components/schemas/VaultV2ForceWithdrawAssetsPreparedData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAssetsSimulationFailedData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAssetsSimulationUnavailableData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAllPreparedData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAllSimulationFailedData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAllSimulationUnavailableData"}]},"VaultV2ForceWithdrawAssetsPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"action":{"type":"string","enum":["vault_v2.force_withdraw"]},"resolved_amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawResolvedAmount"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2ForceWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/VaultV2ForceExitSimulation"},"amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawAmountAssets"}},"required":["action_id","status","chain_id","account","expires_at","vault","action","resolved_amount","calls","simulation","amount"],"additionalProperties":false},"VaultV2ForceWithdrawResolvedAmount":{"oneOf":[{"$ref":"#/components/schemas/VaultV2ForceWithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/VaultV2ForceWithdrawResolvedAmountAssets","shares":"#/components/schemas/VaultV2ForceWithdrawResolvedAmountShares"}}},"VaultV2ForceWithdrawResolvedAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV2ForceWithdrawResolvedAmountShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV2ForceWithdrawCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","vault_v2_force_withdraw","vault_v2_force_redeem"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"VaultV2ForceExitSimulation":{"oneOf":[{"$ref":"#/components/schemas/VaultV2ForceExitSimulationSuccess"},{"$ref":"#/components/schemas/VaultV2ForceExitSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/VaultV2ForceExitSimulationSuccess","failed":"#/components/schemas/VaultV2ForceExitSimulationFailure"}}},"VaultV2ForceExitSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/VaultPositionChanges"},"effects":{"$ref":"#/components/schemas/VaultV2ForceExitEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"VaultV2ForceExitEffects":{"type":"object","properties":{"received_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Vault assets received by the wallet after fees and penalties, in asset base units."}]},"penalty_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets retained as the force-exit penalty, in asset base units."}]},"remaining_shares":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault shares remaining after the simulated force exit, in share base units."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets paid as the referral fee, in asset base units."}]}},"required":["received_assets","penalty_assets","remaining_shares"],"additionalProperties":false,"description":"Force-withdraw amounts confirmed by the simulation."},"VaultV2ForceExitSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"VaultV2ForceWithdrawAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"VaultV2ForceWithdrawAssetsSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"action":{"type":"string","enum":["vault_v2.force_withdraw"]},"resolved_amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawResolvedAmount"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"simulation":{"$ref":"#/components/schemas/VaultV2ForceExitSimulation"},"amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawAmountAssets"}},"required":["action_id","status","chain_id","account","expires_at","vault","action","resolved_amount","simulation","amount"],"additionalProperties":false},"VaultV2ForceWithdrawAssetsSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"action":{"type":"string","enum":["vault_v2.force_withdraw"]},"resolved_amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawResolvedAmount"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2ForceWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawAmountAssets"}},"required":["action_id","status","chain_id","account","expires_at","vault","action","resolved_amount","calls","simulation","amount"],"additionalProperties":false},"VaultV2ForceWithdrawAllPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionExpiry"},{"description":"Off-chain response-validity timestamp; the returned force-redeem multicall has no on-chain deadline and does not enforce this time."}]},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"action":{"type":"string","enum":["vault_v2.force_withdraw"]},"resolved_amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawResolvedAmount"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2ForceWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/VaultV2ForceRedeemSimulation"},"amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawAmountAll"},"share_decimals":{"$ref":"#/components/schemas/VaultShareDecimals"},"residual_shares":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Planned vault shares remaining after the all-position force-redeem, in share base units; the simulated remainder is `simulation.effects.remaining_shares` and can differ slightly."}]},"planned_penalty_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Underlying vault assets planned to be retained as the force-withdraw penalty, in asset base units."}]},"planned_penalty_shares":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Additional vault shares planned to be burned by force-deallocation penalties, in share base units."}]},"planned_redeem_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Preview at preparation of underlying vault assets from redemption of the planned shares, in asset base units. This excludes force-deallocation liquidity buffer assets. The preparation check permits one basis point of adverse state drift. The API checks only at preparation. The on-chain transaction does not enforce a minimum payout."}]},"max_penalty_bps":{"$ref":"#/components/schemas/ForceRedeemPenaltyBasisPoints"}},"required":["action_id","status","chain_id","account","expires_at","vault","action","resolved_amount","calls","simulation","amount","share_decimals","residual_shares","planned_penalty_assets","planned_penalty_shares","planned_redeem_assets","max_penalty_bps"],"additionalProperties":false},"VaultV2ForceRedeemSimulation":{"oneOf":[{"$ref":"#/components/schemas/VaultV2ForceRedeemSimulationSuccess"},{"$ref":"#/components/schemas/VaultV2ForceRedeemSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/VaultV2ForceRedeemSimulationSuccess","failed":"#/components/schemas/VaultV2ForceRedeemSimulationFailure"}}},"VaultV2ForceRedeemSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/VaultPositionChanges"},"effects":{"$ref":"#/components/schemas/VaultV2ForceRedeemEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"VaultV2ForceRedeemEffects":{"type":"object","properties":{"received_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Vault assets received by the wallet after fees and penalties, in asset base units."}]},"penalty_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault assets retained as the force-exit penalty, in asset base units."}]},"remaining_shares":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Vault shares remaining after the simulated force exit, in share base units."}]}},"required":["received_assets","penalty_assets","remaining_shares"],"additionalProperties":false,"description":"Force-redeem amounts confirmed by the simulation."},"VaultV2ForceRedeemSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"VaultV2ForceWithdrawAmountAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"ForceRedeemPenaltyBasisPoints":{"type":"integer","minimum":0,"maximum":200,"description":"Maximum total force-deallocate penalty relative to the pre-exit position, in basis points. For non-recipients, preparation compares this limit with the greater of the planned penalty and the asset value of shares left unredeemed (planned penalty shares plus residual). Fee recipients are bounded by the 2% per-leg cap even when their fees are currently zero; this role-based bound does not depend on current fee rates, which can change before the action expires. If a fee recipient's 10 bps buffered plan exceeds the limit, the API retries with the largest smaller buffer, down to 1 bps, whose per-leg worst case fits; otherwise preparation returns 422. The on-chain transaction does not check this limit."},"VaultV2ForceWithdrawAllSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionExpiry"},{"description":"Off-chain response-validity timestamp; the returned force-redeem multicall has no on-chain deadline and does not enforce this time."}]},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"action":{"type":"string","enum":["vault_v2.force_withdraw"]},"resolved_amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawResolvedAmount"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"simulation":{"$ref":"#/components/schemas/VaultV2ForceRedeemSimulation"},"amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawAmountAll"},"share_decimals":{"$ref":"#/components/schemas/VaultShareDecimals"},"residual_shares":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Planned vault shares remaining after the all-position force-redeem, in share base units; the simulated remainder is `simulation.effects.remaining_shares` and can differ slightly."}]},"planned_penalty_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Underlying vault assets planned to be retained as the force-withdraw penalty, in asset base units."}]},"planned_penalty_shares":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Additional vault shares planned to be burned by force-deallocation penalties, in share base units."}]},"planned_redeem_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Preview at preparation of underlying vault assets from redemption of the planned shares, in asset base units. This excludes force-deallocation liquidity buffer assets. The preparation check permits one basis point of adverse state drift. The API checks only at preparation. The on-chain transaction does not enforce a minimum payout."}]},"max_penalty_bps":{"$ref":"#/components/schemas/ForceRedeemPenaltyBasisPoints"}},"required":["action_id","status","chain_id","account","expires_at","vault","action","resolved_amount","simulation","amount","share_decimals","residual_shares","planned_penalty_assets","planned_penalty_shares","planned_redeem_assets","max_penalty_bps"],"additionalProperties":false},"VaultV2ForceWithdrawAllSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionExpiry"},{"description":"Off-chain response-validity timestamp; the returned force-redeem multicall has no on-chain deadline and does not enforce this time."}]},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"action":{"type":"string","enum":["vault_v2.force_withdraw"]},"resolved_amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawResolvedAmount"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault slippage in basis points."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2ForceWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawAmountAll"},"share_decimals":{"$ref":"#/components/schemas/VaultShareDecimals"},"residual_shares":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Planned vault shares remaining after the all-position force-redeem, in share base units; the simulated remainder is `simulation.effects.remaining_shares` and can differ slightly."}]},"planned_penalty_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Underlying vault assets planned to be retained as the force-withdraw penalty, in asset base units."}]},"planned_penalty_shares":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Additional vault shares planned to be burned by force-deallocation penalties, in share base units."}]},"planned_redeem_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Preview at preparation of underlying vault assets from redemption of the planned shares, in asset base units. This excludes force-deallocation liquidity buffer assets. The preparation check permits one basis point of adverse state drift. The API checks only at preparation. The on-chain transaction does not enforce a minimum payout."}]},"max_penalty_bps":{"$ref":"#/components/schemas/ForceRedeemPenaltyBasisPoints"}},"required":["action_id","status","chain_id","account","expires_at","vault","action","resolved_amount","calls","simulation","amount","share_decimals","residual_shares","planned_penalty_assets","planned_penalty_shares","planned_redeem_assets","max_penalty_bps"],"additionalProperties":false},"MarketSelectorUsdcCbBtc":{"type":"string","pattern":"^(?:[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990|9007199254740991):0x[0-9a-fA-F]{64}$","description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","example":"8453:0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836"},"MarketSelectorUsdcWeEth":{"type":"string","pattern":"^(?:[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990|9007199254740991):0x[0-9a-fA-F]{64}$","description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","example":"8453:0x0ca10126f6c94cbd9cf0a48cc9516ae5e3dec5aa68303e6d988ee37c5149bf0d"},"BlueRepayResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BlueRepayResponseData"}},"required":["data"],"additionalProperties":false},"BlueRepayResponseData":{"oneOf":[{"$ref":"#/components/schemas/BlueRepayPreparedData"},{"$ref":"#/components/schemas/BlueRepaySimulationFailedData"},{"$ref":"#/components/schemas/BlueRepaySimulationUnavailableData"},{"$ref":"#/components/schemas/BlueRepaySignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/BlueRepayPreparedData","simulation_failed":"#/components/schemas/BlueRepaySimulationFailedData","simulation_unavailable":"#/components/schemas/BlueRepaySimulationUnavailableData","signature_required":"#/components/schemas/BlueRepaySignatureRequiredData"}}},"BlueRepayPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"max_repay_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Maximum loan asset amount that can leave the wallet, including any referral fee and share-mode interest accrued since the quote."}]},"resolved_amount":{"oneOf":[{"$ref":"#/components/schemas/BlueRepayResolvedAmountAssets"},{"$ref":"#/components/schemas/BlueRepayResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueRepayResolvedAmountAssets","shares":"#/components/schemas/BlueRepayResolvedAmountShares"}}},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueRepayCall"},"minItems":1,"maxItems":4},"action":{"type":"string","enum":["blue.repay"]},"amount":{"oneOf":[{"$ref":"#/components/schemas/BlueRepayResponseAmountAssets"},{"$ref":"#/components/schemas/BlueRepayResponseAmountShares"},{"$ref":"#/components/schemas/BlueRepayResponseAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueRepayResponseAmountAssets","shares":"#/components/schemas/BlueRepayResponseAmountShares","all":"#/components/schemas/BlueRepayResponseAmountAll"}}},"collateral_amount":{"$ref":"#/components/schemas/BlueRepayResponseCollateralAmountAssets"},"simulation":{"$ref":"#/components/schemas/BlueRepaySimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","max_repay_assets","resolved_amount","resolved_funding","calls","action","amount","simulation"],"additionalProperties":false},"BlueRepayResolvedAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"BlueRepayResolvedAmountShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"BlueRepayCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","blue_repay","blue_repay_withdraw_collateral"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"BlueRepayResponseAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"BlueRepayResponseAmountShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"BlueRepayResponseAmountAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"BlueRepayResponseCollateralAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral asset amount withdrawn in base units. Present only when the request included collateral_amount."}]}},"required":["unit","value"],"additionalProperties":false},"BlueRepaySimulation":{"oneOf":[{"$ref":"#/components/schemas/BlueRepaySimulationSuccess"},{"$ref":"#/components/schemas/BlueRepaySimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/BlueRepaySimulationSuccess","failed":"#/components/schemas/BlueRepaySimulationFailure"}}},"BlueRepaySimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/BluePositionChanges"},"effects":{"$ref":"#/components/schemas/BlueRepayEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"BlueRepayEffects":{"type":"object","properties":{"repaid_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets applied to the debt, in loan asset base units."}]},"repaid_shares":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Borrow shares repaid by the action."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Loan assets paid as the referral fee, in loan asset base units."}]},"withdrawn_collateral_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral returned to the wallet, in collateral asset base units. Present only when the request included collateral_amount."}]},"ltv_bps":{"type":"integer","minimum":0,"description":"Position loan-to-value after the action, in basis points of the oracle-priced collateral, rounded up."},"max_ltv_bps":{"type":"integer","minimum":0,"description":"Highest loan-to-value the returned calls accept on-chain at execution (the market LLTV minus a 0.5% buffer), in basis points."}},"required":["repaid_assets","repaid_shares","referral_fee_assets"],"additionalProperties":false,"description":"Repayment amounts and funding mode confirmed by the simulation."},"BlueRepaySimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"BlueRepaySimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"max_repay_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Maximum loan asset amount that can leave the wallet, including any referral fee and share-mode interest accrued since the quote."}]},"resolved_amount":{"oneOf":[{"$ref":"#/components/schemas/BlueRepayResolvedAmountAssets"},{"$ref":"#/components/schemas/BlueRepayResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueRepayResolvedAmountAssets","shares":"#/components/schemas/BlueRepayResolvedAmountShares"}}},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"action":{"type":"string","enum":["blue.repay"]},"amount":{"oneOf":[{"$ref":"#/components/schemas/BlueRepayResponseAmountAssets"},{"$ref":"#/components/schemas/BlueRepayResponseAmountShares"},{"$ref":"#/components/schemas/BlueRepayResponseAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueRepayResponseAmountAssets","shares":"#/components/schemas/BlueRepayResponseAmountShares","all":"#/components/schemas/BlueRepayResponseAmountAll"}}},"collateral_amount":{"$ref":"#/components/schemas/BlueRepayResponseCollateralAmountAssets"},"simulation":{"$ref":"#/components/schemas/BlueRepaySimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","max_repay_assets","resolved_amount","resolved_funding","action","amount","simulation"],"additionalProperties":false},"BlueRepaySimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset","collateral_asset"],"additionalProperties":false},"max_repay_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Maximum loan asset amount that can leave the wallet, including any referral fee and share-mode interest accrued since the quote."}]},"resolved_amount":{"oneOf":[{"$ref":"#/components/schemas/BlueRepayResolvedAmountAssets"},{"$ref":"#/components/schemas/BlueRepayResolvedAmountShares"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueRepayResolvedAmountAssets","shares":"#/components/schemas/BlueRepayResolvedAmountShares"}}},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueRepayCall"},"minItems":1,"maxItems":4},"action":{"type":"string","enum":["blue.repay"]},"amount":{"oneOf":[{"$ref":"#/components/schemas/BlueRepayResponseAmountAssets"},{"$ref":"#/components/schemas/BlueRepayResponseAmountShares"},{"$ref":"#/components/schemas/BlueRepayResponseAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueRepayResponseAmountAssets","shares":"#/components/schemas/BlueRepayResponseAmountShares","all":"#/components/schemas/BlueRepayResponseAmountAll"}}},"collateral_amount":{"$ref":"#/components/schemas/BlueRepayResponseCollateralAmountAssets"},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","max_repay_assets","resolved_amount","resolved_funding","calls","action","amount","simulation"],"additionalProperties":false},"BlueRepaySignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["blue.repay"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"BlueRepayRequest":{"description":"Repay only, repay and withdraw collateral in one atomic action, or continue a prepared action with collected signatures.","oneOf":[{"$ref":"#/components/schemas/BlueRepayIntent"},{"$ref":"#/components/schemas/BlueRepayWithdrawCollateralIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"BlueRepayIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"$ref":"#/components/schemas/ActionRequestedExpiry"},"amount":{"$ref":"#/components/schemas/BlueRepayAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"funding":{"$ref":"#/components/schemas/ActionFunding"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"}},"required":["account","amount","funding"],"additionalProperties":false},"BlueRepayAmount":{"oneOf":[{"$ref":"#/components/schemas/BlueRepayAmountAssets"},{"$ref":"#/components/schemas/BlueRepayAmountShares"},{"$ref":"#/components/schemas/BlueRepayAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/BlueRepayAmountAssets","shares":"#/components/schemas/BlueRepayAmountShares","all":"#/components/schemas/BlueRepayAmountAll"}}},"BlueRepayAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact loan asset amount to repay in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueRepayAmountShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact Morpho Blue borrow-share amount below maxUint256; use {\"unit\":\"all\"} for a full repay."}]}},"required":["unit","value"],"additionalProperties":false},"BlueRepayAmountAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false,"description":"Repays the whole borrow position."},"BlueRepayWithdrawCollateralIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"$ref":"#/components/schemas/ActionRequestedExpiry"},"amount":{"$ref":"#/components/schemas/BlueRepayAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"funding":{"$ref":"#/components/schemas/ActionFunding"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"collateral_amount":{"$ref":"#/components/schemas/BlueRepayCollateralIntentAmountAssets"}},"required":["account","amount","funding","collateral_amount"],"additionalProperties":false},"BlueRepayCollateralIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact collateral asset amount to withdraw in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueSupplyCollateralResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BlueSupplyCollateralResponseData"}},"required":["data"],"additionalProperties":false},"BlueSupplyCollateralResponseData":{"oneOf":[{"$ref":"#/components/schemas/BlueSupplyCollateralPreparedData"},{"$ref":"#/components/schemas/BlueSupplyCollateralSimulationFailedData"},{"$ref":"#/components/schemas/BlueSupplyCollateralSimulationUnavailableData"},{"$ref":"#/components/schemas/BlueSupplyCollateralSignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/BlueSupplyCollateralPreparedData","simulation_failed":"#/components/schemas/BlueSupplyCollateralSimulationFailedData","simulation_unavailable":"#/components/schemas/BlueSupplyCollateralSimulationUnavailableData","signature_required":"#/components/schemas/BlueSupplyCollateralSignatureRequiredData"}}},"BlueSupplyCollateralPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","collateral_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueCollateralResponseAmountAssets"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueCollateralCall"},"minItems":1,"maxItems":3},"action":{"type":"string","enum":["blue.supply_collateral"]},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/BlueSupplyCollateralSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","amount","calls","action","resolved_funding","simulation"],"additionalProperties":false},"BlueCollateralResponseAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral asset amount in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueCollateralCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","blue_supply_collateral","blue_withdraw_collateral"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"BlueSupplyCollateralSimulation":{"oneOf":[{"$ref":"#/components/schemas/BlueSupplyCollateralSimulationSuccess"},{"$ref":"#/components/schemas/BlueSupplyCollateralSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/BlueSupplyCollateralSimulationSuccess","failed":"#/components/schemas/BlueSupplyCollateralSimulationFailure"}}},"BlueSupplyCollateralSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/BluePositionChanges"},"effects":{"$ref":"#/components/schemas/BlueSupplyCollateralEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"BlueSupplyCollateralEffects":{"type":"object","properties":{"supplied_collateral_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral supplied, in collateral asset base units."}]}},"required":["supplied_collateral_assets"],"additionalProperties":false,"description":"Collateral supply confirmed by the simulation."},"BlueSupplyCollateralSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"BlueSupplyCollateralSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","collateral_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueCollateralResponseAmountAssets"},"action":{"type":"string","enum":["blue.supply_collateral"]},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/BlueSupplyCollateralSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","amount","action","resolved_funding","simulation"],"additionalProperties":false},"BlueSupplyCollateralSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","collateral_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueCollateralResponseAmountAssets"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueCollateralCall"},"minItems":1,"maxItems":3},"action":{"type":"string","enum":["blue.supply_collateral"]},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","amount","calls","action","resolved_funding","simulation"],"additionalProperties":false},"BlueSupplyCollateralSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["blue.supply_collateral"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"MarketSelectorUsdcWeth":{"type":"string","pattern":"^(?:[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990|9007199254740991):0x[0-9a-fA-F]{64}$","description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","example":"8453:0x8793cf302b8ffd655ab97bd1c695dbd967807e8367a65cb2f4edaf1380ba1bda"},"BlueSupplyCollateralRequest":{"oneOf":[{"$ref":"#/components/schemas/BlueSupplyCollateralIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"BlueSupplyCollateralIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"$ref":"#/components/schemas/ActionRequestedExpiry"},"amount":{"$ref":"#/components/schemas/BlueSupplyCollateralIntentAmountAssets"},"funding":{"$ref":"#/components/schemas/ActionFunding"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"}},"required":["account","amount","funding"],"additionalProperties":false},"BlueSupplyCollateralIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact collateral asset amount to supply in base units."}]}},"required":["unit","value"],"additionalProperties":false},"BlueWithdrawCollateralResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BlueWithdrawCollateralResponseData"}},"required":["data"],"additionalProperties":false},"BlueWithdrawCollateralResponseData":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawCollateralPreparedData"},{"$ref":"#/components/schemas/BlueWithdrawCollateralSimulationFailedData"},{"$ref":"#/components/schemas/BlueWithdrawCollateralSimulationUnavailableData"},{"$ref":"#/components/schemas/BlueWithdrawCollateralSignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/BlueWithdrawCollateralPreparedData","simulation_failed":"#/components/schemas/BlueWithdrawCollateralSimulationFailedData","simulation_unavailable":"#/components/schemas/BlueWithdrawCollateralSimulationUnavailableData","signature_required":"#/components/schemas/BlueWithdrawCollateralSignatureRequiredData"}}},"BlueWithdrawCollateralPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","collateral_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueCollateralResponseAmountAssets"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueCollateralCall"},"minItems":1,"maxItems":3},"action":{"type":"string","enum":["blue.withdraw_collateral"]},"simulation":{"$ref":"#/components/schemas/BlueWithdrawCollateralSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","amount","calls","action","simulation"],"additionalProperties":false},"BlueWithdrawCollateralSimulation":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawCollateralSimulationSuccess"},{"$ref":"#/components/schemas/BlueWithdrawCollateralSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/BlueWithdrawCollateralSimulationSuccess","failed":"#/components/schemas/BlueWithdrawCollateralSimulationFailure"}}},"BlueWithdrawCollateralSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/BluePositionChanges"},"effects":{"$ref":"#/components/schemas/BlueWithdrawCollateralEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"BlueWithdrawCollateralEffects":{"type":"object","properties":{"withdrawn_collateral_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral returned to the wallet, in collateral asset base units."}]},"ltv_bps":{"type":"integer","minimum":0,"description":"Position loan-to-value after the action, in basis points of the oracle-priced collateral, rounded up."},"max_ltv_bps":{"type":"integer","minimum":0,"description":"Highest loan-to-value the returned calls accept on-chain at execution (the market LLTV minus a 0.5% buffer), in basis points."}},"required":["withdrawn_collateral_assets","ltv_bps","max_ltv_bps"],"additionalProperties":false,"description":"Collateral withdrawal confirmed by the simulation."},"BlueWithdrawCollateralSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"BlueWithdrawCollateralSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","collateral_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueCollateralResponseAmountAssets"},"action":{"type":"string","enum":["blue.withdraw_collateral"]},"simulation":{"$ref":"#/components/schemas/BlueWithdrawCollateralSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","amount","action","simulation"],"additionalProperties":false},"BlueWithdrawCollateralSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"collateral_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","collateral_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/BlueCollateralResponseAmountAssets"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/BlueCollateralCall"},"minItems":1,"maxItems":3},"action":{"type":"string","enum":["blue.withdraw_collateral"]},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","amount","calls","action","simulation"],"additionalProperties":false},"BlueWithdrawCollateralSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["blue.withdraw_collateral"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"BlueWithdrawCollateralRequest":{"oneOf":[{"$ref":"#/components/schemas/BlueWithdrawCollateralIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"BlueWithdrawCollateralIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"$ref":"#/components/schemas/ActionRequestedExpiry"},"amount":{"$ref":"#/components/schemas/BlueWithdrawCollateralIntentAmountAssets"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"}},"required":["account","amount"],"additionalProperties":false},"BlueWithdrawCollateralIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact collateral asset amount to withdraw in base units."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightRepayResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MidnightRepayResponseData"}},"required":["data"],"additionalProperties":false},"MidnightRepayResponseData":{"oneOf":[{"$ref":"#/components/schemas/MidnightRepayData"},{"$ref":"#/components/schemas/MidnightMarketRepayData"}],"discriminator":{"propertyName":"action","mapping":{"midnight.repay":"#/components/schemas/MidnightRepayData","midnight.market_repay":"#/components/schemas/MidnightMarketRepayData"}}},"MidnightRepayData":{"oneOf":[{"$ref":"#/components/schemas/MidnightRepayPreparedData"},{"$ref":"#/components/schemas/MidnightRepaySimulationFailedData"},{"$ref":"#/components/schemas/MidnightRepaySimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightRepayPreparedData","simulation_failed":"#/components/schemas/MidnightRepaySimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightRepaySimulationUnavailableData"}}},"MidnightRepayPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_withdrawals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"oneOf":[{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAssets"},{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightResolvedWithdrawalAssets","all":"#/components/schemas/MidnightResolvedWithdrawalAll"}}}},"required":["collateral","amount"],"additionalProperties":false},"maxItems":16},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightRepayCall"},"minItems":1,"maxItems":4},"action":{"type":"string","enum":["midnight.repay"]},"amount":{"$ref":"#/components/schemas/MidnightRepayAmount"},"resolved_amount":{"$ref":"#/components/schemas/MidnightRepayResolvedAmountAssets"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/MidnightRepaySimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_withdrawals","calls","action","amount","resolved_amount","resolved_funding","simulation"],"additionalProperties":false},"MidnightResolvedWithdrawalAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"MidnightResolvedWithdrawalAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"MidnightRepayCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","repay_and_withdraw_collateral","market_repay_and_withdraw_collateral"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightRepayAmount":{"oneOf":[{"$ref":"#/components/schemas/MidnightRepayAmountAssets"},{"$ref":"#/components/schemas/MidnightRepayAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightRepayAmountAssets","all":"#/components/schemas/MidnightRepayAmountAll"}}},"MidnightRepayAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"MidnightRepayAmountAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"MidnightRepayResolvedAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"MidnightRepaySimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightRepaySimulationSuccess"},{"$ref":"#/components/schemas/MidnightRepaySimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightRepaySimulationSuccess","failed":"#/components/schemas/MidnightRepaySimulationFailure"}}},"MidnightRepaySimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightPositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightRepayEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightPositionChanges":{"type":"object","properties":{"debt_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"},"collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"difference":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["collateral","difference"],"additionalProperties":false},"maxItems":16}},"required":["debt_units","collaterals"],"additionalProperties":false},"MidnightRepayEffects":{"type":"object","properties":{"repaid_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"withdrawn_collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["collateral","assets"],"additionalProperties":false},"maxItems":16}},"required":["repaid_assets","withdrawn_collaterals"],"additionalProperties":false},"MidnightRepaySimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightRepaySimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_withdrawals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"oneOf":[{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAssets"},{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightResolvedWithdrawalAssets","all":"#/components/schemas/MidnightResolvedWithdrawalAll"}}}},"required":["collateral","amount"],"additionalProperties":false},"maxItems":16},"action":{"type":"string","enum":["midnight.repay"]},"amount":{"$ref":"#/components/schemas/MidnightRepayAmount"},"resolved_amount":{"$ref":"#/components/schemas/MidnightRepayResolvedAmountAssets"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/MidnightRepaySimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_withdrawals","action","amount","resolved_amount","resolved_funding","simulation"],"additionalProperties":false},"MidnightRepaySimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_withdrawals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"oneOf":[{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAssets"},{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightResolvedWithdrawalAssets","all":"#/components/schemas/MidnightResolvedWithdrawalAll"}}}},"required":["collateral","amount"],"additionalProperties":false},"maxItems":16},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightRepayCall"},"minItems":1,"maxItems":4},"action":{"type":"string","enum":["midnight.repay"]},"amount":{"$ref":"#/components/schemas/MidnightRepayAmount"},"resolved_amount":{"$ref":"#/components/schemas/MidnightRepayResolvedAmountAssets"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_withdrawals","calls","action","amount","resolved_amount","resolved_funding","simulation"],"additionalProperties":false},"MidnightMarketRepayData":{"oneOf":[{"$ref":"#/components/schemas/MidnightMarketRepayPreparedData"},{"$ref":"#/components/schemas/MidnightMarketRepaySimulationFailedData"},{"$ref":"#/components/schemas/MidnightMarketRepaySimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightMarketRepayPreparedData","simulation_failed":"#/components/schemas/MidnightMarketRepaySimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightMarketRepaySimulationUnavailableData"}}},"MidnightMarketRepayPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_withdrawals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"oneOf":[{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAssets"},{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightResolvedWithdrawalAssets","all":"#/components/schemas/MidnightResolvedWithdrawalAll"}}}},"required":["collateral","amount"],"additionalProperties":false},"maxItems":16},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightRepayCall"},"minItems":1,"maxItems":4},"amount":{"$ref":"#/components/schemas/MidnightMarketRepayTarget"},"max_repay_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Maximum loan assets the wallet pays and approves: `amount.value` for `assets` amounts, the buyer-asset cap for `units` amounts."}]},"resolved_amount":{"$ref":"#/components/schemas/MidnightMarketRepayResolvedAmount"},"guard":{"$ref":"#/components/schemas/MidnightRepayGuard"},"quote":{"$ref":"#/components/schemas/MidnightQuote"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/MidnightMarketRepaySimulation"},"action":{"type":"string","enum":["midnight.market_repay"]}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_withdrawals","calls","amount","max_repay_assets","resolved_amount","guard","quote","resolved_funding","simulation","action"],"additionalProperties":false},"MidnightMarketRepayTarget":{"oneOf":[{"$ref":"#/components/schemas/MidnightMarketRepayTargetAssets"},{"$ref":"#/components/schemas/MidnightMarketRepayTargetUnits"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightMarketRepayTargetAssets","units":"#/components/schemas/MidnightMarketRepayTargetUnits"}}},"MidnightMarketRepayTargetAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact buyer-side loan assets to spend."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightMarketRepayTargetUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact Midnight debt units to repay."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightMarketRepayResolvedAmount":{"oneOf":[{"$ref":"#/components/schemas/MidnightMarketRepayResolvedAmountAssets"},{"$ref":"#/components/schemas/MidnightMarketRepayResolvedAmountUnits"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightMarketRepayResolvedAmountAssets","units":"#/components/schemas/MidnightMarketRepayResolvedAmountUnits"}}},"MidnightMarketRepayResolvedAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"MidnightMarketRepayResolvedAmountUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"MidnightRepayGuard":{"oneOf":[{"$ref":"#/components/schemas/MidnightGuardSlippage"},{"$ref":"#/components/schemas/MidnightGuardMinUnits"},{"$ref":"#/components/schemas/MidnightGuardMaxAssets"},{"$ref":"#/components/schemas/MidnightGuardMinRate"}],"discriminator":{"propertyName":"type","mapping":{"slippage":"#/components/schemas/MidnightGuardSlippage","min_units":"#/components/schemas/MidnightGuardMinUnits","max_assets":"#/components/schemas/MidnightGuardMaxAssets","min_rate":"#/components/schemas/MidnightGuardMinRate"}},"description":"Market repayment price protection: slippage, min_rate, min_units for an assets amount, or max_assets for a units amount. Direct repayment does not accept a guard."},"MidnightGuardSlippage":{"type":"object","properties":{"type":{"type":"string","enum":["slippage"]},"bps":{"$ref":"#/components/schemas/MidnightSlippageBasisPoints"}},"required":["type","bps"],"additionalProperties":false},"MidnightSlippageBasisPoints":{"type":"integer","minimum":10,"maximum":1000,"description":"Maximum aggregate quote slippage in basis points, relative to the selected offers' average best price at quote time. Morpho's order book returns these offers. This is not an independent fair price.\n\nFor slippage-only sells (borrow, withdraw, borrow-side take), the only offer-independent price floor uses the price implied by 100% simple APR to maturity. The floor subtracts the settlement fee. The API rejects a quote below that floor. Before fees, that floor permits a discount to face value of approximately 1.9% at 7 days. The discount is approximately 7.6% at 30 days and 50% at 365 days.\n\nFees further reduce proceeds. Use an absolute or rate guard for long maturities."},"MidnightGuardMinUnits":{"type":"object","properties":{"type":{"type":"string","enum":["min_units"]},"value":{"type":"string","pattern":"^(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-4]|115792089237316195423570985008687907853269984665640564039457584007913129639935)$","description":"Minimum units the action must buy."}},"required":["type","value"],"additionalProperties":false},"MidnightGuardMaxAssets":{"type":"object","properties":{"type":{"type":"string","enum":["max_assets"]},"value":{"type":"string","pattern":"^(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-4]|115792089237316195423570985008687907853269984665640564039457584007913129639935)$","description":"Maximum loan assets the action can spend."}},"required":["type","value"],"additionalProperties":false},"MidnightGuardMinRate":{"type":"object","properties":{"type":{"type":"string","enum":["min_rate"]},"value":{"type":"string","pattern":"^(?:0|(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-4]|115792089237316195423570985008687907853269984665640564039457584007913129639935))$","description":"Minimum buy rate. Effective taker rate including the settlement fee. Non-negative WAD-scaled per-second simple rate, using the same units as maker rate_wad; not an APR or percentage."}},"required":["type","value"],"additionalProperties":false},"MidnightQuote":{"type":"object","properties":{"average_best_price_wad":{"allOf":[{"$ref":"#/components/schemas/WadValue"},{"description":"Weighted average best execution price, WAD-scaled."}]},"average_worst_price_wad":{"allOf":[{"$ref":"#/components/schemas/WadValue"},{"description":"Aggregate worst-price guard, WAD-scaled."}]},"available_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Buyer-side loan assets that fill the quote's target."}]},"available_units":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Debt units that fill the quote's target."}]},"offer_count":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":75}},"required":["average_best_price_wad","average_worst_price_wad","available_assets","available_units","offer_count"],"additionalProperties":false},"MidnightMarketRepaySimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightMarketRepaySimulationSuccess"},{"$ref":"#/components/schemas/MidnightMarketRepaySimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightMarketRepaySimulationSuccess","failed":"#/components/schemas/MidnightMarketRepaySimulationFailure"}}},"MidnightMarketRepaySimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightMarketPositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightMarketRepayEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightMarketPositionChanges":{"type":"object","properties":{"debt_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"},"collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"difference":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["collateral","difference"],"additionalProperties":false},"maxItems":16}},"required":["debt_units","collaterals"],"additionalProperties":false},"MidnightMarketRepayEffects":{"type":"object","properties":{"repaid_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"withdrawn_collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["collateral","assets"],"additionalProperties":false},"maxItems":16},"repaid_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["repaid_assets","withdrawn_collaterals","repaid_units"],"additionalProperties":false},"MidnightMarketRepaySimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightMarketRepaySimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_withdrawals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"oneOf":[{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAssets"},{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightResolvedWithdrawalAssets","all":"#/components/schemas/MidnightResolvedWithdrawalAll"}}}},"required":["collateral","amount"],"additionalProperties":false},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightMarketRepayTarget"},"max_repay_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Maximum loan assets the wallet pays and approves: `amount.value` for `assets` amounts, the buyer-asset cap for `units` amounts."}]},"resolved_amount":{"$ref":"#/components/schemas/MidnightMarketRepayResolvedAmount"},"guard":{"$ref":"#/components/schemas/MidnightRepayGuard"},"quote":{"$ref":"#/components/schemas/MidnightQuote"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/MidnightMarketRepaySimulation"},"action":{"type":"string","enum":["midnight.market_repay"]}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_withdrawals","amount","max_repay_assets","resolved_amount","guard","quote","resolved_funding","simulation","action"],"additionalProperties":false},"MidnightMarketRepaySimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_withdrawals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"oneOf":[{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAssets"},{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightResolvedWithdrawalAssets","all":"#/components/schemas/MidnightResolvedWithdrawalAll"}}}},"required":["collateral","amount"],"additionalProperties":false},"maxItems":16},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightRepayCall"},"minItems":1,"maxItems":4},"amount":{"$ref":"#/components/schemas/MidnightMarketRepayTarget"},"max_repay_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Maximum loan assets the wallet pays and approves: `amount.value` for `assets` amounts, the buyer-asset cap for `units` amounts."}]},"resolved_amount":{"$ref":"#/components/schemas/MidnightMarketRepayResolvedAmount"},"guard":{"$ref":"#/components/schemas/MidnightRepayGuard"},"quote":{"$ref":"#/components/schemas/MidnightQuote"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"action":{"type":"string","enum":["midnight.market_repay"]}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_withdrawals","calls","amount","max_repay_assets","resolved_amount","guard","quote","resolved_funding","simulation","action"],"additionalProperties":false},"MidnightMarketSelector":{"type":"string","pattern":"^(?:[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990|9007199254740991):0x[0-9a-fA-F]{64}$","description":"Midnight market selector formatted as <chain_id>:<market_id>. Send the colon literally or as %3A.","example":"8453:0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649"},"MidnightRepayRequest":{"oneOf":[{"$ref":"#/components/schemas/MidnightRepayRequestDirect"},{"$ref":"#/components/schemas/MidnightRepayRequestMarket"}],"discriminator":{"propertyName":"type","mapping":{"direct":"#/components/schemas/MidnightRepayRequestDirect","market":"#/components/schemas/MidnightRepayRequestMarket"}}},"MidnightRepayRequestDirect":{"type":"object","properties":{"type":{"type":"string","enum":["direct"]},"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most 24 hours from now."}]},"amount":{"$ref":"#/components/schemas/MidnightRepayTarget"},"collateral_withdrawals":{"$ref":"#/components/schemas/MidnightCollateralWithdrawals"},"funding":{"$ref":"#/components/schemas/ActionFunding"}},"required":["type","account","amount","funding"],"additionalProperties":false},"MidnightRepayTarget":{"oneOf":[{"$ref":"#/components/schemas/MidnightRepayTargetAssets"},{"$ref":"#/components/schemas/MidnightRepayTargetAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightRepayTargetAssets","all":"#/components/schemas/MidnightRepayTargetAll"}},"description":"Debt repaid directly at face value."},"MidnightRepayTargetAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact loan assets repaid at face value."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightRepayTargetAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"MidnightCollateralWithdrawals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralWithdrawal"},"minItems":1,"maxItems":16},"MidnightCollateralWithdrawal":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"$ref":"#/components/schemas/MidnightCollateralAmount"}},"required":["collateral","amount"],"additionalProperties":false},"MidnightCollateralAmount":{"oneOf":[{"$ref":"#/components/schemas/MidnightCollateralAmountAssets"},{"$ref":"#/components/schemas/MidnightCollateralAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightCollateralAmountAssets","all":"#/components/schemas/MidnightCollateralAmountAll"}}},"MidnightCollateralAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact positive collateral amount in token base units. Must be below 2^256-1, which is reserved for full withdrawal."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightCollateralAmountAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"MidnightRepayRequestMarket":{"type":"object","properties":{"type":{"type":"string","enum":["market"]},"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be at least 15 seconds and at most one hour from now. The default may be shortened to market maturity or to the earliest valid_until among the offers used, but must still leave at least 15 seconds. An explicit deadline past market maturity is rejected. QUOTE_STALE can occur when an offer's valid_until is before the requested deadline."}]},"amount":{"allOf":[{"$ref":"#/components/schemas/MidnightMarketRepayTarget"},{"description":"Debt repurchased from open offers."}]},"guard":{"$ref":"#/components/schemas/MidnightRepayGuard"},"collateral_withdrawals":{"$ref":"#/components/schemas/MidnightCollateralWithdrawals"},"funding":{"$ref":"#/components/schemas/ActionFunding"}},"required":["type","account","amount","guard","funding"],"additionalProperties":false},"MidnightSupplyCollateralResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightSupplyCollateralPreparedData"},{"$ref":"#/components/schemas/MidnightSupplyCollateralSimulationFailedData"},{"$ref":"#/components/schemas/MidnightSupplyCollateralSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightSupplyCollateralPreparedData","simulation_failed":"#/components/schemas/MidnightSupplyCollateralSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightSupplyCollateralSimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightSupplyCollateralPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"action":{"type":"string","enum":["midnight.supply_collateral"]},"max_collateral_approval_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included funding."}]},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightSupplyCollateralCall"},"minItems":1,"maxItems":4},"simulation":{"$ref":"#/components/schemas/MidnightSupplyCollateralSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_supplies","action","max_collateral_approval_assets","calls","simulation"],"additionalProperties":false},"MidnightCollateralSupply":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"$ref":"#/components/schemas/MidnightBorrowCollateralSupplyIntentAmountAssets"}},"required":["collateral","amount"],"additionalProperties":false},"MidnightBorrowCollateralSupplyIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral asset amount to supply in base units."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightSupplyCollateralCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","supply_collateral","supply_collateral_with_native"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightSupplyCollateralSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightSupplyCollateralSimulationSuccess"},{"$ref":"#/components/schemas/MidnightSupplyCollateralSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightSupplyCollateralSimulationSuccess","failed":"#/components/schemas/MidnightSupplyCollateralSimulationFailure"}}},"MidnightSupplyCollateralSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightSupplyCollateralPositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightSupplyCollateralEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightSupplyCollateralPositionChanges":{"type":"object","properties":{"collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"difference":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["collateral","difference"],"additionalProperties":false},"maxItems":16}},"required":["collaterals"],"additionalProperties":false},"MidnightSupplyCollateralEffects":{"type":"object","properties":{"supplied_collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["collateral","assets"],"additionalProperties":false},"maxItems":16}},"required":["supplied_collaterals"],"additionalProperties":false},"MidnightSupplyCollateralSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightSupplyCollateralSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"action":{"type":"string","enum":["midnight.supply_collateral"]},"max_collateral_approval_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included funding."}]},"simulation":{"$ref":"#/components/schemas/MidnightSupplyCollateralSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_supplies","action","max_collateral_approval_assets","simulation"],"additionalProperties":false},"MidnightSupplyCollateralSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"action":{"type":"string","enum":["midnight.supply_collateral"]},"max_collateral_approval_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included funding."}]},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightSupplyCollateralCall"},"minItems":1,"maxItems":4},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_supplies","action","max_collateral_approval_assets","calls","simulation"],"additionalProperties":false},"MidnightSupplyCollateralRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most 24 hours from now."}]},"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"$ref":"#/components/schemas/MidnightBorrowCollateralBorrowIntentAmountAssets"},"funding":{"$ref":"#/components/schemas/ActionFunding"}},"required":["account","collateral","amount"],"additionalProperties":false},"MidnightBorrowCollateralBorrowIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral asset amount to supply in base units."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightBorrowResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightBorrowPreparedData"},{"$ref":"#/components/schemas/MidnightBorrowSimulationFailedData"},{"$ref":"#/components/schemas/MidnightBorrowSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightBorrowPreparedData","simulation_failed":"#/components/schemas/MidnightBorrowSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightBorrowSimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightBorrowPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightBorrowTarget"},"guard":{"$ref":"#/components/schemas/MidnightBorrowGuard"},"quote":{"$ref":"#/components/schemas/MidnightBorrowQuote"},"max_borrow_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.borrow"]},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightBorrowCall"},"minItems":1,"maxItems":34},"collateral_approvals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralAssets"},"minItems":1,"maxItems":16,"description":"Collateral approvals; present only when the request included collateral_supplies."},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included collateral_supplies."}]},"simulation":{"$ref":"#/components/schemas/MidnightBorrowSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_supplies","amount","guard","quote","max_borrow_units","action","calls","simulation"],"additionalProperties":false},"MidnightBorrowTarget":{"oneOf":[{"$ref":"#/components/schemas/MidnightBorrowTargetAssets"},{"$ref":"#/components/schemas/MidnightBorrowTargetUnits"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightBorrowTargetAssets","units":"#/components/schemas/MidnightBorrowTargetUnits"}}},"MidnightBorrowTargetAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact loan assets received by the wallet after the optional referral fee."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightBorrowTargetUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact Midnight debt units sold."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightBorrowGuard":{"oneOf":[{"$ref":"#/components/schemas/MidnightGuardSlippage"},{"$ref":"#/components/schemas/MidnightGuardMaxUnits"},{"$ref":"#/components/schemas/MidnightGuardMinAssets"},{"$ref":"#/components/schemas/MidnightGuardMaxRate"}],"discriminator":{"propertyName":"type","mapping":{"slippage":"#/components/schemas/MidnightGuardSlippage","max_units":"#/components/schemas/MidnightGuardMaxUnits","min_assets":"#/components/schemas/MidnightGuardMinAssets","max_rate":"#/components/schemas/MidnightGuardMaxRate"}},"description":"Borrow price protection: slippage, max_rate, max_units for an assets amount, or min_assets for a units amount."},"MidnightGuardMaxUnits":{"type":"object","properties":{"type":{"type":"string","enum":["max_units"]},"value":{"type":"string","pattern":"^(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-4]|115792089237316195423570985008687907853269984665640564039457584007913129639935)$","description":"Maximum units the action can sell."}},"required":["type","value"],"additionalProperties":false},"MidnightGuardMinAssets":{"type":"object","properties":{"type":{"type":"string","enum":["min_assets"]},"value":{"type":"string","pattern":"^(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-4]|115792089237316195423570985008687907853269984665640564039457584007913129639935)$","description":"Minimum loan assets the action must receive."}},"required":["type","value"],"additionalProperties":false},"MidnightGuardMaxRate":{"type":"object","properties":{"type":{"type":"string","enum":["max_rate"]},"value":{"type":"string","pattern":"^(?:0|(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-4]|115792089237316195423570985008687907853269984665640564039457584007913129639935))$","description":"Maximum sell rate. Effective taker rate including the settlement fee. Non-negative WAD-scaled per-second simple rate, using the same units as maker rate_wad; not an APR or percentage."}},"required":["type","value"],"additionalProperties":false},"MidnightBorrowQuote":{"type":"object","properties":{"average_best_price_wad":{"allOf":[{"$ref":"#/components/schemas/WadValue"},{"description":"Weighted average seller price, WAD-scaled."}]},"average_worst_price_wad":{"allOf":[{"$ref":"#/components/schemas/WadValue"},{"description":"Minimum aggregate seller-price guard, WAD-scaled."}]},"available_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Gross seller-side loan assets that fill the quote's target. When the target is in assets, it is adjusted for any referral fee."}]},"available_units":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Debt units that fill the quote's target."}]},"offer_count":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":75}},"required":["average_best_price_wad","average_worst_price_wad","available_assets","available_units","offer_count"],"additionalProperties":false},"MidnightBorrowCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","borrow","supply_collateral_and_borrow"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightCollateralAssets":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Collateral asset amount in base units."}]}},"required":["collateral","assets"],"additionalProperties":false},"MidnightBorrowSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightBorrowSimulationSuccess"},{"$ref":"#/components/schemas/MidnightBorrowSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightBorrowSimulationSuccess","failed":"#/components/schemas/MidnightBorrowSimulationFailure"}}},"MidnightBorrowSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightBorrowPositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightBorrowEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightBorrowPositionChanges":{"type":"object","properties":{"credit_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"},"debt_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"},"collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"difference":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["collateral","difference"],"additionalProperties":false},"maxItems":16}},"required":["credit_units","debt_units"],"additionalProperties":false},"MidnightBorrowEffects":{"type":"object","properties":{"borrowed_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"borrowed_units":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"referral_fee_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"supplied_collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["collateral","assets"],"additionalProperties":false},"maxItems":16}},"required":["borrowed_assets","borrowed_units","referral_fee_assets"],"additionalProperties":false},"MidnightBorrowSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightBorrowSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightBorrowTarget"},"guard":{"$ref":"#/components/schemas/MidnightBorrowGuard"},"quote":{"$ref":"#/components/schemas/MidnightBorrowQuote"},"max_borrow_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.borrow"]},"collateral_approvals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralAssets"},"minItems":1,"maxItems":16,"description":"Collateral approvals; present only when the request included collateral_supplies."},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included collateral_supplies."}]},"simulation":{"$ref":"#/components/schemas/MidnightBorrowSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_supplies","amount","guard","quote","max_borrow_units","action","simulation"],"additionalProperties":false},"MidnightBorrowSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightBorrowTarget"},"guard":{"$ref":"#/components/schemas/MidnightBorrowGuard"},"quote":{"$ref":"#/components/schemas/MidnightBorrowQuote"},"max_borrow_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.borrow"]},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightBorrowCall"},"minItems":1,"maxItems":34},"collateral_approvals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralAssets"},"minItems":1,"maxItems":16,"description":"Collateral approvals; present only when the request included collateral_supplies."},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included collateral_supplies."}]},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","chain_id","account","expires_at","market","collateral_supplies","amount","guard","quote","max_borrow_units","action","calls","simulation"],"additionalProperties":false},"MidnightBorrowRequest":{"description":"Borrow only, or supply collateral and borrow in one atomic action.","oneOf":[{"$ref":"#/components/schemas/MidnightBorrowIntent"},{"$ref":"#/components/schemas/MidnightSupplyCollateralBorrowIntent"}]},"MidnightBorrowIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be at least 15 seconds and at most one hour from now. The default may be shortened to market maturity or to the earliest valid_until among the offers used, but must still leave at least 15 seconds. An explicit deadline past market maturity is rejected. QUOTE_STALE can occur when an offer's valid_until is before the requested deadline."}]},"amount":{"$ref":"#/components/schemas/MidnightBorrowTarget"},"market_params":{"$ref":"#/components/schemas/MidnightTakeMarketParams"},"guard":{"$ref":"#/components/schemas/MidnightBorrowGuard"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"}},"required":["account","amount","guard"],"additionalProperties":false},"MidnightTakeMarketParams":{"type":"object","properties":{"loan_token":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Loan asset address."}]},"maturity":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Market maturity as integer Unix seconds."},"rcf_threshold":{"type":"string","pattern":"^(0|[1-9][0-9]*)$","description":"RCF threshold, encoded as an unsigned decimal string."},"enter_gate":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Enter gate address."}]},"liquidator_gate":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Liquidator gate address."}]},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightMarketCollateralParams"},"minItems":1,"maxItems":128,"description":"Collateral parameters sorted by token address."}},"required":["loan_token","maturity","rcf_threshold","enter_gate","liquidator_gate","collaterals"],"additionalProperties":false,"description":"Parameters for the requested market, required if it is not created yet. Must hash to the path market id."},"MidnightMarketCollateralParams":{"type":"object","properties":{"token":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Collateral asset address."}]},"lltv":{"type":"string","pattern":"^(0|[1-9][0-9]*)$","description":"Unsigned WAD-scaled LLTV, encoded as a decimal string."},"liquidation_cursor":{"type":"string","pattern":"^(0|[1-9][0-9]*)$","description":"Unsigned WAD-scaled liquidation cursor, encoded as a decimal string."},"oracle":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Oracle contract address."}]}},"required":["token","lltv","liquidation_cursor","oracle"],"additionalProperties":false},"MidnightSupplyCollateralBorrowIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be at least 15 seconds and at most one hour from now. The default may be shortened to market maturity or to the earliest valid_until among the offers used, but must still leave at least 15 seconds. An explicit deadline past market maturity is rejected. QUOTE_STALE can occur when an offer's valid_until is before the requested deadline."}]},"collateral_supplies":{"$ref":"#/components/schemas/MidnightCollateralSupplies"},"market_params":{"$ref":"#/components/schemas/MidnightTakeMarketParams"},"amount":{"$ref":"#/components/schemas/MidnightBorrowTarget"},"guard":{"$ref":"#/components/schemas/MidnightBorrowGuard"},"funding":{"$ref":"#/components/schemas/ActionFunding"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"}},"required":["account","collateral_supplies","amount","guard","funding"],"additionalProperties":false},"MidnightCollateralSupplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"minItems":1,"maxItems":16},"MidnightOffersBorrowResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightOffersBorrowPreparedData"},{"$ref":"#/components/schemas/MidnightOffersBorrowSimulationFailedData"},{"$ref":"#/components/schemas/MidnightOffersBorrowSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightOffersBorrowPreparedData","simulation_failed":"#/components/schemas/MidnightOffersBorrowSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightOffersBorrowSimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightOffersBorrowPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.make_borrow"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOffersCall"},"minItems":1,"maxItems":34},"simulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightMakerPublicationSimulationSuccess"},{"$ref":"#/components/schemas/MidnightMakerSimulationFailure"},{"$ref":"#/components/schemas/MidnightSupplyCollateralMakeBorrowSimulationSuccess"}]},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"minItems":1,"maxItems":16,"description":"Collateral supplied atomically; present only when the request included collateral_supplies."},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included collateral_supplies."}]}},"required":["action_id","status","action","chain_id","account","expires_at","offer","calls","simulation"],"additionalProperties":false},"MidnightMakerOfferMetadata":{"type":"object","properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOfferGroup"},"minItems":1,"maxItems":1},"entry_count":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":16}},"required":["groups","entry_count"],"additionalProperties":false},"MidnightOfferGroup":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Midnight offer-group identifier."},"MidnightOffersCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","cancel_and_publish"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightMakerPublicationSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. Protocol position changes are reported separately."},"position_changes":{"type":"object","properties":{},"additionalProperties":false},"effects":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightMakerSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the returned wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightSupplyCollateralMakeBorrowSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. Protocol position changes are reported separately."},"position_changes":{"type":"object","properties":{"collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"difference":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["collateral","difference"],"additionalProperties":false},"minItems":1,"maxItems":16,"description":"Collateral position changes from the atomic borrow path."}},"required":["collaterals"],"additionalProperties":false},"effects":{"type":"object","properties":{"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"supplied_collaterals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralAssets"},"minItems":1,"maxItems":16,"description":"Collateral supplied by the atomic borrow path."}},"required":["offer","supplied_collaterals"],"additionalProperties":false}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightOffersBorrowSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["midnight.make_borrow"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"simulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightMakerPublicationSimulationSuccess"},{"$ref":"#/components/schemas/MidnightMakerSimulationFailure"},{"$ref":"#/components/schemas/MidnightSupplyCollateralMakeBorrowSimulationSuccess"}]},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"minItems":1,"maxItems":16,"description":"Collateral supplied atomically; present only when the request included collateral_supplies."},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included collateral_supplies."}]}},"required":["action_id","status","action","chain_id","account","expires_at","offer","simulation"],"additionalProperties":false},"MidnightOffersBorrowSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.make_borrow"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOffersCall"},"minItems":1,"maxItems":34},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"minItems":1,"maxItems":16,"description":"Collateral supplied atomically; present only when the request included collateral_supplies."},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included collateral_supplies."}]}},"required":["action_id","status","action","chain_id","account","expires_at","offer","calls","simulation"],"additionalProperties":false},"MidnightOffersBorrowRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"chain_id":{"$ref":"#/components/schemas/ChainId"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most 24 hours from now."}]},"amount":{"$ref":"#/components/schemas/MidnightMakerAmountAssets"},"offers":{"$ref":"#/components/schemas/MidnightOffers"},"p2p":{"type":"boolean","default":false,"description":"When true, the maker intends to share the offer directly with a taker. The API does not check it against the public offer book's admission rules. Thus, the offer can be absent from the book."},"market_params":{"type":"array","items":{"$ref":"#/components/schemas/MidnightMarketParams"},"minItems":1,"maxItems":16,"description":"Parameters for entry markets that are not created yet."},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"minItems":1,"maxItems":16},"funding":{"$ref":"#/components/schemas/ActionFunding"}},"required":["account","chain_id","amount","offers"],"additionalProperties":false},"MidnightMakerAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/MidnightMakerCap"}},"required":["unit","value"],"additionalProperties":false},"MidnightMakerCap":{"type":"string","pattern":"^[1-9][0-9]*$","description":"Loan assets each offer in the group can borrow, as a positive uint128."},"MidnightOffers":{"oneOf":[{"$ref":"#/components/schemas/MidnightOffersPrice"},{"$ref":"#/components/schemas/MidnightOffersRate"}],"discriminator":{"propertyName":"type","mapping":{"price":"#/components/schemas/MidnightOffersPrice","rate":"#/components/schemas/MidnightOffersRate"}}},"MidnightOffersPrice":{"type":"object","properties":{"type":{"type":"string","enum":["price"]},"entries":{"type":"array","items":{"type":"object","properties":{"market_id":{"$ref":"#/components/schemas/MarketId"},"tick":{"$ref":"#/components/schemas/MidnightMakerTick"},"starts_at":{"$ref":"#/components/schemas/MidnightMakerTimestamp"},"expires_at":{"$ref":"#/components/schemas/MidnightMakerTimestamp"}},"required":["market_id","tick","starts_at","expires_at"],"additionalProperties":false},"minItems":1,"maxItems":16}},"required":["type","entries"],"additionalProperties":false},"MidnightMakerTick":{"type":"string","pattern":"^(?:0|(?:[1-9][0-9]{0,2}|[1-5][0-9]{3}|6[0-6][0-9]{2}|67[0-3][0-9]{1}|674[0-3]|6744))$","description":"Midnight offer tick between 0 and 6744."},"MidnightMakerTimestamp":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Integer Unix timestamp in seconds."},"MidnightOffersRate":{"type":"object","properties":{"type":{"type":"string","enum":["rate"]},"entries":{"type":"array","items":{"type":"object","properties":{"market_id":{"$ref":"#/components/schemas/MarketId"},"tick":{"$ref":"#/components/schemas/MidnightRateMakerTick"},"starts_at":{"$ref":"#/components/schemas/MidnightMakerTimestamp"},"expires_at":{"$ref":"#/components/schemas/MidnightMakerTimestamp"},"rate_wad":{"$ref":"#/components/schemas/MidnightMakerRate"}},"required":["market_id","starts_at","expires_at","rate_wad"],"additionalProperties":false},"minItems":1,"maxItems":16}},"required":["type","entries"],"additionalProperties":false},"MidnightRateMakerTick":{"type":"string","pattern":"^(?:[1-9][0-9]{0,2}|[1-5][0-9]{3}|6[0-6][0-9]{2}|67[0-3][0-9]{1}|674[0-3]|6744)$","description":"Optional nominal offer tick. If absent, the API derives it from rate_wad, market maturity, and offer expiry. It rounds to tick spacing to satisfy the rate bound. A supplied tick must also satisfy the rate bound through expiry."},"MidnightMakerRate":{"type":"string","pattern":"^(?:0|(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-4]|115792089237316195423570985008687907853269984665640564039457584007913129639935))$","description":"Non-negative WAD-scaled per-second simple rate bound. Convert decimal APR with rate_wad = floor(APR * 1e18 / 31,536,000). For example, 5% APR uses APR = 0.05 and rate_wad = 1585489599."},"MidnightMarketParams":{"type":"object","properties":{"loan_token":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Loan asset address."}]},"maturity":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Market maturity as integer Unix seconds."},"rcf_threshold":{"type":"string","pattern":"^(0|[1-9][0-9]*)$","description":"RCF threshold, encoded as an unsigned decimal string."},"enter_gate":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Enter gate address."}]},"liquidator_gate":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Liquidator gate address."}]},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightMarketCollateralParams"},"minItems":1,"maxItems":128,"description":"Collateral parameters sorted by token address."}},"required":["loan_token","maturity","rcf_threshold","enter_gate","liquidator_gate","collaterals"],"additionalProperties":false},"MidnightOffersLendResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightOffersLendPreparedData"},{"$ref":"#/components/schemas/MidnightOffersLendSimulationFailedData"},{"$ref":"#/components/schemas/MidnightOffersLendSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightOffersLendPreparedData","simulation_failed":"#/components/schemas/MidnightOffersLendSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightOffersLendSimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightOffersLendPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.make_lend"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOffersCall"},"minItems":1,"maxItems":4},"simulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightMakerPublicationSimulationSuccess"},{"$ref":"#/components/schemas/MidnightMakerSimulationFailure"},{"$ref":"#/components/schemas/MidnightVariableRateFundedLendSimulationSuccess"}]},"funding_market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false,"description":"Morpho market used to back the offer; present only when the request included funding_source."},"amount":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets supplied to back the lend offer."}]}},"required":["unit","value"],"additionalProperties":false,"description":"Loan assets supplied to back the offer; present only when the request included funding_source."},"funding_address":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Address holding the variable-rate funding position; present only when the request included funding_source."}]},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included funding_source."}]}},"required":["action_id","status","action","chain_id","account","expires_at","offer","calls","simulation"],"additionalProperties":false},"MidnightVariableRateFundedLendSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. Protocol position changes are reported separately."},"position_changes":{"type":"object","properties":{"supply_shares":{"allOf":[{"$ref":"#/components/schemas/SignedBaseUnitDifference"},{"description":"Supply shares received by the atomic lend path."}]}},"required":["supply_shares"],"additionalProperties":false},"effects":{"type":"object","properties":{"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"parked_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Assets supplied to the Morpho market by the atomic lend path."}]},"funding_address":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Address holding the variable-rate funding position."}]}},"required":["offer","parked_assets","funding_address"],"additionalProperties":false}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightOffersLendSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["midnight.make_lend"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"simulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightMakerPublicationSimulationSuccess"},{"$ref":"#/components/schemas/MidnightMakerSimulationFailure"},{"$ref":"#/components/schemas/MidnightVariableRateFundedLendSimulationSuccess"}]},"funding_market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false,"description":"Morpho market used to back the offer; present only when the request included funding_source."},"amount":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets supplied to back the lend offer."}]}},"required":["unit","value"],"additionalProperties":false,"description":"Loan assets supplied to back the offer; present only when the request included funding_source."},"funding_address":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Address holding the variable-rate funding position; present only when the request included funding_source."}]},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included funding_source."}]}},"required":["action_id","status","action","chain_id","account","expires_at","offer","simulation"],"additionalProperties":false},"MidnightOffersLendSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.make_lend"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOffersCall"},"minItems":1,"maxItems":4},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"funding_market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false,"description":"Morpho market used to back the offer; present only when the request included funding_source."},"amount":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets supplied to back the lend offer."}]}},"required":["unit","value"],"additionalProperties":false,"description":"Loan assets supplied to back the offer; present only when the request included funding_source."},"funding_address":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"Address holding the variable-rate funding position; present only when the request included funding_source."}]},"resolved_funding":{"allOf":[{"$ref":"#/components/schemas/ResolvedFunding"},{"description":"Resolved funding; present only when the request included funding_source."}]}},"required":["action_id","status","action","chain_id","account","expires_at","offer","calls","simulation"],"additionalProperties":false},"MidnightOffersLendRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"chain_id":{"$ref":"#/components/schemas/ChainId"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most 24 hours from now."}]},"amount":{"$ref":"#/components/schemas/MidnightMakerLendAmountAssets"},"offers":{"$ref":"#/components/schemas/MidnightOffers"},"p2p":{"type":"boolean","default":false,"description":"When true, the maker intends to share the offer directly with a taker. The API does not check it against the public offer book's admission rules. Thus, the offer can be absent from the book."},"market_params":{"type":"array","items":{"$ref":"#/components/schemas/MidnightMarketParams"},"minItems":1,"maxItems":16,"description":"Parameters for entry markets that are not created yet."},"funding_source":{"$ref":"#/components/schemas/MidnightFundingSource"},"funding":{"$ref":"#/components/schemas/ActionFunding"}},"required":["account","chain_id","amount","offers"],"additionalProperties":false},"MidnightMakerLendAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Positive uint128 loan asset amount. With wallet funding it caps fills across the offer group. With variable-rate market funding it is the amount supplied to the group's funding address, not the signed cap."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightFundingSource":{"oneOf":[{"$ref":"#/components/schemas/MidnightFundingSourceWallet"},{"$ref":"#/components/schemas/MidnightFundingSourceVariableRateMarket"}],"discriminator":{"propertyName":"type","mapping":{"wallet":"#/components/schemas/MidnightFundingSourceWallet","variable_rate_market":"#/components/schemas/MidnightFundingSourceVariableRateMarket"}}},"MidnightFundingSourceWallet":{"type":"object","properties":{"type":{"type":"string","enum":["wallet"]}},"required":["type"],"additionalProperties":false},"MidnightFundingSourceVariableRateMarket":{"type":"object","properties":{"type":{"type":"string","enum":["variable_rate_market"]},"market_id":{"allOf":[{"$ref":"#/components/schemas/MarketId"},{"description":"Variable-rate market the loan assets are supplied to."}]}},"required":["type","market_id"],"additionalProperties":false},"MidnightOffersRepayResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightOffersRepayPreparedData"},{"$ref":"#/components/schemas/MidnightOffersRepaySimulationFailedData"},{"$ref":"#/components/schemas/MidnightOffersRepaySimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightOffersRepayPreparedData","simulation_failed":"#/components/schemas/MidnightOffersRepaySimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightOffersRepaySimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightOffersRepayPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.make_repay"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOffersCall"},"minItems":1,"maxItems":4},"simulation":{"$ref":"#/components/schemas/MidnightMakerPublicationSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","offer","calls","simulation"],"additionalProperties":false},"MidnightMakerPublicationSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightMakerPublicationSimulationSuccess"},{"$ref":"#/components/schemas/MidnightMakerSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightMakerPublicationSimulationSuccess","failed":"#/components/schemas/MidnightMakerSimulationFailure"}}},"MidnightOffersRepaySimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["midnight.make_repay"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"simulation":{"$ref":"#/components/schemas/MidnightMakerPublicationSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","offer","simulation"],"additionalProperties":false},"MidnightOffersRepaySimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.make_repay"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOffersCall"},"minItems":1,"maxItems":4},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","offer","calls","simulation"],"additionalProperties":false},"MidnightOffersRepayRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"chain_id":{"$ref":"#/components/schemas/ChainId"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most 24 hours from now."}]},"amount":{"$ref":"#/components/schemas/MidnightMakerAmountUnits"},"offers":{"$ref":"#/components/schemas/MidnightOffers"},"p2p":{"type":"boolean","default":false,"description":"When true, the maker intends to share the offer directly with a taker. The API does not check it against the public offer book's admission rules. Thus, the offer can be absent from the book."}},"required":["account","chain_id","amount","offers"],"additionalProperties":false},"MidnightMakerAmountUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"allOf":[{"$ref":"#/components/schemas/MidnightMakerCap"},{"description":"Debt units each offer in the group can repay, as a positive uint128."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightOffersWithdrawResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightOffersWithdrawPreparedData"},{"$ref":"#/components/schemas/MidnightOffersWithdrawSimulationFailedData"},{"$ref":"#/components/schemas/MidnightOffersWithdrawSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightOffersWithdrawPreparedData","simulation_failed":"#/components/schemas/MidnightOffersWithdrawSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightOffersWithdrawSimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightOffersWithdrawPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.make_withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOffersCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/MidnightMakerPublicationSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","offer","calls","simulation"],"additionalProperties":false},"MidnightOffersWithdrawSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["midnight.make_withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"simulation":{"$ref":"#/components/schemas/MidnightMakerPublicationSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","offer","simulation"],"additionalProperties":false},"MidnightOffersWithdrawSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.make_withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"offer":{"$ref":"#/components/schemas/MidnightMakerOfferMetadata"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOffersCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","offer","calls","simulation"],"additionalProperties":false},"MidnightOffersWithdrawRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"chain_id":{"$ref":"#/components/schemas/ChainId"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most 24 hours from now."}]},"amount":{"$ref":"#/components/schemas/MidnightMakerAmountUnits"},"offers":{"$ref":"#/components/schemas/MidnightOffers"},"p2p":{"type":"boolean","default":false,"description":"When true, the maker intends to share the offer directly with a taker. The API does not check it against the public offer book's admission rules. Thus, the offer can be absent from the book."}},"required":["account","chain_id","amount","offers"],"additionalProperties":false},"MidnightCancelOffersResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightCancelOffersPreparedData"},{"$ref":"#/components/schemas/MidnightCancelOffersSimulationFailedData"},{"$ref":"#/components/schemas/MidnightCancelOffersSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightCancelOffersPreparedData","simulation_failed":"#/components/schemas/MidnightCancelOffersSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightCancelOffersSimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightCancelOffersPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.cancel_offers"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOfferGroup"},"minItems":1,"maxItems":64},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCancelOffersCall"},"minItems":1,"maxItems":1},"simulation":{"$ref":"#/components/schemas/MidnightCancelOffersSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","groups","calls","simulation"],"additionalProperties":false},"MidnightCancelOffersCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["cancel_offers"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightCancelOffersSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightCancelOffersSimulationSuccess"},{"$ref":"#/components/schemas/MidnightCancelOffersSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightCancelOffersSimulationSuccess","failed":"#/components/schemas/MidnightCancelOffersSimulationFailure"}}},"MidnightCancelOffersSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"type":"object","properties":{},"additionalProperties":false},"effects":{"type":"object","properties":{"cancelled_groups":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOfferGroup"},"minItems":1,"maxItems":64}},"required":["cancelled_groups"],"additionalProperties":false},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightCancelOffersSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightCancelOffersSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["midnight.cancel_offers"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOfferGroup"},"minItems":1,"maxItems":64},"simulation":{"$ref":"#/components/schemas/MidnightCancelOffersSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","groups","simulation"],"additionalProperties":false},"MidnightCancelOffersSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.cancel_offers"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOfferGroup"},"minItems":1,"maxItems":64},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCancelOffersCall"},"minItems":1,"maxItems":1},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","groups","calls","simulation"],"additionalProperties":false},"MidnightCancelOffersRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most 24 hours from now."}]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/MidnightOfferGroup"},"minItems":1,"maxItems":64}},"required":["account","chain_id","groups"],"additionalProperties":false},"MidnightWithdrawFundingResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightWithdrawFundingPreparedData"},{"$ref":"#/components/schemas/MidnightWithdrawFundingSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightWithdrawFundingPreparedData","simulation_unavailable":"#/components/schemas/MidnightWithdrawFundingSimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightWithdrawFundingPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.withdraw_funding"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightWithdrawFundingCall"}},"simulation":{"$ref":"#/components/schemas/MidnightWithdrawFundingSimulationSuccess"},"funding_address":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false}},"required":["action_id","status","action","chain_id","account","expires_at","calls","simulation","funding_address","market"],"additionalProperties":false},"MidnightWithdrawFundingCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["withdraw_funding"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightWithdrawFundingSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"type":"object","properties":{"supply_shares":{"type":"string","pattern":"^-[1-9][0-9]*$"}},"required":["supply_shares"],"additionalProperties":false},"effects":{"type":"object","properties":{"shares":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Funding supply shares burned, confirmed by simulation."}]},"assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets received by the wallet, confirmed by simulation."}]}},"required":["shares","assets"],"additionalProperties":false},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightWithdrawFundingSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.withdraw_funding"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightWithdrawFundingCall"}},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"},"funding_address":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false}},"required":["action_id","status","action","chain_id","account","expires_at","calls","simulation","funding_address","market"],"additionalProperties":false},"MidnightWithdrawFundingRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most 24 hours from now."}]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"funding_address":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"The funding_address returned by a lend offer funded from a variable-rate market."}]},"funding_market":{"allOf":[{"$ref":"#/components/schemas/MarketId"},{"description":"The id of the publication's funding_market: the variable-rate market holding the funding address's supply position."}]}},"required":["account","chain_id","funding_address","funding_market"],"additionalProperties":false},"MidnightTakeResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MidnightTakeResponseData"}},"required":["data"],"additionalProperties":false},"MidnightTakeResponseData":{"oneOf":[{"$ref":"#/components/schemas/MidnightTakeBorrowData"},{"$ref":"#/components/schemas/MidnightTakeLendData"},{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowData"}],"discriminator":{"propertyName":"action","mapping":{"midnight.take_borrow":"#/components/schemas/MidnightTakeBorrowData","midnight.take_lend":"#/components/schemas/MidnightTakeLendData","midnight.supply_collateral_take_borrow":"#/components/schemas/MidnightSupplyCollateralTakeBorrowData"}}},"MidnightTakeBorrowData":{"oneOf":[{"$ref":"#/components/schemas/MidnightTakeBorrowPreparedData"},{"$ref":"#/components/schemas/MidnightTakeBorrowSimulationFailedData"},{"$ref":"#/components/schemas/MidnightTakeBorrowSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightTakeBorrowPreparedData","simulation_failed":"#/components/schemas/MidnightTakeBorrowSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightTakeBorrowSimulationUnavailableData"}}},"MidnightTakeBorrowPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"p2p":{"type":"boolean"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"group":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Taken Midnight offer group."},"maker":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"tick_spacing":{"type":"integer","minimum":0,"description":"Market tick spacing; 0 when the market isn't created yet and the take creates it."},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","tick_spacing","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"quote":{"$ref":"#/components/schemas/MidnightTakeQuote"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.take_borrow"]},"max_borrow_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightTakeBorrowCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/MidnightTakeBorrowSimulation"}},"required":["action_id","p2p","status","chain_id","account","expires_at","group","maker","market","collateral_supplies","amount","guard","quote","action","max_borrow_units","calls","simulation"],"additionalProperties":false},"MidnightTakeTarget":{"oneOf":[{"$ref":"#/components/schemas/MidnightTakeTargetAssets"},{"$ref":"#/components/schemas/MidnightTakeTargetUnits"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightTakeTargetAssets","units":"#/components/schemas/MidnightTakeTargetUnits"}}},"MidnightTakeTargetAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact loan assets taken, before the optional referral fee."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightTakeTargetUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact Midnight units taken: credit units when lending, debt units when borrowing."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightTakeGuard":{"oneOf":[{"$ref":"#/components/schemas/MidnightGuardSlippage"},{"$ref":"#/components/schemas/MidnightGuardMinUnits"},{"$ref":"#/components/schemas/MidnightGuardMaxUnits"},{"$ref":"#/components/schemas/MidnightGuardMinAssets"},{"$ref":"#/components/schemas/MidnightGuardMaxAssets"},{"$ref":"#/components/schemas/MidnightGuardMinRate"},{"$ref":"#/components/schemas/MidnightGuardMaxRate"}],"discriminator":{"propertyName":"type","mapping":{"slippage":"#/components/schemas/MidnightGuardSlippage","min_units":"#/components/schemas/MidnightGuardMinUnits","max_units":"#/components/schemas/MidnightGuardMaxUnits","min_assets":"#/components/schemas/MidnightGuardMinAssets","max_assets":"#/components/schemas/MidnightGuardMaxAssets","min_rate":"#/components/schemas/MidnightGuardMinRate","max_rate":"#/components/schemas/MidnightGuardMaxRate"}},"description":"Price protection for an offer-group take. Use slippage, a limit on the unknown amount, or a simple rate per second with WAD scaling. Borrow-side takes accept max_rate, max_units for an assets amount, or min_assets for a units amount. Lend-side takes accept min_rate, min_units for an assets amount, or max_assets for a units amount. The group determines the side."},"MidnightTakeQuote":{"type":"object","properties":{"average_best_price_wad":{"$ref":"#/components/schemas/WadValue"},"average_worst_price_wad":{"$ref":"#/components/schemas/WadValue"},"available_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"available_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"offer_count":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":75}},"required":["average_best_price_wad","average_worst_price_wad","available_assets","available_units","offer_count"],"additionalProperties":false},"MidnightTakeBorrowCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","borrow"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightTakeBorrowSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightTakeBorrowSimulationSuccess"},{"$ref":"#/components/schemas/MidnightTakeBorrowSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightTakeBorrowSimulationSuccess","failed":"#/components/schemas/MidnightTakeBorrowSimulationFailure"}}},"MidnightTakeBorrowSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightTakePositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightTakeBorrowEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightTakePositionChanges":{"type":"object","properties":{"credit_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"},"debt_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["credit_units","debt_units"],"additionalProperties":false},"MidnightTakeBorrowEffects":{"type":"object","properties":{"borrowed_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"borrowed_units":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"referral_fee_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"}},"required":["borrowed_assets","borrowed_units","referral_fee_assets"],"additionalProperties":false},"MidnightTakeBorrowSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightTakeBorrowSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"p2p":{"type":"boolean"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"group":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Taken Midnight offer group."},"maker":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"tick_spacing":{"type":"integer","minimum":0,"description":"Market tick spacing; 0 when the market isn't created yet and the take creates it."},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","tick_spacing","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"quote":{"$ref":"#/components/schemas/MidnightTakeQuote"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.take_borrow"]},"max_borrow_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"simulation":{"$ref":"#/components/schemas/MidnightTakeBorrowSimulation"}},"required":["action_id","p2p","status","chain_id","account","expires_at","group","maker","market","collateral_supplies","amount","guard","quote","action","max_borrow_units","simulation"],"additionalProperties":false},"MidnightTakeBorrowSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"p2p":{"type":"boolean"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"group":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Taken Midnight offer group."},"maker":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"tick_spacing":{"type":"integer","minimum":0,"description":"Market tick spacing; 0 when the market isn't created yet and the take creates it."},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","tick_spacing","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"quote":{"$ref":"#/components/schemas/MidnightTakeQuote"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.take_borrow"]},"max_borrow_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightTakeBorrowCall"},"minItems":1,"maxItems":3},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","p2p","status","chain_id","account","expires_at","group","maker","market","collateral_supplies","amount","guard","quote","action","max_borrow_units","calls","simulation"],"additionalProperties":false},"MidnightTakeLendData":{"oneOf":[{"$ref":"#/components/schemas/MidnightTakeLendPreparedData"},{"$ref":"#/components/schemas/MidnightTakeLendSimulationFailedData"},{"$ref":"#/components/schemas/MidnightTakeLendSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightTakeLendPreparedData","simulation_failed":"#/components/schemas/MidnightTakeLendSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightTakeLendSimulationUnavailableData"}}},"MidnightTakeLendPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"p2p":{"type":"boolean"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"group":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Taken Midnight offer group."},"maker":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"tick_spacing":{"type":"integer","minimum":0,"description":"Market tick spacing; 0 when the market isn't created yet and the take creates it."},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","tick_spacing","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"quote":{"$ref":"#/components/schemas/MidnightTakeQuote"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.take_lend"]},"max_lend_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightTakeLendCall"},"minItems":1,"maxItems":4},"simulation":{"$ref":"#/components/schemas/MidnightTakeLendSimulation"}},"required":["action_id","p2p","status","chain_id","account","expires_at","group","maker","market","collateral_supplies","amount","guard","quote","action","max_lend_assets","resolved_funding","calls","simulation"],"additionalProperties":false},"MidnightTakeLendCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","lend"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightTakeLendSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightTakeLendSimulationSuccess"},{"$ref":"#/components/schemas/MidnightTakeLendSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightTakeLendSimulationSuccess","failed":"#/components/schemas/MidnightTakeLendSimulationFailure"}}},"MidnightTakeLendSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightTakePositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightTakeLendEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightTakeLendEffects":{"type":"object","properties":{"lent_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"lent_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"referral_fee_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"}},"required":["lent_assets","lent_units","referral_fee_assets"],"additionalProperties":false},"MidnightTakeLendSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightTakeLendSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"p2p":{"type":"boolean"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"group":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Taken Midnight offer group."},"maker":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"tick_spacing":{"type":"integer","minimum":0,"description":"Market tick spacing; 0 when the market isn't created yet and the take creates it."},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","tick_spacing","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"quote":{"$ref":"#/components/schemas/MidnightTakeQuote"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.take_lend"]},"max_lend_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/MidnightTakeLendSimulation"}},"required":["action_id","p2p","status","chain_id","account","expires_at","group","maker","market","collateral_supplies","amount","guard","quote","action","max_lend_assets","resolved_funding","simulation"],"additionalProperties":false},"MidnightTakeLendSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"p2p":{"type":"boolean"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"group":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Taken Midnight offer group."},"maker":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"tick_spacing":{"type":"integer","minimum":0,"description":"Market tick spacing; 0 when the market isn't created yet and the take creates it."},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","tick_spacing","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"quote":{"$ref":"#/components/schemas/MidnightTakeQuote"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.take_lend"]},"max_lend_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightTakeLendCall"},"minItems":1,"maxItems":4},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","p2p","status","chain_id","account","expires_at","group","maker","market","collateral_supplies","amount","guard","quote","action","max_lend_assets","resolved_funding","calls","simulation"],"additionalProperties":false},"MidnightSupplyCollateralTakeBorrowData":{"oneOf":[{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowPreparedData"},{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulationFailedData"},{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightSupplyCollateralTakeBorrowPreparedData","simulation_failed":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulationUnavailableData"}}},"MidnightSupplyCollateralTakeBorrowPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"p2p":{"type":"boolean"},"status":{"type":"string","enum":["prepared"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"group":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Taken Midnight offer group."},"maker":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"tick_spacing":{"type":"integer","minimum":0,"description":"Market tick spacing; 0 when the market isn't created yet and the take creates it."},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","tick_spacing","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"quote":{"$ref":"#/components/schemas/MidnightTakeQuote"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.supply_collateral_take_borrow"]},"max_borrow_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"collateral_approvals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralAssets"},"minItems":1,"maxItems":16},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowCall"},"minItems":1,"maxItems":35},"simulation":{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulation"}},"required":["action_id","p2p","status","chain_id","account","expires_at","group","maker","market","collateral_supplies","amount","guard","quote","action","max_borrow_units","collateral_approvals","resolved_funding","calls","simulation"],"additionalProperties":false},"MidnightSupplyCollateralTakeBorrowCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","supply_collateral_and_borrow"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightSupplyCollateralTakeBorrowSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulationSuccess"},{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulationSuccess","failed":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulationFailure"}}},"MidnightSupplyCollateralTakeBorrowSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightTakeCollateralPositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightTakeCollateralPositionChanges":{"type":"object","properties":{"credit_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"},"debt_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"},"collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"difference":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["collateral","difference"],"additionalProperties":false},"maxItems":16}},"required":["credit_units","debt_units","collaterals"],"additionalProperties":false},"MidnightSupplyCollateralTakeBorrowEffects":{"type":"object","properties":{"borrowed_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"borrowed_units":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"referral_fee_assets":{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},"supplied_collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["collateral","assets"],"additionalProperties":false},"maxItems":16}},"required":["borrowed_assets","borrowed_units","referral_fee_assets","supplied_collaterals"],"additionalProperties":false},"MidnightSupplyCollateralTakeBorrowSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightSupplyCollateralTakeBorrowSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"p2p":{"type":"boolean"},"status":{"type":"string","enum":["simulation_failed"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"group":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Taken Midnight offer group."},"maker":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"tick_spacing":{"type":"integer","minimum":0,"description":"Market tick spacing; 0 when the market isn't created yet and the take creates it."},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","tick_spacing","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"quote":{"$ref":"#/components/schemas/MidnightTakeQuote"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.supply_collateral_take_borrow"]},"max_borrow_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"collateral_approvals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralAssets"},"minItems":1,"maxItems":16},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"simulation":{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowSimulation"}},"required":["action_id","p2p","status","chain_id","account","expires_at","group","maker","market","collateral_supplies","amount","guard","quote","action","max_borrow_units","collateral_approvals","resolved_funding","simulation"],"additionalProperties":false},"MidnightSupplyCollateralTakeBorrowSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"p2p":{"type":"boolean"},"status":{"type":"string","enum":["simulation_unavailable"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"group":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Taken Midnight offer group."},"maker":{"$ref":"#/components/schemas/ActionAddress"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"tick_spacing":{"type":"integer","minimum":0,"description":"Market tick spacing; 0 when the market isn't created yet and the take creates it."},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","tick_spacing","loan_asset","collaterals"],"additionalProperties":false},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"maxItems":16},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"quote":{"$ref":"#/components/schemas/MidnightTakeQuote"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"action":{"type":"string","enum":["midnight.supply_collateral_take_borrow"]},"max_borrow_units":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"collateral_approvals":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralAssets"},"minItems":1,"maxItems":16},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightSupplyCollateralTakeBorrowCall"},"minItems":1,"maxItems":35},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","p2p","status","chain_id","account","expires_at","group","maker","market","collateral_supplies","amount","guard","quote","action","max_borrow_units","collateral_approvals","resolved_funding","calls","simulation"],"additionalProperties":false},"MidnightGroupSelector":{"type":"string","pattern":"^(?:[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990|9007199254740991):0x[0-9a-fA-F]{64}$","description":"Midnight offer-group selector formatted as <chain_id>:<group_id>. Send the colon literally or as %3A.","example":"8453:0x1111111111111111111111111111111111111111111111111111111111111111"},"MidnightTakeRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be at least 5 minutes and at most one hour from now. The default may be shortened to market maturity or to the earliest valid_until among the offers used, but must still leave at least 5 minutes. Offer-group take excludes offers that cannot meet the requested deadline and rejects an explicit deadline after market maturity or the group's expiry."}]},"maker":{"allOf":[{"$ref":"#/components/schemas/ActionAddress"},{"description":"The maker whose offer group to take. When set, only that maker's group is used."}]},"p2p":{"type":"boolean","default":false,"description":"When true, the take uses the offer group shared directly by the maker, including offers that aren't in the public offer book."},"market_id":{"allOf":[{"$ref":"#/components/schemas/MarketId"},{"description":"Market to take from. Required when the offer group has live offers on more than one market."}]},"amount":{"$ref":"#/components/schemas/MidnightTakeTarget"},"guard":{"$ref":"#/components/schemas/MidnightTakeGuard"},"collateral_supplies":{"type":"array","items":{"$ref":"#/components/schemas/MidnightCollateralSupply"},"minItems":1,"maxItems":16},"funding":{"allOf":[{"$ref":"#/components/schemas/ActionFunding"},{"description":"Required on the lend side. On the borrow side, accepted only together with collateral_supplies."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"}},"required":["account","amount","guard"],"additionalProperties":false},"MidnightLendResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightLendPreparedData"},{"$ref":"#/components/schemas/MidnightLendSimulationFailedData"},{"$ref":"#/components/schemas/MidnightLendSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightLendPreparedData","simulation_failed":"#/components/schemas/MidnightLendSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightLendSimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightLendPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.lend"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/MidnightLendTarget"},"guard":{"$ref":"#/components/schemas/MidnightLendGuard"},"quote":{"$ref":"#/components/schemas/MidnightLendQuote"},"max_lend_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightLendCall"},"minItems":1,"maxItems":4},"simulation":{"$ref":"#/components/schemas/MidnightLendSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","guard","quote","max_lend_assets","resolved_funding","calls","simulation"],"additionalProperties":false},"MidnightLendTarget":{"oneOf":[{"$ref":"#/components/schemas/MidnightLendTargetAssets"},{"$ref":"#/components/schemas/MidnightLendTargetUnits"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightLendTargetAssets","units":"#/components/schemas/MidnightLendTargetUnits"}}},"MidnightLendTargetAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/MidnightLendTargetValue"},{"description":"Exact total loan assets spent by the wallet, including any referral fee."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightLendTargetUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"allOf":[{"$ref":"#/components/schemas/MidnightLendTargetValue"},{"description":"Exact Midnight credit units bought."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightLendGuard":{"oneOf":[{"$ref":"#/components/schemas/MidnightGuardSlippage"},{"$ref":"#/components/schemas/MidnightGuardMinUnits"},{"$ref":"#/components/schemas/MidnightGuardMaxAssets"},{"$ref":"#/components/schemas/MidnightGuardMinRate"}],"discriminator":{"propertyName":"type","mapping":{"slippage":"#/components/schemas/MidnightGuardSlippage","min_units":"#/components/schemas/MidnightGuardMinUnits","max_assets":"#/components/schemas/MidnightGuardMaxAssets","min_rate":"#/components/schemas/MidnightGuardMinRate"}},"description":"Lend price protection: slippage, min_rate, min_units for an assets amount, or max_assets for a units amount."},"MidnightLendQuote":{"type":"object","properties":{"average_best_price_wad":{"allOf":[{"$ref":"#/components/schemas/WadValue"},{"description":"Weighted average price paid for the filled offers, WAD-scaled."}]},"average_worst_price_wad":{"allOf":[{"$ref":"#/components/schemas/WadValue"},{"description":"Maximum aggregate buyer-price guard, WAD-scaled."}]},"available_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Buyer-side loan assets filled into offers, excluding the referral fee."}]},"available_units":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Credit units that fill the quote's target. When the target is in assets, it is adjusted for any referral fee."}]},"offer_count":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":75}},"required":["average_best_price_wad","average_worst_price_wad","available_assets","available_units","offer_count"],"additionalProperties":false},"MidnightLendCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","authorization","lend"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightLendSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightLendSimulationSuccess"},{"$ref":"#/components/schemas/MidnightLendSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightLendSimulationSuccess","failed":"#/components/schemas/MidnightLendSimulationFailure"}}},"MidnightLendSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightLendPositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightLendEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightLendPositionChanges":{"type":"object","properties":{"credit_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"},"debt_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["credit_units","debt_units"],"additionalProperties":false},"MidnightLendEffects":{"type":"object","properties":{"lent_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets filled into Midnight offers, excluding any referral fee."}]},"lent_units":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Midnight credit units added or debt units repaid by the lend."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Loan assets paid to the referral recipient in addition to lent_assets."}]}},"required":["lent_assets","lent_units","referral_fee_assets"],"additionalProperties":false},"MidnightLendSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightLendSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["midnight.lend"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/MidnightLendTarget"},"guard":{"$ref":"#/components/schemas/MidnightLendGuard"},"quote":{"$ref":"#/components/schemas/MidnightLendQuote"},"max_lend_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"simulation":{"$ref":"#/components/schemas/MidnightLendSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","guard","quote","max_lend_assets","resolved_funding","simulation"],"additionalProperties":false},"MidnightLendSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.lend"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/MidnightLendTarget"},"guard":{"$ref":"#/components/schemas/MidnightLendGuard"},"quote":{"$ref":"#/components/schemas/MidnightLendQuote"},"max_lend_assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},"resolved_funding":{"$ref":"#/components/schemas/ResolvedFunding"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightLendCall"},"minItems":1,"maxItems":4},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","guard","quote","max_lend_assets","resolved_funding","calls","simulation"],"additionalProperties":false},"MidnightLendRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be at least 15 seconds and at most one hour from now. The default may be shortened to market maturity or to the earliest valid_until among the offers used, but must still leave at least 15 seconds. An explicit deadline past market maturity is rejected. QUOTE_STALE can occur when an offer's valid_until is before the requested deadline."}]},"amount":{"$ref":"#/components/schemas/MidnightLendTarget"},"market_params":{"$ref":"#/components/schemas/MidnightTakeMarketParams"},"guard":{"$ref":"#/components/schemas/MidnightLendGuard"},"funding":{"$ref":"#/components/schemas/ActionFunding"},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"}},"required":["account","amount","guard","funding"],"additionalProperties":false},"MidnightWithdrawResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MidnightWithdrawResponseData"}},"required":["data"],"additionalProperties":false},"MidnightWithdrawResponseData":{"oneOf":[{"$ref":"#/components/schemas/MidnightWithdrawData"},{"$ref":"#/components/schemas/MidnightRedeemData"}],"discriminator":{"propertyName":"action","mapping":{"midnight.withdraw":"#/components/schemas/MidnightWithdrawData","midnight.redeem":"#/components/schemas/MidnightRedeemData"}}},"MidnightWithdrawData":{"oneOf":[{"$ref":"#/components/schemas/MidnightWithdrawPreparedData"},{"$ref":"#/components/schemas/MidnightWithdrawSimulationFailedData"},{"$ref":"#/components/schemas/MidnightWithdrawSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightWithdrawPreparedData","simulation_failed":"#/components/schemas/MidnightWithdrawSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightWithdrawSimulationUnavailableData"}}},"MidnightWithdrawPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/MidnightWithdrawTarget"},"resolved_amount":{"$ref":"#/components/schemas/MidnightWithdrawResolvedAmount"},"guard":{"$ref":"#/components/schemas/MidnightWithdrawGuard"},"quote":{"$ref":"#/components/schemas/MidnightWithdrawQuote"},"max_withdraw_units":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Maximum credit units the quoted withdrawal can consume at the accepted slippage bound."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/MidnightWithdrawSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_amount","quote","max_withdraw_units","calls","simulation"],"additionalProperties":false},"MidnightWithdrawTarget":{"oneOf":[{"$ref":"#/components/schemas/MidnightWithdrawTargetAssets"},{"$ref":"#/components/schemas/MidnightWithdrawTargetUnits"},{"$ref":"#/components/schemas/MidnightWithdrawTargetAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightWithdrawTargetAssets","units":"#/components/schemas/MidnightWithdrawTargetUnits","all":"#/components/schemas/MidnightWithdrawTargetAll"}}},"MidnightWithdrawTargetAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"type":"string","pattern":"^(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-3]|115792089237316195423570985008687907853269984665640564039457584007913129639934)$","description":"Exact loan assets received by the wallet after the optional referral fee."}},"required":["unit","value"],"additionalProperties":false},"MidnightWithdrawTargetUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"type":"string","pattern":"^(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-3]|115792089237316195423570985008687907853269984665640564039457584007913129639934)$","description":"Exact Midnight credit units withdrawn."}},"required":["unit","value"],"additionalProperties":false},"MidnightWithdrawTargetAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"MidnightWithdrawResolvedAmount":{"oneOf":[{"$ref":"#/components/schemas/MidnightWithdrawResolvedAmountAssets"},{"$ref":"#/components/schemas/MidnightWithdrawResolvedAmountUnits"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightWithdrawResolvedAmountAssets","units":"#/components/schemas/MidnightWithdrawResolvedAmountUnits"}}},"MidnightWithdrawResolvedAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"MidnightWithdrawResolvedAmountUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"MidnightWithdrawGuard":{"oneOf":[{"$ref":"#/components/schemas/MidnightGuardSlippage"},{"$ref":"#/components/schemas/MidnightGuardMaxUnits"},{"$ref":"#/components/schemas/MidnightGuardMinAssets"},{"$ref":"#/components/schemas/MidnightGuardMaxRate"}],"discriminator":{"propertyName":"type","mapping":{"slippage":"#/components/schemas/MidnightGuardSlippage","max_units":"#/components/schemas/MidnightGuardMaxUnits","min_assets":"#/components/schemas/MidnightGuardMinAssets","max_rate":"#/components/schemas/MidnightGuardMaxRate"}},"description":"Exact withdrawal price protection: slippage, max_rate, max_units for an assets amount, or min_assets for a units amount. Complete redemption does not accept a guard."},"MidnightWithdrawQuote":{"type":"object","properties":{"average_best_price_wad":{"allOf":[{"$ref":"#/components/schemas/WadValue"},{"description":"Weighted average price received for the quoted remainder sold after direct redemption, WAD-scaled."}]},"average_worst_price_wad":{"allOf":[{"$ref":"#/components/schemas/WadValue"},{"description":"Minimum aggregate seller-price guard for the post-redemption remainder, WAD-scaled."}]},"available_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Gross seller-side loan assets that fill the quote's target after direct redemption. When the target is in assets, it is adjusted for any referral fee."}]},"available_units":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Credit units that fill the quote's target after direct redemption."}]},"offer_count":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":75}},"required":["average_best_price_wad","average_worst_price_wad","available_assets","available_units","offer_count"],"additionalProperties":false},"MidnightWithdrawCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["authorization","withdraw"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightWithdrawSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightWithdrawSimulationSuccess"},{"$ref":"#/components/schemas/MidnightWithdrawSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightWithdrawSimulationSuccess","failed":"#/components/schemas/MidnightWithdrawSimulationFailure"}}},"MidnightWithdrawSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightExitPositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightWithdrawEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightExitPositionChanges":{"type":"object","properties":{"credit_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"},"debt_units":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["credit_units","debt_units"],"additionalProperties":false},"MidnightWithdrawEffects":{"type":"object","properties":{"withdrawn_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets received by the wallet after the referral fee."}]},"withdrawn_units":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Midnight credit units removed by the withdrawal."}]},"referral_fee_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Loan assets paid to the referral recipient."}]}},"required":["withdrawn_assets","withdrawn_units","referral_fee_assets"],"additionalProperties":false},"MidnightWithdrawSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightWithdrawSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["midnight.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/MidnightWithdrawTarget"},"resolved_amount":{"$ref":"#/components/schemas/MidnightWithdrawResolvedAmount"},"guard":{"$ref":"#/components/schemas/MidnightWithdrawGuard"},"quote":{"$ref":"#/components/schemas/MidnightWithdrawQuote"},"max_withdraw_units":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Maximum credit units the quoted withdrawal can consume at the accepted slippage bound."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"simulation":{"$ref":"#/components/schemas/MidnightWithdrawSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_amount","quote","max_withdraw_units","simulation"],"additionalProperties":false},"MidnightWithdrawSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/MidnightWithdrawTarget"},"resolved_amount":{"$ref":"#/components/schemas/MidnightWithdrawResolvedAmount"},"guard":{"$ref":"#/components/schemas/MidnightWithdrawGuard"},"quote":{"$ref":"#/components/schemas/MidnightWithdrawQuote"},"max_withdraw_units":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Maximum credit units the quoted withdrawal can consume at the accepted slippage bound."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightWithdrawCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_amount","quote","max_withdraw_units","calls","simulation"],"additionalProperties":false},"MidnightRedeemData":{"oneOf":[{"$ref":"#/components/schemas/MidnightRedeemPreparedData"},{"$ref":"#/components/schemas/MidnightRedeemSimulationFailedData"},{"$ref":"#/components/schemas/MidnightRedeemSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightRedeemPreparedData","simulation_failed":"#/components/schemas/MidnightRedeemSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightRedeemSimulationUnavailableData"}}},"MidnightRedeemPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.redeem"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/MidnightRedeemAmount"},"resolved_amount":{"$ref":"#/components/schemas/MidnightRedeemResolvedAmountUnits"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightRedeemCall"},"minItems":1,"maxItems":1},"simulation":{"$ref":"#/components/schemas/MidnightRedeemSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_amount","calls","simulation"],"additionalProperties":false},"MidnightRedeemAmount":{"oneOf":[{"$ref":"#/components/schemas/MidnightRedeemAmountUnits"},{"$ref":"#/components/schemas/MidnightRedeemAmountAll"}],"discriminator":{"propertyName":"unit","mapping":{"units":"#/components/schemas/MidnightRedeemAmountUnits","all":"#/components/schemas/MidnightRedeemAmountAll"}}},"MidnightRedeemAmountUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Resolved credit units redeemed."}]}},"required":["unit","value"],"additionalProperties":false},"MidnightRedeemAmountAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"MidnightRedeemResolvedAmountUnits":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["unit","value"],"additionalProperties":false},"MidnightRedeemCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["redeem"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightRedeemSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightRedeemSimulationSuccess"},{"$ref":"#/components/schemas/MidnightRedeemSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightRedeemSimulationSuccess","failed":"#/components/schemas/MidnightRedeemSimulationFailure"}}},"MidnightRedeemSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightExitPositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightRedeemEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightRedeemEffects":{"type":"object","properties":{"redeemed_assets":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Loan assets received by the wallet from direct redemption."}]},"redeemed_units":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Midnight credit units redeemed."}]}},"required":["redeemed_assets","redeemed_units"],"additionalProperties":false},"MidnightRedeemSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightRedeemSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["midnight.redeem"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/MidnightRedeemAmount"},"resolved_amount":{"$ref":"#/components/schemas/MidnightRedeemResolvedAmountUnits"},"simulation":{"$ref":"#/components/schemas/MidnightRedeemSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_amount","simulation"],"additionalProperties":false},"MidnightRedeemSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.redeem"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/MidnightRedeemAmount"},"resolved_amount":{"$ref":"#/components/schemas/MidnightRedeemResolvedAmountUnits"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightRedeemCall"},"minItems":1,"maxItems":1},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","amount","resolved_amount","calls","simulation"],"additionalProperties":false},"MidnightWithdrawRequest":{"oneOf":[{"$ref":"#/components/schemas/MidnightWithdrawAssetsRequest"},{"$ref":"#/components/schemas/MidnightWithdrawUnitsRequest"},{"$ref":"#/components/schemas/MidnightWithdrawAllRequest"}]},"MidnightWithdrawAssetsRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be at least 15 seconds and at most one hour from now. The default may be shortened to market maturity or to the earliest valid_until among the offers used, but must still leave at least 15 seconds. An explicit deadline past market maturity is rejected. QUOTE_STALE can occur when an offer's valid_until is before the requested deadline. Rejected when amount.unit is all. Withdrawals fulfilled entirely by direct redemption require at least 5 minutes when an explicit deadline is set."}]},"guard":{"allOf":[{"$ref":"#/components/schemas/MidnightWithdrawGuard"},{"description":"Rejected when amount.unit is all."}]},"amount":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"type":"string","pattern":"^(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-3]|115792089237316195423570985008687907853269984665640564039457584007913129639934)$","description":"Exact loan assets received by the wallet after the optional referral fee."}},"required":["unit","value"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"}},"required":["account","amount"],"additionalProperties":false},"MidnightWithdrawUnitsRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be at least 15 seconds and at most one hour from now. The default may be shortened to market maturity or to the earliest valid_until among the offers used, but must still leave at least 15 seconds. An explicit deadline past market maturity is rejected. QUOTE_STALE can occur when an offer's valid_until is before the requested deadline. Rejected when amount.unit is all. Withdrawals fulfilled entirely by direct redemption require at least 5 minutes when an explicit deadline is set."}]},"guard":{"allOf":[{"$ref":"#/components/schemas/MidnightWithdrawGuard"},{"description":"Rejected when amount.unit is all."}]},"amount":{"type":"object","properties":{"unit":{"type":"string","enum":["units"]},"value":{"type":"string","pattern":"^(?:[1-9][0-9]{0,76}|10[0-9]{76}|11[0-4][0-9]{75}|115[0-6][0-9]{74}|1157[0-8][0-9]{73}|11579[0-1][0-9]{72}|1157920[0-7][0-9]{70}|11579208[0-8][0-9]{69}|115792089[0-1][0-9]{68}|1157920892[0-2][0-9]{67}|11579208923[0-6][0-9]{66}|115792089237[0-2][0-9]{65}|11579208923730[0-9]{64}|11579208923731[0-5][0-9]{63}|1157920892373160[0-9]{62}|1157920892373161[0-8][0-9]{61}|11579208923731619[0-4][0-9]{60}|115792089237316195[0-3][0-9]{59}|1157920892373161954[0-1][0-9]{58}|11579208923731619542[0-2][0-9]{57}|115792089237316195423[0-4][0-9]{56}|1157920892373161954235[0-6][0-9]{55}|115792089237316195423570[0-8][0-9]{53}|1157920892373161954235709[0-7][0-9]{52}|11579208923731619542357098[0-4][0-9]{51}|11579208923731619542357098500[0-7][0-9]{48}|115792089237316195423570985008[0-5][0-9]{47}|1157920892373161954235709850086[0-7][0-9]{46}|11579208923731619542357098500868[0-6][0-9]{45}|115792089237316195423570985008687[0-8][0-9]{44}|11579208923731619542357098500868790[0-6][0-9]{42}|115792089237316195423570985008687907[0-7][0-9]{41}|1157920892373161954235709850086879078[0-4][0-9]{40}|11579208923731619542357098500868790785[0-2][0-9]{39}|115792089237316195423570985008687907853[0-1][0-9]{38}|1157920892373161954235709850086879078532[0-5][0-9]{37}|11579208923731619542357098500868790785326[0-8][0-9]{36}|115792089237316195423570985008687907853269[0-8][0-9]{35}|1157920892373161954235709850086879078532699[0-7][0-9]{34}|11579208923731619542357098500868790785326998[0-3][0-9]{33}|115792089237316195423570985008687907853269984[0-5][0-9]{32}|1157920892373161954235709850086879078532699846[0-5][0-9]{31}|11579208923731619542357098500868790785326998466[0-4][0-9]{30}|115792089237316195423570985008687907853269984665[0-5][0-9]{29}|1157920892373161954235709850086879078532699846656[0-3][0-9]{28}|115792089237316195423570985008687907853269984665640[0-4][0-9]{26}|1157920892373161954235709850086879078532699846656405[0-5][0-9]{25}|11579208923731619542357098500868790785326998466564056[0-3][0-9]{24}|1157920892373161954235709850086879078532699846656405640[0-2][0-9]{22}|11579208923731619542357098500868790785326998466564056403[0-8][0-9]{21}|115792089237316195423570985008687907853269984665640564039[0-3][0-9]{20}|1157920892373161954235709850086879078532699846656405640394[0-4][0-9]{19}|11579208923731619542357098500868790785326998466564056403945[0-6][0-9]{18}|115792089237316195423570985008687907853269984665640564039457[0-4][0-9]{17}|1157920892373161954235709850086879078532699846656405640394575[0-7][0-9]{16}|11579208923731619542357098500868790785326998466564056403945758[0-3][0-9]{15}|11579208923731619542357098500868790785326998466564056403945758400[0-6][0-9]{12}|115792089237316195423570985008687907853269984665640564039457584007[0-8][0-9]{11}|11579208923731619542357098500868790785326998466564056403945758400790[0-9]{10}|11579208923731619542357098500868790785326998466564056403945758400791[0-2][0-9]{9}|1157920892373161954235709850086879078532699846656405640394575840079130[0-9]{8}|1157920892373161954235709850086879078532699846656405640394575840079131[0-1][0-9]{7}|11579208923731619542357098500868790785326998466564056403945758400791312[0-8][0-9]{6}|115792089237316195423570985008687907853269984665640564039457584007913129[0-5][0-9]{5}|1157920892373161954235709850086879078532699846656405640394575840079131296[0-2][0-9]{4}|11579208923731619542357098500868790785326998466564056403945758400791312963[0-8][0-9]{3}|115792089237316195423570985008687907853269984665640564039457584007913129639[0-8][0-9]{2}|1157920892373161954235709850086879078532699846656405640394575840079131296399[0-2][0-9]{1}|11579208923731619542357098500868790785326998466564056403945758400791312963993[0-3]|115792089237316195423570985008687907853269984665640564039457584007913129639934)$","description":"Exact Midnight credit units withdrawn."}},"required":["unit","value"],"additionalProperties":false},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"}},"required":["account","amount"],"additionalProperties":false},"MidnightWithdrawAllRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be at least 15 seconds and at most one hour from now. The default may be shortened to market maturity or to the earliest valid_until among the offers used, but must still leave at least 15 seconds. An explicit deadline past market maturity is rejected. QUOTE_STALE can occur when an offer's valid_until is before the requested deadline. Rejected when amount.unit is all. Withdrawals fulfilled entirely by direct redemption require at least 5 minutes when an explicit deadline is set."}]},"guard":{"allOf":[{"$ref":"#/components/schemas/MidnightWithdrawGuard"},{"description":"Rejected when amount.unit is all."}]},"amount":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false},"allow_partial":{"type":"boolean","default":false,"description":"Redeem only the currently withdrawable credit when liquidity cannot cover the entire position. The API accepts this field only with amount.unit all. The action sells no offers. The API rejects zero withdrawable liquidity."}},"required":["account","amount"],"additionalProperties":false},"MidnightWithdrawCollateralResponse":{"type":"object","properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/MidnightWithdrawCollateralPreparedData"},{"$ref":"#/components/schemas/MidnightWithdrawCollateralSimulationFailedData"},{"$ref":"#/components/schemas/MidnightWithdrawCollateralSimulationUnavailableData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/MidnightWithdrawCollateralPreparedData","simulation_failed":"#/components/schemas/MidnightWithdrawCollateralSimulationFailedData","simulation_unavailable":"#/components/schemas/MidnightWithdrawCollateralSimulationUnavailableData"}}}},"required":["data"],"additionalProperties":false},"MidnightWithdrawCollateralPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["midnight.withdraw_collateral"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_withdrawals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"oneOf":[{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAssets"},{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightResolvedWithdrawalAssets","all":"#/components/schemas/MidnightResolvedWithdrawalAll"}}}},"required":["collateral","amount"],"additionalProperties":false},"maxItems":16},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightWithdrawCollateralCall"},"minItems":1,"maxItems":1},"simulation":{"$ref":"#/components/schemas/MidnightWithdrawCollateralSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","collateral_withdrawals","calls","simulation"],"additionalProperties":false},"MidnightWithdrawCollateralCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["withdraw_collateral","withdraw_collateral_batch"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"MidnightWithdrawCollateralSimulation":{"oneOf":[{"$ref":"#/components/schemas/MidnightWithdrawCollateralSimulationSuccess"},{"$ref":"#/components/schemas/MidnightWithdrawCollateralSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/MidnightWithdrawCollateralSimulationSuccess","failed":"#/components/schemas/MidnightWithdrawCollateralSimulationFailure"}}},"MidnightWithdrawCollateralSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/MidnightWithdrawCollateralPositionChanges"},"effects":{"$ref":"#/components/schemas/MidnightWithdrawCollateralEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"MidnightWithdrawCollateralPositionChanges":{"type":"object","properties":{"collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"difference":{"$ref":"#/components/schemas/SignedBaseUnitDifference"}},"required":["collateral","difference"],"additionalProperties":false},"maxItems":16}},"required":["collaterals"],"additionalProperties":false},"MidnightWithdrawCollateralEffects":{"type":"object","properties":{"withdrawn_collaterals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"assets":{"$ref":"#/components/schemas/PositiveBaseUnitAmount"}},"required":["collateral","assets"],"additionalProperties":false},"maxItems":16}},"required":["withdrawn_collaterals"],"additionalProperties":false},"MidnightWithdrawCollateralSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"MidnightWithdrawCollateralSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["midnight.withdraw_collateral"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_withdrawals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"oneOf":[{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAssets"},{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightResolvedWithdrawalAssets","all":"#/components/schemas/MidnightResolvedWithdrawalAll"}}}},"required":["collateral","amount"],"additionalProperties":false},"maxItems":16},"simulation":{"$ref":"#/components/schemas/MidnightWithdrawCollateralSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","collateral_withdrawals","simulation"],"additionalProperties":false},"MidnightWithdrawCollateralSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["midnight.withdraw_collateral"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"},"collaterals":{"type":"array","items":{"$ref":"#/components/schemas/Erc20Asset"},"minItems":1,"maxItems":128}},"required":["id","loan_asset","collaterals"],"additionalProperties":false},"collateral_withdrawals":{"type":"array","items":{"type":"object","properties":{"collateral":{"$ref":"#/components/schemas/Erc20Asset"},"amount":{"oneOf":[{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAssets"},{"$ref":"#/components/schemas/MidnightResolvedWithdrawalAll"}],"discriminator":{"propertyName":"unit","mapping":{"assets":"#/components/schemas/MidnightResolvedWithdrawalAssets","all":"#/components/schemas/MidnightResolvedWithdrawalAll"}}}},"required":["collateral","amount"],"additionalProperties":false},"maxItems":16},"calls":{"type":"array","items":{"$ref":"#/components/schemas/MidnightWithdrawCollateralCall"},"minItems":1,"maxItems":1},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","market","collateral_withdrawals","calls","simulation"],"additionalProperties":false},"MidnightWithdrawCollateralRequest":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to 30 minutes from now. Must be more than 60 seconds and at most 24 hours from now."}]},"collateral_withdrawals":{"$ref":"#/components/schemas/MidnightCollateralWithdrawals"}},"required":["account","collateral_withdrawals"],"additionalProperties":false},"VaultV1Selector":{"type":"string","pattern":"^(?:[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990|9007199254740991):0x[0-9a-fA-F]{40}$","description":"Vault identifier formatted as <chain_id>:<vault_address>. Send the colon literally or as %3A. Mixed-case addresses must use a valid EIP-55 checksum.","example":"8453:0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183"},"VaultV1WithdrawResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultV1WithdrawResponseData"}},"required":["data"],"additionalProperties":false},"VaultV1WithdrawResponseData":{"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/VaultV1WithdrawPreparedData","simulation_failed":"#/components/schemas/VaultV1WithdrawSimulationFailedData","simulation_unavailable":"#/components/schemas/VaultV1WithdrawSimulationUnavailableData","signature_required":"#/components/schemas/VaultV1WithdrawSignatureRequiredData"}},"oneOf":[{"$ref":"#/components/schemas/VaultV1WithdrawPreparedData"},{"$ref":"#/components/schemas/VaultV1WithdrawSimulationFailedData"},{"$ref":"#/components/schemas/VaultV1WithdrawSimulationUnavailableData"},{"$ref":"#/components/schemas/VaultV1WithdrawSignatureRequiredData"}]},"VaultV1WithdrawSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["vault_v1.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"VaultV1WithdrawRequest":{"oneOf":[{"$ref":"#/components/schemas/VaultV1WithdrawAssetsIntent"},{"$ref":"#/components/schemas/VaultV1WithdrawSharesIntent"},{"$ref":"#/components/schemas/VaultV1WithdrawAllIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"VaultV1WithdrawAssetsIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"amount":{"$ref":"#/components/schemas/VaultV1WithdrawAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault-share price movement that the API accepts while it builds the action. After the API returns the response, the withdrawal call has no on-chain maximum-share guard."}]}},"required":["account","amount"],"additionalProperties":false},"VaultV1WithdrawAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Gross withdrawal amount in vault asset base units."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV1WithdrawSharesIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"amount":{"$ref":"#/components/schemas/VaultV1WithdrawShares"}},"required":["account","amount"],"additionalProperties":false},"VaultV1WithdrawShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact number of vault shares to redeem."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV1WithdrawAllIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"amount":{"$ref":"#/components/schemas/VaultV1WithdrawAll"}},"required":["account","amount"],"additionalProperties":false},"VaultV1WithdrawAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false,"description":"Redeem the wallet's full vault-share balance."},"VaultV2Selector":{"type":"string","pattern":"^(?:[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990|9007199254740991):0x[0-9a-fA-F]{40}$","description":"Vault identifier formatted as <chain_id>:<vault_address>. Send the colon literally or as %3A. Mixed-case addresses must use a valid EIP-55 checksum.","example":"8453:0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9"},"VaultV2WithdrawResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultV2WithdrawResponseData"}},"required":["data"],"additionalProperties":false},"VaultV2WithdrawResponseData":{"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/VaultV2WithdrawPreparedData","simulation_failed":"#/components/schemas/VaultV2WithdrawSimulationFailedData","simulation_unavailable":"#/components/schemas/VaultV2WithdrawSimulationUnavailableData","signature_required":"#/components/schemas/VaultV2WithdrawSignatureRequiredData"}},"oneOf":[{"$ref":"#/components/schemas/VaultV2WithdrawPreparedData"},{"$ref":"#/components/schemas/VaultV2WithdrawSimulationFailedData"},{"$ref":"#/components/schemas/VaultV2WithdrawSimulationUnavailableData"},{"$ref":"#/components/schemas/VaultV2WithdrawSignatureRequiredData"}]},"VaultV2WithdrawSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["vault_v2.withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"VaultV2WithdrawRequest":{"oneOf":[{"$ref":"#/components/schemas/VaultV2WithdrawAssetsIntent"},{"$ref":"#/components/schemas/VaultV2WithdrawSharesIntent"},{"$ref":"#/components/schemas/VaultV2WithdrawAllIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"VaultV2WithdrawAssetsIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"amount":{"$ref":"#/components/schemas/VaultV2WithdrawAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum vault-share price movement that the API accepts while it builds the action. After the API returns the response, the withdrawal call has no on-chain maximum-share guard."}]}},"required":["account","amount"],"additionalProperties":false},"VaultV2WithdrawAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Gross withdrawal amount in vault asset base units."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV2WithdrawSharesIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"amount":{"$ref":"#/components/schemas/VaultV2WithdrawShares"}},"required":["account","amount"],"additionalProperties":false},"VaultV2WithdrawShares":{"type":"object","properties":{"unit":{"type":"string","enum":["shares"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Exact number of vault shares to redeem."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV2WithdrawAllIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"amount":{"$ref":"#/components/schemas/VaultV2WithdrawAll"}},"required":["account","amount"],"additionalProperties":false},"VaultV2WithdrawAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false,"description":"Redeem the wallet's full vault-share balance."},"VaultV2ForceWithdrawResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultV2ForceWithdrawResponseData"}},"required":["data"],"additionalProperties":false},"VaultV2ForceWithdrawResponseData":{"oneOf":[{"$ref":"#/components/schemas/VaultV2ForceWithdrawAssetsPreparedData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAssetsSimulationFailedData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAssetsSimulationUnavailableData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAllPreparedData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAllSimulationFailedData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAllSimulationUnavailableData"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawSignatureRequiredData"}]},"VaultV2ForceWithdrawSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["vault_v2.force_withdraw"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"VaultV2ForceWithdrawRequest":{"oneOf":[{"$ref":"#/components/schemas/VaultV2ForceWithdrawAssetsIntent"},{"$ref":"#/components/schemas/VaultV2ForceWithdrawAllIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"VaultV2ForceWithdrawAssetsIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"referral_fee":{"$ref":"#/components/schemas/ReferralFee"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"},"amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawRequestAmountAssets"},"slippage_bps":{"allOf":[{"$ref":"#/components/schemas/VaultSlippageBasisPoints"},{"description":"Maximum realized share-price movement in basis points."}]}},"required":["account","amount"],"additionalProperties":false},"VaultV2ForceWithdrawRequestAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Penalty-inclusive amount removed from the vault position, in underlying asset base units."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV2ForceWithdrawAllIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"amount":{"$ref":"#/components/schemas/VaultV2ForceWithdrawRequestAmountAll"},"max_penalty_bps":{"allOf":[{"$ref":"#/components/schemas/ForceRedeemPenaltyBasisPoints"},{"description":"Maximum total force-deallocate penalty relative to the pre-exit position, in basis points. Use 0 to allow only penalty-free exits. For non-recipients, preparation compares this limit with the greater of the planned penalty and the asset value of shares left unredeemed (planned penalty shares plus residual). Fee recipients are bounded by the 2% per-leg cap even when their fees are currently zero; this role-based bound does not depend on current fee rates, which can change before the action expires. If a fee recipient's 10 bps buffered plan exceeds the limit, the API retries with the largest smaller buffer, down to 1 bps, whose per-leg worst case fits; otherwise preparation returns 422. The on-chain transaction does not check this limit."}]}},"required":["account","amount","max_penalty_bps"],"additionalProperties":false},"VaultV2ForceWithdrawRequestAmountAll":{"type":"object","properties":{"unit":{"type":"string","enum":["all"]}},"required":["unit"],"additionalProperties":false,"description":"Plan a full force exit while retaining only bounded execution safety margin."},"VaultV2InKindRedeemResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VaultV2InKindRedeemResponseData"}},"required":["data"],"additionalProperties":false},"VaultV2InKindRedeemResponseData":{"oneOf":[{"$ref":"#/components/schemas/VaultV2InKindRedeemPreparedData"},{"$ref":"#/components/schemas/VaultV2InKindRedeemSimulationFailedData"},{"$ref":"#/components/schemas/VaultV2InKindRedeemSimulationUnavailableData"},{"$ref":"#/components/schemas/VaultV2InKindRedeemSignatureRequiredData"}],"discriminator":{"propertyName":"status","mapping":{"prepared":"#/components/schemas/VaultV2InKindRedeemPreparedData","simulation_failed":"#/components/schemas/VaultV2InKindRedeemSimulationFailedData","simulation_unavailable":"#/components/schemas/VaultV2InKindRedeemSimulationUnavailableData","signature_required":"#/components/schemas/VaultV2InKindRedeemSignatureRequiredData"}}},"VaultV2InKindRedeemPreparedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["prepared"]},"action":{"type":"string","enum":["vault_v2.redeem_in_kind"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV2InKindRedeemResponseAmountAssets"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2InKindRedeemCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/VaultV2InKindRedeemSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","market","amount","calls","simulation"],"additionalProperties":false},"VaultV2InKindRedeemResponseAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Redeemed asset amount in base units."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV2InKindRedeemCall":{"type":"object","properties":{"id":{"type":"string","pattern":"^call_[0-9]+$"},"kind":{"type":"string","enum":["approval","vault_v2_in_kind_redeem"],"description":"Call type. `approval` and `authorization` calls must be sent before the final action call."},"to":{"$ref":"#/components/schemas/ActionAddress"},"data":{"$ref":"#/components/schemas/HexBytes"},"value":{"type":"string","pattern":"^(?:0|[1-9][0-9]*)$","description":"Native currency amount in wei sent with the call, as a decimal string."}},"required":["id","kind","to","data","value"],"additionalProperties":false},"VaultV2InKindRedeemSimulation":{"oneOf":[{"$ref":"#/components/schemas/VaultV2InKindRedeemSimulationSuccess"},{"$ref":"#/components/schemas/VaultV2InKindRedeemSimulationFailure"}],"discriminator":{"propertyName":"status","mapping":{"success":"#/components/schemas/VaultV2InKindRedeemSimulationSuccess","failed":"#/components/schemas/VaultV2InKindRedeemSimulationFailure"}}},"VaultV2InKindRedeemSimulationSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["success"]},"block":{"$ref":"#/components/schemas/ActionSimulationBlock"},"wallet_changes":{"type":"array","items":{"$ref":"#/components/schemas/ActionWalletChange"},"description":"Changes to the selected wallet's spendable native-currency and ERC-20 balances. The API reports protocol position changes separately."},"position_changes":{"$ref":"#/components/schemas/VaultV2InKindRedeemPositionChanges"},"effects":{"$ref":"#/components/schemas/VaultV2InKindRedeemEffects"},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."}},"required":["status","block","wallet_changes","position_changes","effects"],"additionalProperties":false},"VaultV2InKindRedeemPositionChanges":{"type":"object","properties":{"vault_shares":{"allOf":[{"$ref":"#/components/schemas/SignedBaseUnitDifference"},{"description":"Change to the wallet's Vault V2 shares, in share base units."}]},"market_supply_shares":{"allOf":[{"$ref":"#/components/schemas/SignedBaseUnitDifference"},{"description":"Change to the wallet's supply shares in the selected Morpho Blue market."}]}},"required":["vault_shares","market_supply_shares"],"additionalProperties":false,"description":"Simulated vault and Morpho Blue position changes."},"VaultV2InKindRedeemEffects":{"type":"object","properties":{"wallet_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Simulated vault assets sent directly to the wallet, in asset base units. Execution recomputes the idle and in-kind split."}]},"supplied_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Simulated vault assets supplied to the selected Morpho Blue market for the wallet, in asset base units. Execution recomputes the idle and in-kind split."}]},"penalty_assets":{"allOf":[{"$ref":"#/components/schemas/UnsignedBaseUnitAmount"},{"description":"Simulated vault assets retained as the force-deallocate penalty, in asset base units. Execution recomputes the penalty; the preparation-time `max_penalty_bps` check is not enforced on-chain."}]}},"required":["wallet_assets","supplied_assets","penalty_assets"],"additionalProperties":false,"description":"These are simulated values. Execution recomputes the penalty and idle/in-kind split. The bundle accepts no penalty bound. The API checks `max_penalty_bps` on preparation and continuation, not at execution. This field does not guarantee execution effects.\n\nA penalty change that the curator already submitted can become executable before the action expires, even when the current timelock is longer. Unless the setter is abdicated, this change can raise the penalty up to 2%."},"VaultV2InKindRedeemSimulationFailure":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"sender_simulated_as_delegated":{"type":"boolean","enum":[true],"description":"Present when simulation treated the smart contract wallet as a delegated account. Your wallet may behave differently when it submits the calls."},"failure":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ActionSimulationFailureCode"},"message":{"type":"string","minLength":1,"description":"Human-readable explanation of the simulation failure."},"call_id":{"type":"string","pattern":"^call_[0-9]+$","description":"Identifier of the candidate wallet call that failed, when available."}},"required":["code","message"],"additionalProperties":false}},"required":["status","failure"],"additionalProperties":false},"VaultV2InKindRedeemSimulationFailedData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_failed"]},"action":{"type":"string","enum":["vault_v2.redeem_in_kind"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV2InKindRedeemResponseAmountAssets"},"simulation":{"$ref":"#/components/schemas/VaultV2InKindRedeemSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","market","amount","simulation"],"additionalProperties":false},"VaultV2InKindRedeemSimulationUnavailableData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["simulation_unavailable"]},"action":{"type":"string","enum":["vault_v2.redeem_in_kind"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"},"vault":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/ActionAddress"},"asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["address","asset"],"additionalProperties":false},"market":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/MarketId"},"loan_asset":{"$ref":"#/components/schemas/Erc20Asset"}},"required":["id","loan_asset"],"additionalProperties":false},"amount":{"$ref":"#/components/schemas/VaultV2InKindRedeemResponseAmountAssets"},"calls":{"type":"array","items":{"$ref":"#/components/schemas/VaultV2InKindRedeemCall"},"minItems":1,"maxItems":2},"simulation":{"$ref":"#/components/schemas/UnavailableActionSimulation"}},"required":["action_id","status","action","chain_id","account","expires_at","vault","market","amount","calls","simulation"],"additionalProperties":false},"VaultV2InKindRedeemSignatureRequiredData":{"type":"object","properties":{"action_id":{"$ref":"#/components/schemas/ActionId"},"status":{"type":"string","enum":["signature_required"]},"action":{"type":"string","enum":["vault_v2.redeem_in_kind"]},"chain_id":{"$ref":"#/components/schemas/ChainId"},"account":{"$ref":"#/components/schemas/ActionAddress"},"signatures":{"type":"array","items":{"$ref":"#/components/schemas/ActionSignatureRequirement"},"minItems":1,"description":"Typed-data signatures required to continue this action. Every signature requirement ID must be unique."},"continuation":{"type":"string","minLength":1},"expires_at":{"$ref":"#/components/schemas/ActionExpiry"}},"required":["action_id","status","action","chain_id","account","signatures","continuation","expires_at"],"additionalProperties":false},"VaultV2InKindRedeemRequest":{"oneOf":[{"$ref":"#/components/schemas/VaultV2InKindRedeemIntent"},{"$ref":"#/components/schemas/ActionContinuationRequest"}]},"VaultV2InKindRedeemIntent":{"type":"object","properties":{"account":{"$ref":"#/components/schemas/ActionAccount"},"calldata_origin":{"$ref":"#/components/schemas/CalldataOrigin"},"expires_at":{"allOf":[{"$ref":"#/components/schemas/ActionRequestedExpiry"},{"description":"Optional Unix timestamp in seconds when the action expires. Defaults to two hours from now. Must be more than 60 seconds and at most seven days from now."}]},"amount":{"$ref":"#/components/schemas/VaultV2InKindRedeemIntentAmountAssets"},"market":{"allOf":[{"$ref":"#/components/schemas/MarketSelector"},{"description":"Morpho Blue market that receives the illiquid portion as a supply position. Its chain must match the vault's."}]},"max_penalty_bps":{"$ref":"#/components/schemas/VaultV2InKindRedeemMaxPenaltyBasisPoints"},"signature_mode":{"$ref":"#/components/schemas/SignatureMode"}},"required":["account","amount","market"],"additionalProperties":false},"VaultV2InKindRedeemIntentAmountAssets":{"type":"object","properties":{"unit":{"type":"string","enum":["assets"]},"value":{"allOf":[{"$ref":"#/components/schemas/PositiveBaseUnitAmount"},{"description":"Penalty-inclusive vault asset amount to exit in base units."}]}},"required":["unit","value"],"additionalProperties":false},"VaultV2InKindRedeemMaxPenaltyBasisPoints":{"type":"integer","minimum":0,"maximum":200,"description":"Maximum force-deallocate penalty relative to the requested exit amount, in basis points. Include this field when the current penalty is below 2% and its setter is not abdicated. This requirement applies regardless of the setter's timelock. A penalty change that the curator already submitted can become executable before the action expires. In that case, the worst-case rate is 2%.\n\nWhen `max_penalty_bps` is optional, the rounded-up worst-case penalty must still not exceed 200 basis points of the requested exit amount. If the required field is absent, the API returns 422 ACTION_UNSUPPORTED. The API also returns this error if the value cannot cover force-deallocation of the whole exit at the worst-case rate.\n\nThe API checks this limit on preparation and each continuation against the current penalty and abdication state. It never checks the limit at execution. The bundle accepts no penalty bound. The transaction does not enforce this limit. Unless the setter is abdicated, the penalty at execution can be any value up to 2%."},"BlueBorrow400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueBorrow403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueBorrow404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueBorrow413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueBorrow422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","FUNDING_UNSUPPORTED","POSITION_UNHEALTHY","REQUIREMENTS_CHANGED","SHARED_LIQUIDITY_INSUFFICIENT","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueBorrow500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueBorrow503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REALLOCATION_DISCOVERY_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRefinance400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRefinance403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRefinance404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRefinance413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRefinance422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","POSITION_UNHEALTHY","REFINANCE_CROSS_CHAIN","REFINANCE_MARKETS_IDENTICAL","REFINANCE_MARKETS_INCOMPATIBLE","REFINANCE_POSITION_EMPTY","REQUIREMENTS_CHANGED","SHARED_LIQUIDITY_INSUFFICIENT","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRefinance500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRefinance503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REALLOCATION_DISCOVERY_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRepay400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRepay403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRepay404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRepay413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRepay422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","FUNDING_UNSUPPORTED","POSITION_EMPTY","POSITION_INSUFFICIENT","POSITION_UNHEALTHY","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRepay500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueRepay503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupplyCollateral400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupplyCollateral403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupplyCollateral404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupplyCollateral413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupplyCollateral422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","FUNDING_UNSUPPORTED","POSITION_INSUFFICIENT","POSITION_UNHEALTHY","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupplyCollateral500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupplyCollateral503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdrawCollateral400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdrawCollateral403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdrawCollateral404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdrawCollateral413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdrawCollateral422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","POSITION_INSUFFICIENT","POSITION_UNHEALTHY","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdrawCollateral500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdrawCollateral503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupply400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupply403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupply404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupply413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupply422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","FUNDING_UNSUPPORTED","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupply500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueSupply503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdraw400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdraw403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdraw404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdraw413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdraw422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","POSITION_EMPTY","POSITION_INSUFFICIENT","REQUIREMENTS_CHANGED","SHARED_LIQUIDITY_INSUFFICIENT","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdraw500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"BlueWithdraw503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REALLOCATION_DISCOVERY_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightRepay400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightRepay403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightRepay404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightRepay413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightRepay422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","COLLATERAL_UNSUPPORTED","CONTINUOUS_FEE_TOO_HIGH","FUNDING_UNSUPPORTED","OFFER_NOT_FILLABLE","POSITION_EMPTY","POSITION_INSUFFICIENT","POSITION_UNHEALTHY","QUOTE_INSUFFICIENT","QUOTE_STALE","RECEIVER_INVALID","REPAY_EXCEEDS_DEBT","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TARGET_UNREACHABLE","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightRepay500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightRepay503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","QUOTE_INVALID","QUOTE_MARKET_MISMATCH","QUOTE_ORDER_INVALID","QUOTE_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightSupplyCollateral400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightSupplyCollateral403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightSupplyCollateral404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightSupplyCollateral413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightSupplyCollateral422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","COLLATERAL_UNSUPPORTED","FUNDING_UNSUPPORTED","QUOTE_INSUFFICIENT","QUOTE_STALE","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightSupplyCollateral500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightSupplyCollateral503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","QUOTE_INVALID","QUOTE_MARKET_MISMATCH","QUOTE_ORDER_INVALID","QUOTE_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightBorrow400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightBorrow403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightBorrow404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightBorrow413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightBorrow422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","COLLATERAL_UNSUPPORTED","FUNDING_UNSUPPORTED","OFFER_NOT_FILLABLE","POSITION_UNHEALTHY","QUOTE_INSUFFICIENT","QUOTE_RATE_ABOVE_CEILING","QUOTE_STALE","RECEIVER_INVALID","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TARGET_UNREACHABLE","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightBorrow500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightBorrow503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","QUOTE_INVALID","QUOTE_MARKET_MISMATCH","QUOTE_ORDER_INVALID","QUOTE_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeBorrow400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeBorrow403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeBorrow404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeBorrow413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeBorrow422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","COLLATERAL_UNSUPPORTED","CONTINUOUS_FEE_TOO_HIGH","FUNDING_UNSUPPORTED","MARKET_LIQUIDATION_CURSOR_NOT_ENABLED","MARKET_LLTV_NOT_ENABLED","MARKET_MATURITY_TOO_FAR","MARKET_ORACLE_WITHOUT_CODE","OFFER_PAYLOAD_INVALID","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeBorrow500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeBorrow503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeLend400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeLend403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeLend404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeLend413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeLend422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","COLLATERAL_UNSUPPORTED","CONTINUOUS_FEE_TOO_HIGH","FUNDING_UNSUPPORTED","MARKET_LIQUIDATION_CURSOR_NOT_ENABLED","MARKET_LLTV_NOT_ENABLED","MARKET_MATURITY_TOO_FAR","MARKET_ORACLE_WITHOUT_CODE","OFFER_PAYLOAD_INVALID","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeLend500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeLend503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeRepay400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeRepay403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeRepay404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeRepay413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeRepay422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","COLLATERAL_UNSUPPORTED","CONTINUOUS_FEE_TOO_HIGH","FUNDING_UNSUPPORTED","OFFER_PAYLOAD_INVALID","POSITION_EMPTY","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeRepay500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeRepay503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeWithdraw400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeWithdraw403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeWithdraw404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeWithdraw413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeWithdraw422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","COLLATERAL_UNSUPPORTED","CONTINUOUS_FEE_TOO_HIGH","FUNDING_UNSUPPORTED","OFFER_PAYLOAD_INVALID","POSITION_EMPTY","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeWithdraw500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightMakeWithdraw503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightCancelOffers400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightCancelOffers403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightCancelOffers404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightCancelOffers413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightCancelOffers422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightCancelOffers500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightCancelOffers503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","QUOTE_INVALID","QUOTE_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawFunding400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawFunding403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawFunding404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawFunding413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawFunding422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","POSITION_EMPTY","REQUIREMENTS_CHANGED","SHARED_LIQUIDITY_INSUFFICIENT","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawFunding500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawFunding503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightTake400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightTake403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightTake404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND","OFFER_GROUP_NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightTake413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightTake422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","COLLATERAL_UNSUPPORTED","CONTINUOUS_FEE_TOO_HIGH","FUNDING_UNSUPPORTED","OFFER_GROUP_MAKER_CANNOT_PAY","OFFER_NOT_FILLABLE","POSITION_UNHEALTHY","QUOTE_INSUFFICIENT","QUOTE_RATE_ABOVE_CEILING","RECEIVER_INVALID","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TARGET_UNREACHABLE","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightTake500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightTake503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","QUOTE_INVALID","QUOTE_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightLend400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightLend403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightLend404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightLend413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightLend422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","CONTINUOUS_FEE_TOO_HIGH","FUNDING_UNSUPPORTED","OFFER_NOT_FILLABLE","QUOTE_INSUFFICIENT","QUOTE_STALE","RECEIVER_INVALID","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TARGET_UNREACHABLE","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightLend500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightLend503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","QUOTE_INVALID","QUOTE_MARKET_MISMATCH","QUOTE_ORDER_INVALID","QUOTE_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdraw400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdraw403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdraw404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdraw413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdraw422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","INSUFFICIENT_LIQUIDITY","OFFER_NOT_FILLABLE","POSITION_EMPTY","POSITION_INSUFFICIENT","QUOTE_INSUFFICIENT","QUOTE_RATE_ABOVE_CEILING","QUOTE_STALE","RECEIVER_INVALID","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TARGET_UNREACHABLE","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdraw500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdraw503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","QUOTE_INVALID","QUOTE_MARKET_MISMATCH","QUOTE_ORDER_INVALID","QUOTE_UNAVAILABLE","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawCollateral400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawCollateral403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawCollateral404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["MARKET_NOT_FOUND","NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawCollateral413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawCollateral422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","COLLATERAL_UNSUPPORTED","FUNDING_UNSUPPORTED","POSITION_EMPTY","POSITION_INSUFFICIENT","POSITION_UNHEALTHY","RECEIVER_INVALID","REPAY_EXCEEDS_DEBT","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TARGET_UNREACHABLE","TOKEN_METADATA_INVALID","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawCollateral500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","PREPARATION_INVALID","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"MidnightWithdrawCollateral503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Deposit400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Deposit403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Deposit404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND","VAULT_NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Deposit413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Deposit422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","AMOUNT_TOO_SMALL","FUNDING_UNSUPPORTED","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VAULT_UNSUPPORTED","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Deposit500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Deposit503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Withdraw400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Withdraw403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Withdraw404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND","VAULT_NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Withdraw413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Withdraw422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","AMOUNT_TOO_SMALL","POSITION_EMPTY","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VAULT_UNSUPPORTED","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Withdraw500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV1Withdraw503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Deposit400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Deposit403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Deposit404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND","VAULT_NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Deposit413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Deposit422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","AMOUNT_TOO_SMALL","FUNDING_UNSUPPORTED","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VAULT_UNSUPPORTED","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Deposit500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Deposit503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Withdraw400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Withdraw403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Withdraw404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND","VAULT_NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Withdraw413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Withdraw422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","AMOUNT_TOO_SMALL","INSUFFICIENT_LIQUIDITY","POSITION_EMPTY","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VAULT_UNSUPPORTED","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Withdraw500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2Withdraw503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2ForceWithdraw400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2ForceWithdraw403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED","COUNTERPARTY_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2ForceWithdraw404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND","VAULT_NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2ForceWithdraw413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2ForceWithdraw422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","POSITION_EMPTY","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VAULT_UNSUPPORTED","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2ForceWithdraw500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2ForceWithdraw503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2InKindRedeem400ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["REQUEST_ABORTED","REQUEST_BODY_INCOMPLETE","VALIDATION_FAILED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2InKindRedeem403ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_SERVED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2InKindRedeem404ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_FOUND","VAULT_NOT_FOUND"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2InKindRedeem413ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["PAYLOAD_TOO_LARGE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2InKindRedeem422ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ACTION_CONTINUATION_INVALID","ACTION_TOO_COMPLEX","ACTION_UNSUPPORTED","IN_KIND_REDEEM_CROSS_CHAIN","MARKET_NOT_FOUND","POSITION_EMPTY","REQUIREMENTS_CHANGED","SIGNATURE_INVALID","SIGNATURE_REFRESH_REQUIRED","TOKEN_METADATA_INVALID","VAULT_UNSUPPORTED","VERIFICATION_REJECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2InKindRedeem500ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INTERNAL_ERROR","REQUIREMENT_SERIALIZATION_FAILED","REQUIREMENT_UNSUPPORTED","SIGNATURE_UNEXPECTED"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"VaultV2InKindRedeem503ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["CONTRACT_CODE_MISSING","REQUIREMENT_UNSUPPORTED","RPC_CHAIN_MISMATCH","SERVICE_UNAVAILABLE","STATE_UNAVAILABLE","VERIFICATION_INVALID_RESPONSE","VERIFICATION_UNAVAILABLE"],"description":"Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status."},"message":{"type":"string","description":"Human-readable error description."},"details":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable validation issue code."},"message":{"type":"string","description":"Human-readable issue description."},"path":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"}]},"description":"Path to the invalid request value."},"max_expires_at":{"type":"integer","minimum":0,"description":"Latest Unix timestamp in seconds supported by the rejected Midnight quote, based on offer validity, signed offer expiry, and market maturity. On QUOTE_STALE, this is a retry hint, not a guarantee for a new quote. It may not meet the 15-second minimum for market quotes or the five-minute minimum for offer-group take."},"rule":{"type":"string","description":"Public offer requirement that the Midnight offers did not meet."},"details":{"type":"object","nullable":true,"properties":{"min_assets":{"type":"string","pattern":"^[0-9]+$","description":"Configured minimum in raw loan assets, as a base-10 integer string."},"loan_token":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Loan asset of the first offer below its configured minimum."}},"required":["min_assets","loan_token"],"additionalProperties":false,"description":"Minimum offer size for min_offer_assets_usd; null for other offer validation rules. Absent for other errors."}},"required":["code","message","path"],"additionalProperties":false},"description":"Structured error context, or null when none is available."},"request_id":{"type":"string","description":"Server-assigned request ID, also returned in the X-Request-Id header."}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}},"parameters":{}},"paths":{"/v0/actions/blue/markets/{market-selector}/borrow":{"post":{"operationId":"buildBlueBorrow","tags":["Blue"],"summary":"Blue Borrow","description":"Build and simulate wallet calls to borrow an exact gross loan asset amount. Use an existing Morpho Blue market. When the market lacks liquidity, the borrow can obtain liquidity from other markets through Morpho shared liquidity. Any `signature_mode` other than `none` requests Morpho authorization typed data instead of an authorization call when available.\n\nAdd `collateral_amount` and `funding` to supply an exact collateral amount in the same atomic action. For wrapped-native collateral, set `funding.type` to `native`, `erc20`, or balance-based `auto`. The API does not support mixed funding. With collateral, `signature_mode` also selects prerequisite calls or automatic ERC-2612 signature selection for the collateral transfer.\n\nBefore POST, read the market user position from the Morpho Read API (`/v0/blue/markets/{market}/users/{user}/position`): `max_borrow_assets` for an assets quote; no `all` mode is supported. `null` means the price-dependent limit is unknown or unavailable: do not send it as an amount. The quote is the lower of this market's own liquidity and the borrow capacity at the market's exact liquidation loan-to-value; it excludes shared liquidity. The API always keeps a safety margin below the liquidation loan-to-value, so it can reject amounts at or near the quote whichever limit sets it: leave headroom. The quote is a snapshot: the API reads live state when it builds the action, so a quoted amount can become unavailable.","parameters":[{"schema":{"$ref":"#/components/schemas/MarketSelectorUsdcCbBtc"},"required":true,"description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactBorrow":{"summary":"Borrow an exact gross loan asset amount","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"}}},"referralFee":{"summary":"Borrow with a referral fee","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"}}},"authorizationSignature":{"summary":"Request a Morpho authorization signature","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"signature_mode":"auto"}},"continuation":{"summary":"Continue with the collected authorization signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}},"supplyCollateralErc20Funding":{"summary":"Supply ERC-20 collateral and borrow atomically","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","collateral_amount":{"unit":"assets","value":"500000"},"amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"}}},"supplyCollateralSignatureMode":{"summary":"Automatically select collateral permits or approval calls","value":{"signature_mode":"auto","account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","collateral_amount":{"unit":"assets","value":"500000"},"amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"}}},"supplyCollateralNativeFunding":{"summary":"Supply native collateral and borrow atomically","description":"Available when the selected market collateral is the chain's registered wrapped-native asset.","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","collateral_amount":{"unit":"assets","value":"500000"},"amount":{"unit":"assets","value":"1000000"},"funding":{"type":"native","max_native_assets":"1000000"}}},"supplyCollateralAutoFunding":{"summary":"Select collateral funding from the wallet balance","description":"Available when the selected market collateral is the chain's registered wrapped-native asset.","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","collateral_amount":{"unit":"assets","value":"500000"},"amount":{"unit":"assets","value":"1000000"},"funding":{"type":"auto","max_native_assets":"1000000"}}},"supplyCollateralReferralFee":{"summary":"Supply collateral and borrow with a referral fee","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","collateral_amount":{"unit":"assets","value":"500000"},"amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"}}}},"schema":{"$ref":"#/components/schemas/BlueBorrowRequest"}}}},"responses":{"200":{"description":"A signature request or prepared, simulated borrow calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared borrow","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.borrow","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"calls":[{"id":"call_0","kind":"blue_borrow","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xb1268765000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f4240ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"supply_shares":"0","borrow_shares":"900000","collateral_assets":"0"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000","ltv_bps":2251,"max_ltv_bps":8550}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"referralFee":{"summary":"Prepared borrow with a referral fee","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.borrow","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"},"calls":[{"id":"call_0","kind":"blue_borrow","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xb1268765000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f4240ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"997500"}],"position_changes":{"supply_shares":"0","borrow_shares":"900000","collateral_assets":"0"},"effects":{"gross_assets":"1000000","referral_fee_assets":"2500","net_assets":"997500","ltv_bps":2251,"max_ltv_bps":8550}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"authorizationRequired":{"summary":"Morpho authorization signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"blue.borrow","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","signatures":[{"id":"signature_0","kind":"authorization","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"},"types":{"Authorization":[{"name":"authorizer","type":"address"},{"name":"authorized","type":"address"},{"name":"isAuthorized","type":"bool"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Authorization","message":{"authorizer":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","authorized":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","isAuthorized":true,"nonce":"0","deadline":"4000000000"}}}],"continuation":"continuation_from_previous_response","expires_at":4000000000}}},"failedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"blue.borrow","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"supplyCollateralApprovalRequired":{"summary":"Prepared atomic batch with an ERC-20 approval","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.borrow","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"collateral_amount":{"unit":"assets","value":"500000"},"resolved_funding":{"wrapped_asset":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf","max_native_assets":"0","erc20_assets":"500000","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b000000000000000000000000000000000000000000000000000000000007a120","value":"0"},{"id":"call_1","kind":"blue_supply_collateral_borrow","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xb1268765000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f4240ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"-500000"},{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"supply_shares":"0","borrow_shares":"900000","collateral_assets":"500000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000","ltv_bps":2251,"max_ltv_bps":8550,"supplied_collateral_assets":"500000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"supplyCollateralAllowanceSufficient":{"summary":"Prepared action using an existing allowance","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.borrow","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"collateral_amount":{"unit":"assets","value":"500000"},"resolved_funding":{"wrapped_asset":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf","max_native_assets":"0","erc20_assets":"500000","native_assets":"0"},"calls":[{"id":"call_0","kind":"blue_supply_collateral_borrow","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xb1268765000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000000007a12000000000000000000000000000000000000000000000000000000000000f4240ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"-500000"},{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"supply_shares":"0","borrow_shares":"900000","collateral_assets":"500000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000","ltv_bps":2251,"max_ltv_bps":8550,"supplied_collateral_assets":"500000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"supplyCollateralReferralFee":{"summary":"Prepared collateral supply and borrow with a referral fee","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.borrow","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"collateral_amount":{"unit":"assets","value":"500000"},"resolved_funding":{"wrapped_asset":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf","max_native_assets":"0","erc20_assets":"500000","native_assets":"0"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"},"calls":[{"id":"call_0","kind":"blue_supply_collateral_borrow","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xb1268765000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000000007a12000000000000000000000000000000000000000000000000000000000000f4240ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"-500000"},{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"997500"}],"position_changes":{"supply_shares":"0","borrow_shares":"900000","collateral_assets":"500000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"2500","net_assets":"997500","ltv_bps":2251,"max_ltv_bps":8550,"supplied_collateral_assets":"500000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"supplyCollateralErc2612":{"summary":"ERC-2612 and Morpho authorization signatures required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"blue.borrow","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"name":"Coinbase Wrapped BTC","version":"1","chainId":8453,"verifyingContract":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Permit","message":{"owner":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","spender":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","value":"500000","nonce":"0","deadline":"4000000000"}}},{"id":"signature_1","kind":"authorization","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"},"types":{"Authorization":[{"name":"authorizer","type":"address"},{"name":"authorized","type":"address"},{"name":"isAuthorized","type":"bool"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Authorization","message":{"authorizer":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","authorized":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","isAuthorized":true,"nonce":"0","deadline":"4000000000"}}}],"continuation":"continuation_from_previous_response","expires_at":4000000000}}},"supplyCollateralContinuation":{"summary":"Prepared after the signature continuation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.borrow","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"collateral_amount":{"unit":"assets","value":"500000"},"resolved_funding":{"wrapped_asset":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf","max_native_assets":"0","erc20_assets":"500000","native_assets":"0"},"calls":[{"id":"call_0","kind":"blue_supply_collateral_borrow","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xb1268765000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000000007a12000000000000000000000000000000000000000000000000000000000000f4240ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"-500000"},{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"supply_shares":"0","borrow_shares":"900000","collateral_assets":"500000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000","ltv_bps":2251,"max_ltv_bps":8550,"supplied_collateral_assets":"500000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"supplyCollateralFailedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"blue.borrow","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"collateral_amount":{"unit":"assets","value":"500000"},"resolved_funding":{"wrapped_asset":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf","max_native_assets":"0","erc20_assets":"500000","native_assets":"0"},"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}}},"schema":{"$ref":"#/components/schemas/BlueBorrowResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueBorrow400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueBorrow403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Morpho Blue market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"marketNotFound":{"summary":"The Morpho Blue market does not exist on this chain","description":"The selected Morpho Blue market was not found on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","message":"The Morpho Blue market does not exist on this chain.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueBorrow404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueBorrow413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The action is unsupported, unhealthy, has insufficient direct and shared liquidity, or uses an unsupported funding mode. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Morpho Blue borrowing.","details":null,"request_id":"req_0123456789abcdef"}}},"fundingUnsupported":{"summary":"The native funding cap cannot fund this action","description":"Retry with ERC-20 funding by setting `funding.type` to `erc20`, or select `native`/`auto` with a cap covering the full action amount.","value":{"error":{"code":"FUNDING_UNSUPPORTED","message":"Unsupported funding mode.","details":[{"code":"custom","message":"The native funding cap is below the action amount","path":["funding","max_native_assets"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueBorrow422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueBorrow500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"Chain state is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueBorrow503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/blue/markets/{market-selector}/refinance":{"post":{"operationId":"buildBlueRefinance","tags":["Blue"],"summary":"Blue Refinance","description":"Move a wallet's complete live debt and collateral between distinct existing markets on the same chain. The API builds and simulates the wallet calls. Both markets must be existing Morpho Blue markets. The API always moves the full position.\n\n`destination_borrow_assets` equals the repaid source assets plus `referral_fee_assets`. The API uses only zero-penalty shared liquidity. Thus, the new debt finances no withdrawal penalty.\n\nAny `signature_mode` other than `none` requests Morpho authorization typed data instead of an authorization call when available.","parameters":[{"schema":{"$ref":"#/components/schemas/MarketSelectorUsdcWeEth"},"required":true,"description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"refinance":{"summary":"Refinance the full source position","value":{"account":"0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a","destination_market":"8453:0x1c21c59df9db44bf6f645d854ee710a8ca17b479451447e9f56758aee10a2fad"}},"referralFee":{"summary":"Refinance with a debt-financed referral fee","description":"The recipient receives loan assets borrowed in addition to the amount needed to repay the source debt.","value":{"account":"0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a","destination_market":"8453:0x1c21c59df9db44bf6f645d854ee710a8ca17b479451447e9f56758aee10a2fad","referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"}}},"authorizationSignature":{"summary":"Request a Morpho authorization signature","value":{"account":"0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a","destination_market":"8453:0x1c21c59df9db44bf6f645d854ee710a8ca17b479451447e9f56758aee10a2fad","signature_mode":"auto"}},"continuation":{"summary":"Continue with the collected authorization signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}}},"schema":{"$ref":"#/components/schemas/BlueRefinanceRequest"}}}},"responses":{"200":{"description":"A signature request or prepared, simulated refinance.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared full-position refinance","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.refinance","chain_id":8453,"account":"0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a","expires_at":4000000000,"source_market":{"id":"0x0ca10126f6c94cbd9cf0a48cc9516ae5e3dec5aa68303e6d988ee37c5149bf0d","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"}},"destination_market":{"id":"0x1c21c59df9db44bf6f645d854ee710a8ca17b479451447e9f56758aee10a2fad","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"}},"calls":[{"id":"call_0","kind":"authorization","to":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb","data":"0xeecea0000000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000001","value":"0"},{"id":"call_1","kind":"blue_refinance","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x9834e387000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec2200000000000000000000000097ff9cbd7e77348b2b8ffbb883bf29452ad1829500000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000aaf96eb9d0d0000000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22000000000000000000000000b40d93f44411d8c09ad17d7f88195ef9b05ccd9600000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600000000000000000000000000000000000000000000000000000bdd91f852f580000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000ee6b280022221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[],"position_changes":{"source":{"supply_shares":"0","borrow_shares":"-1000000000000","collateral_assets":"-1079092051947491"},"destination":{"supply_shares":"0","borrow_shares":"931118670670","collateral_assets":"1079092051947491"}},"effects":{"collateral_assets":"1079092051947491","source_repaid_assets":"1042906","source_repaid_shares":"1000000000000","referral_fee_assets":"0","destination_borrow_assets":"1042906","destination_borrow_shares":"931118670670","ltv_bps":2251,"max_ltv_bps":8550}}}}},"referralFee":{"summary":"Prepared refinance with additional fee debt","description":"`destination_borrow_assets` equals the repaid source assets plus `referral_fee_assets`; the API uses only zero-penalty shared liquidity, so no withdrawal penalty is financed.","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.refinance","chain_id":8453,"account":"0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a","expires_at":4000000000,"source_market":{"id":"0x0ca10126f6c94cbd9cf0a48cc9516ae5e3dec5aa68303e6d988ee37c5149bf0d","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"}},"destination_market":{"id":"0x1c21c59df9db44bf6f645d854ee710a8ca17b479451447e9f56758aee10a2fad","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"}},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"},"calls":[{"id":"call_0","kind":"authorization","to":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb","data":"0xeecea0000000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000001","value":"0"},{"id":"call_1","kind":"blue_refinance","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x9834e387000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec2200000000000000000000000097ff9cbd7e77348b2b8ffbb883bf29452ad1829500000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000aaf96eb9d0d0000000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22000000000000000000000000b40d93f44411d8c09ad17d7f88195ef9b05ccd9600000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600000000000000000000000000000000000000000000000000000bdd91f852f580000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000ee6b280022221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[],"position_changes":{"source":{"supply_shares":"0","borrow_shares":"-1000000000000","collateral_assets":"-1079092051947491"},"destination":{"supply_shares":"0","borrow_shares":"933451314667","collateral_assets":"1079092051947491"}},"effects":{"collateral_assets":"1079092051947491","source_repaid_assets":"1042906","source_repaid_shares":"1000000000000","referral_fee_assets":"2613","destination_borrow_assets":"1045519","destination_borrow_shares":"933451314667","ltv_bps":2251,"max_ltv_bps":8550}}}}},"authorizationRequired":{"summary":"Morpho authorization signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"blue.refinance","chain_id":8453,"account":"0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a","signatures":[{"id":"signature_0","kind":"authorization","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"},"types":{"Authorization":[{"name":"authorizer","type":"address"},{"name":"authorized","type":"address"},{"name":"isAuthorized","type":"bool"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Authorization","message":{"authorizer":"0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a","authorized":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","isAuthorized":true,"nonce":"0","deadline":"4000000000"}}}],"continuation":"continuation_from_previous_response","expires_at":4000000000}}},"failedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"blue.refinance","chain_id":8453,"account":"0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a","expires_at":4000000000,"source_market":{"id":"0x0ca10126f6c94cbd9cf0a48cc9516ae5e3dec5aa68303e6d988ee37c5149bf0d","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"}},"destination_market":{"id":"0x1c21c59df9db44bf6f645d854ee710a8ca17b479451447e9f56758aee10a2fad","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"}},"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}}}}}},"schema":{"$ref":"#/components/schemas/BlueRefinanceResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The destination market field appears more than once","description":"Include `destination_market` only once in the request body.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"duplicate_key","message":"Duplicate JSON key","path":["destination_market"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRefinance400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRefinance403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Morpho Blue market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"marketNotFound":{"summary":"The Morpho Blue market does not exist on this chain","description":"The selected Morpho Blue market was not found on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","message":"The Morpho Blue market does not exist on this chain.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRefinance404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRefinance413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The action is unsupported, unhealthy, or has insufficient direct and shared liquidity. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Morpho Blue refinancing.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRefinance422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueRefinance500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"Chain state is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRefinance503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/blue/markets/{market-selector}/repay":{"post":{"operationId":"buildBlueRepay","tags":["Blue"],"summary":"Blue Repay","description":"Repay exact loan assets, exact borrow shares, or the wallet's full debt in a Morpho Blue market. The API builds and simulates the wallet calls. `max_repay_assets` reports the maximum loan amount that can leave the wallet. This includes interest accrued since the quote and any referral fee. For wrapped-native debt, set `funding.type` to `native`, `erc20`, or balance-based `auto`. The API does not support mixed funding.\n\nUse `signature_mode` to select prerequisite approval calls or automatic ERC-2612 signature selection. Add `collateral_amount` to withdraw an exact collateral amount in the same atomic action. The API then applies a conservative loan-to-value bound.","parameters":[{"schema":{"$ref":"#/components/schemas/MarketSelectorUsdcCbBtc"},"required":true,"description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Repay exact loan assets","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"}}},"nativeFunding":{"summary":"Repay with native currency","description":"Available when the selected market loan asset is the chain's registered wrapped-native asset.","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"native","max_native_assets":"1000000"}}},"autoFunding":{"summary":"Select repayment funding from the wallet balance","description":"Available when the selected market loan asset is the chain's registered wrapped-native asset.","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"auto","max_native_assets":"1000000"}}},"exactShares":{"summary":"Repay exact borrow shares","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"shares","value":"900000"},"funding":{"type":"erc20"}}},"all":{"summary":"Repay the full debt position","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"all"},"funding":{"type":"erc20"},"signature_mode":"auto"}},"referralFee":{"summary":"Repay with a referral fee","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"},"referral_fee":{"bps":100,"recipient":"0x3000000000000000000000000000000000000003"}}},"continuation":{"summary":"Continue with the collected token signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}},"withdrawCollateralExactAssets":{"summary":"Repay assets and withdraw collateral atomically","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"assets","value":"1000000"},"collateral_amount":{"unit":"assets","value":"500000"},"funding":{"type":"erc20"}}},"withdrawCollateralNativeFunding":{"summary":"Repay with native currency and withdraw collateral","description":"Available when the selected market loan asset is the chain's registered wrapped-native asset.","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"assets","value":"1000000"},"collateral_amount":{"unit":"assets","value":"500000"},"funding":{"type":"native","max_native_assets":"1000000"}}},"withdrawCollateralAutoFunding":{"summary":"Select repayment funding from the wallet balance","description":"Available when the selected market loan asset is the chain's registered wrapped-native asset.","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"assets","value":"1000000"},"collateral_amount":{"unit":"assets","value":"500000"},"funding":{"type":"auto","max_native_assets":"1000000"}}},"withdrawCollateralExactShares":{"summary":"Repay shares and withdraw collateral atomically","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"shares","value":"900000"},"collateral_amount":{"unit":"assets","value":"500000"},"funding":{"type":"erc20"}}},"withdrawCollateralCompleteWithSignatures":{"summary":"Close debt and use authorization signatures","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"all"},"collateral_amount":{"unit":"assets","value":"500000"},"funding":{"type":"erc20"},"signature_mode":"auto"}},"withdrawCollateralReferralFee":{"summary":"Repay and withdraw collateral with a referral fee","value":{"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","amount":{"unit":"assets","value":"1000000"},"collateral_amount":{"unit":"assets","value":"500000"},"funding":{"type":"erc20"},"referral_fee":{"bps":100,"recipient":"0x3000000000000000000000000000000000000003"}}}},"schema":{"$ref":"#/components/schemas/BlueRepayRequest"}}}},"responses":{"200":{"description":"A token signature request or prepared repayment calls with simulation results.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"approvalRequired":{"summary":"Prepared repayment with required ERC-20 approval","value":{"data":{"action_id":"act_4dfa40e76ed2468abaa3f7dbd52d684e","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1791829901,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"max_repay_assets":"1000000","resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"blue_repay","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006acd278d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006acd208622221111","value":"0"}],"action":"blue.repay","simulation":{"status":"success","block":{"number":"52519378","timestamp":1791828103},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"supply_shares":"0","borrow_shares":"-890020077263","collateral_assets":"0"},"effects":{"repaid_assets":"1000000","repaid_shares":"890020077263","referral_fee_assets":"0"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"exactAssets":{"summary":"Prepared exact-asset repayment","value":{"data":{"action_id":"act_4dfa40e76ed2468abaa3f7dbd52d684e","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1791829901,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"max_repay_assets":"1000000","resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"blue_repay","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006acd278d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006acd208622221111","value":"0"}],"action":"blue.repay","simulation":{"status":"success","block":{"number":"52519378","timestamp":1791828103},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"supply_shares":"0","borrow_shares":"-890020077263","collateral_assets":"0"},"effects":{"repaid_assets":"1000000","repaid_shares":"890020077263","referral_fee_assets":"0"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"exactShares":{"summary":"Prepared exact-share repayment","value":{"data":{"action_id":"act_3b3d56f3ef744adea4209e73d046bdfe","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1791829902,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"shares","value":"900000"},"max_repay_assets":"2","resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"2","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000002","value":"0"},{"id":"call_1","kind":"blue_repay","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbba000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006acd278e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006acd208722221111","value":"0"}],"action":"blue.repay","simulation":{"status":"success","block":{"number":"52519378","timestamp":1791828103},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-2"}],"position_changes":{"supply_shares":"0","borrow_shares":"-900000","collateral_assets":"0"},"effects":{"repaid_assets":"2","repaid_shares":"900000","referral_fee_assets":"0"}},"resolved_amount":{"unit":"shares","value":"900000"}}}},"all":{"summary":"Prepared full repayment","value":{"data":{"action_id":"act_a8e9d642a03e4589a52241ae0cc1eecd","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1792692768,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"all"},"max_repay_assets":"2263979","resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"2263979","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000228bab","value":"0"},{"id":"call_1","kind":"blue_repay","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000228bab0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ada52200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ada4b1a22221111","value":"0"}],"action":"blue.repay","simulation":{"status":"success","block":{"number":"52950811","timestamp":1792690969},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-2263973"}],"position_changes":{"supply_shares":"0","borrow_shares":"-2012168105723","collateral_assets":"0"},"effects":{"repaid_assets":"2263973","repaid_shares":"2012168105723","referral_fee_assets":"0"}},"resolved_amount":{"unit":"shares","value":"2012168105723"}}}},"signatureRequired":{"summary":"Repayment signature required","value":{"data":{"action_id":"act_6f9c4cafa61a462c8b7a1a8134d48fbb","status":"signature_required","action":"blue.repay","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"name":"USD Coin","version":"2","chainId":8453,"verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"message":{"owner":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","spender":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","value":"1000000","nonce":"17","deadline":"1791829904"},"primaryType":"Permit"}}],"continuation":"eyJhbGciOiJFUzI1NiIsImtpZCI6Im1vcnBoby1hY3Rpb25zLWF0dGVzdG9yLWRldi0xIiwidHlwIjoibW9ycGhvLWFjdGlvbi1jb250aW51YXRpb24rand0In0.eyJpc3MiOiJtb3JwaG8tYWN0aW9ucy1hdHRlc3Rvci1zdGFnaW5nIiwiYXVkIjpbIm1vcnBoby1hY3Rpb25zLWFwaSIsIm1vcnBoby1hY3Rpb25zLWF0dGVzdG9yIl0sInN1YiI6ImFjdGlvbi1jb250aW51YXRpb24iLCJqdGkiOiI5YjIwMzhlMi02NzcxLTRmZjYtYWRjYS1hNGNhMWUxNDIyNmUiLCJpYXQiOjE3OTE4MjgxMDQsImV4cCI6MTc5MTgyOTkwNCwidmVyc2lvbiI6MiwiYWN0aW9uSWQiOiJhY3RfNmY5YzRjYWZhNjFhNDYyYzhiN2ExYTgxMzRkNDhmYmIiLCJhY3Rpb24iOiJibHVlLnJlcGF5IiwicG9saWN5VmVyc2lvbiI6ImJsdWUucmVwYXkvdjEiLCJjaGFpbklkIjo4NDUzLCJhY2NvdW50IjoiMHhFODVmYmM2RjA0NDlhOTJlRjk1OGM1YTQ0RDQ3MTlkZGFDRTk4RDZCIiwidGFyZ2V0IjoiL3YwL2FjdGlvbnMvYmx1ZS9tYXJrZXRzLzg0NTM6MHg5MTAzYzNiNGU4MzQ0NzZjOWE2MmVhMDA5YmEyYzg4NGVlNDJlOTRlNmUzMTRhMjZmMDRkMzEyNDM0MTkxODM2L3JlcGF5IiwicmVxdWVzdENvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbiIsInJlcXVlc3RCb2R5QmFzZTY0dXJsIjoiZXlKaFkyTnZkVzUwSWpvaU1IaEZPRFZtWW1NMlJqQTBORGxoT1RKbFJqazFPR00xWVRRMFJEUTNNVGxrWkdGRFJUazRSRFpDSWl3aWNtVndZWGtpT25zaWRXNXBkQ0k2SW1GemMyVjBjeUlzSW5aaGJIVmxJam9pTVRBd01EQXdNQ0o5TENKbWRXNWthVzVuSWpwN0ltMXZaR1VpT2lKbGNtTXlNQ0o5TENKd2NtVm1aWEpmYzJsbmJtRjBkWEpsSWpwMGNuVmxmUSIsInJlcXVlc3RCb2R5U2hhMjU2IjoiQzEyZG8zQXc5c3FxYTBNbElCUTc2eGoxUDk5YjEwa25ld1MtRldrbXpQUSIsImV4cGlyZXNBdCI6MTc5MTgyOTkwNCwicmVxdWlyZW1lbnRzIjpbeyJpZCI6InNpZ25hdHVyZV8wIiwiaW5kZXgiOjAsInR5cGUiOiJzaWduYXR1cmUiLCJraW5kIjoicGVybWl0IiwiaGFzaCI6IlIxSXd5RW1Rbmw0ODhMWTF1eG1fa3pndmdaYjlSQjVsZGxjWkktb29saGMiLCJldmlkZW5jZSI6eyJ0eXBlIjoic2lnbmF0dXJlIiwiaW5kZXgiOjAsImlkIjoic2lnbmF0dXJlXzAiLCJraW5kIjoicGVybWl0Iiwic2RrQWN0aW9uIjp7InR5cGUiOiJwZXJtaXQiLCJhcmdzIjp7InNwZW5kZXIiOiIweDREMjhEOTAwZTM4MWVDRTRCMzUxMzAyZjFBYmU1ODg0OTY3OTNBMmIiLCJhbW91bnQiOiIxMDAwMDAwIiwiZGVhZGxpbmUiOiIxNzkxODI5OTA0Iiwibm9uY2UiOiIxNyJ9LCJ0eXBlZERhdGEiOnsiZG9tYWluIjp7Im5hbWUiOiJVU0QgQ29pbiIsInZlcnNpb24iOiIyIiwiY2hhaW5JZCI6ODQ1MywidmVyaWZ5aW5nQ29udHJhY3QiOiIweDgzMzU4OWZDRDZlRGI2RTA4ZjRjN0MzMkQ0ZjcxYjU0YmRBMDI5MTMifSwidHlwZXMiOnsiUGVybWl0IjpbeyJuYW1lIjoib3duZXIiLCJ0eXBlIjoiYWRkcmVzcyJ9LHsibmFtZSI6InNwZW5kZXIiLCJ0eXBlIjoiYWRkcmVzcyJ9LHsibmFtZSI6InZhbHVlIiwidHlwZSI6InVpbnQyNTYifSx7Im5hbWUiOiJub25jZSIsInR5cGUiOiJ1aW50MjU2In0seyJuYW1lIjoiZGVhZGxpbmUiLCJ0eXBlIjoidWludDI1NiJ9XX0sIm1lc3NhZ2UiOnsib3duZXIiOiIweEU4NWZiYzZGMDQ0OWE5MmVGOTU4YzVhNDRENDcxOWRkYUNFOThENkIiLCJzcGVuZGVyIjoiMHg0RDI4RDkwMGUzODFlQ0U0QjM1MTMwMmYxQWJlNTg4NDk2NzkzQTJiIiwidmFsdWUiOiIxMDAwMDAwIiwibm9uY2UiOiIxNyIsImRlYWRsaW5lIjoiMTc5MTgyOTkwNCJ9LCJwcmltYXJ5VHlwZSI6IlBlcm1pdCJ9fSwidHlwZWREYXRhIjp7ImRvbWFpbiI6eyJuYW1lIjoiVVNEIENvaW4iLCJ2ZXJzaW9uIjoiMiIsImNoYWluSWQiOjg0NTMsInZlcmlmeWluZ0NvbnRyYWN0IjoiMHg4MzM1ODlmQ0Q2ZURiNkUwOGY0YzdDMzJENGY3MWI1NGJkQTAyOTEzIn0sInR5cGVzIjp7IlBlcm1pdCI6W3sibmFtZSI6Im93bmVyIiwidHlwZSI6ImFkZHJlc3MifSx7Im5hbWUiOiJzcGVuZGVyIiwidHlwZSI6ImFkZHJlc3MifSx7Im5hbWUiOiJ2YWx1ZSIsInR5cGUiOiJ1aW50MjU2In0seyJuYW1lIjoibm9uY2UiLCJ0eXBlIjoidWludDI1NiJ9LHsibmFtZSI6ImRlYWRsaW5lIiwidHlwZSI6InVpbnQyNTYifV19LCJtZXNzYWdlIjp7Im93bmVyIjoiMHhFODVmYmM2RjA0NDlhOTJlRjk1OGM1YTQ0RDQ3MTlkZGFDRTk4RDZCIiwic3BlbmRlciI6IjB4NEQyOEQ5MDBlMzgxZUNFNEIzNTEzMDJmMUFiZTU4ODQ5Njc5M0EyYiIsInZhbHVlIjoiMTAwMDAwMCIsIm5vbmNlIjoiMTciLCJkZWFkbGluZSI6IjE3OTE4Mjk5MDQifSwicHJpbWFyeVR5cGUiOiJQZXJtaXQifX19XX0.ueM5ZORpK-sg-cUsqaqkI7JANCc_6TdMYHipVqZ-0W6j_UipzIY0ZpTJvoC_g4PHAobSX1acPCigPBoid9uhUw","expires_at":1791829904}}},"referralFee":{"summary":"Prepared repayment with a referral fee","value":{"data":{"action_id":"act_bb3bf00c27194e8f947ada6093850cbf","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1791829905,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"max_repay_assets":"1010101","referral_fee":{"bps":100,"recipient":"0x3000000000000000000000000000000000000003"},"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1010101","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b00000000000000000000000000000000000000000000000000000000000f69b5","value":"0"},{"id":"call_1","kind":"blue_repay","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f69b50000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000003000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000006acd27910000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006acd208b22221111","value":"0"}],"action":"blue.repay","simulation":{"status":"success","block":{"number":"52519380","timestamp":1791828107},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1010101"}],"position_changes":{"supply_shares":"0","borrow_shares":"-890020071630","collateral_assets":"0"},"effects":{"repaid_assets":"1000000","repaid_shares":"890020071630","referral_fee_assets":"10101"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"failedSimulation":{"summary":"A rejected repayment simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"blue.repay","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"max_repay_assets":"1000000","resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"withdrawCollateralApprovalRequired":{"summary":"Prepared compound action with required ERC-20 approval","value":{"data":{"action_id":"act_ecff8589a9724eda9037db8e8c1f2587","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1791829906,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"max_repay_assets":"1000000","resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"authorization","to":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb","data":"0xeecea0000000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000001","value":"0"},{"id":"call_2","kind":"blue_repay_withdraw_collateral","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000007a1200000000000000000000000000000000000000000000000000bdd91f852f5800000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006acd27920000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006acd208b22221111","value":"0"}],"action":"blue.repay","collateral_amount":{"unit":"assets","value":"500000"},"simulation":{"status":"success","block":{"number":"52519380","timestamp":1791828107},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"},{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"500000"}],"position_changes":{"supply_shares":"0","borrow_shares":"-890020071630","collateral_assets":"-500000"},"effects":{"repaid_assets":"1000000","repaid_shares":"890020071630","referral_fee_assets":"0","withdrawn_collateral_assets":"500000","ltv_bps":2501,"max_ltv_bps":8550}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"withdrawCollateralPrepared":{"summary":"Prepared atomic repay and collateral withdrawal","value":{"data":{"action_id":"act_5b4a20d623064100aa107f36c6576b7f","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1792692770,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"all"},"max_repay_assets":"2263979","resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"2263979","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000228bab","value":"0"},{"id":"call_1","kind":"authorization","to":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb","data":"0xeecea0000000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000001","value":"0"},{"id":"call_2","kind":"blue_repay_withdraw_collateral","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000228bab000000000000000000000000000000000000000000000000000000000007a1200000000000000000000000000000000000000000000000000bdd91f852f5800000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ada52220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ada4b1c22221111","value":"0"}],"action":"blue.repay","collateral_amount":{"unit":"assets","value":"500000"},"simulation":{"status":"success","block":{"number":"52950812","timestamp":1792690971},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-2263973"},{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"500000"}],"position_changes":{"supply_shares":"0","borrow_shares":"-2012168105723","collateral_assets":"-500000"},"effects":{"repaid_assets":"2263973","repaid_shares":"2012168105723","referral_fee_assets":"0","withdrawn_collateral_assets":"500000","ltv_bps":0,"max_ltv_bps":8550}},"resolved_amount":{"unit":"shares","value":"2012168105723"}}}},"withdrawCollateralSignatureRequired":{"summary":"Token and Morpho authorization signatures required","value":{"data":{"action_id":"act_c311238cac9040d7a8b4b74e6aa34578","status":"signature_required","action":"blue.repay","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"name":"USD Coin","version":"2","chainId":8453,"verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"message":{"owner":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","spender":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","value":"2260819","nonce":"17","deadline":"1791829909"},"primaryType":"Permit"}},{"id":"signature_1","kind":"authorization","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"},"types":{"Authorization":[{"name":"authorizer","type":"address"},{"name":"authorized","type":"address"},{"name":"isAuthorized","type":"bool"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"message":{"authorizer":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","authorized":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","isAuthorized":true,"nonce":"1","deadline":"1791829909"},"primaryType":"Authorization"}}],"continuation":"eyJhbGciOiJFUzI1NiIsImtpZCI6Im1vcnBoby1hY3Rpb25zLWF0dGVzdG9yLWRldi0xIiwidHlwIjoibW9ycGhvLWFjdGlvbi1jb250aW51YXRpb24rand0In0.eyJpc3MiOiJtb3JwaG8tYWN0aW9ucy1hdHRlc3Rvci1zdGFnaW5nIiwiYXVkIjpbIm1vcnBoby1hY3Rpb25zLWFwaSIsIm1vcnBoby1hY3Rpb25zLWF0dGVzdG9yIl0sInN1YiI6ImFjdGlvbi1jb250aW51YXRpb24iLCJqdGkiOiIxYTc2MWNkOS1lNjg0LTRlYmYtYmE5MS1hYzBlMTk0YzIzOTkiLCJpYXQiOjE3OTE4MjgxMDksImV4cCI6MTc5MTgyOTkwOSwidmVyc2lvbiI6MiwiYWN0aW9uSWQiOiJhY3RfYzMxMTIzOGNhYzkwNDBkN2E4YjRiNzRlNmFhMzQ1NzgiLCJhY3Rpb24iOiJibHVlLnJlcGF5LWFuZC13aXRoZHJhdy1jb2xsYXRlcmFsIiwicG9saWN5VmVyc2lvbiI6ImJsdWUucmVwYXktYW5kLXdpdGhkcmF3LWNvbGxhdGVyYWwvdjEiLCJjaGFpbklkIjo4NDUzLCJhY2NvdW50IjoiMHhFODVmYmM2RjA0NDlhOTJlRjk1OGM1YTQ0RDQ3MTlkZGFDRTk4RDZCIiwidGFyZ2V0IjoiL3YwL2FjdGlvbnMvYmx1ZS9tYXJrZXRzLzg0NTM6MHg5MTAzYzNiNGU4MzQ0NzZjOWE2MmVhMDA5YmEyYzg4NGVlNDJlOTRlNmUzMTRhMjZmMDRkMzEyNDM0MTkxODM2L3JlcGF5LWFuZC13aXRoZHJhdy1jb2xsYXRlcmFsIiwicmVxdWVzdENvbnRlbnRUeXBlIjoiYXBwbGljYXRpb24vanNvbiIsInJlcXVlc3RCb2R5QmFzZTY0dXJsIjoiZXlKaFkyTnZkVzUwSWpvaU1IaEZPRFZtWW1NMlJqQTBORGxoT1RKbFJqazFPR00xWVRRMFJEUTNNVGxrWkdGRFJUazRSRFpDSWl3aWNtVndZWGtpT25zaWRXNXBkQ0k2SW1OdmJYQnNaWFJsSW4wc0ltTnZiR3hoZEdWeVlXeGZZWE56WlhSeklqb2lOVEF3TURBd0lpd2lablZ1WkdsdVp5STZleUp0YjJSbElqb2laWEpqTWpBaWZTd2ljSEpsWm1WeVgzTnBaMjVoZEhWeVpTSTZkSEoxWlgwIiwicmVxdWVzdEJvZHlTaGEyNTYiOiJJZExHcW5MdkdYenQ0elYtbXF1WXVGdWZQQzdKTzZxbmJpaGp6OENKZjlzIiwiZXhwaXJlc0F0IjoxNzkxODI5OTA5LCJyZXF1aXJlbWVudHMiOlt7ImlkIjoic2lnbmF0dXJlXzAiLCJpbmRleCI6MCwidHlwZSI6InNpZ25hdHVyZSIsImtpbmQiOiJwZXJtaXQiLCJoYXNoIjoiSXpmLXc5aE1HM2Q0SU9DQXN3SGZDWnZydlh3WmpUREFhZUdnUHdxb0wtcyIsImV2aWRlbmNlIjp7InR5cGUiOiJzaWduYXR1cmUiLCJpbmRleCI6MCwiaWQiOiJzaWduYXR1cmVfMCIsImtpbmQiOiJwZXJtaXQiLCJzZGtBY3Rpb24iOnsidHlwZSI6InBlcm1pdCIsImFyZ3MiOnsic3BlbmRlciI6IjB4NEQyOEQ5MDBlMzgxZUNFNEIzNTEzMDJmMUFiZTU4ODQ5Njc5M0EyYiIsImFtb3VudCI6IjIyNjA4MTkiLCJkZWFkbGluZSI6IjE3OTE4Mjk5MDkiLCJub25jZSI6IjE3In0sInR5cGVkRGF0YSI6eyJkb21haW4iOnsibmFtZSI6IlVTRCBDb2luIiwidmVyc2lvbiI6IjIiLCJjaGFpbklkIjo4NDUzLCJ2ZXJpZnlpbmdDb250cmFjdCI6IjB4ODMzNTg5ZkNENmVEYjZFMDhmNGM3QzMyRDRmNzFiNTRiZEEwMjkxMyJ9LCJ0eXBlcyI6eyJQZXJtaXQiOlt7Im5hbWUiOiJvd25lciIsInR5cGUiOiJhZGRyZXNzIn0seyJuYW1lIjoic3BlbmRlciIsInR5cGUiOiJhZGRyZXNzIn0seyJuYW1lIjoidmFsdWUiLCJ0eXBlIjoidWludDI1NiJ9LHsibmFtZSI6Im5vbmNlIiwidHlwZSI6InVpbnQyNTYifSx7Im5hbWUiOiJkZWFkbGluZSIsInR5cGUiOiJ1aW50MjU2In1dfSwibWVzc2FnZSI6eyJvd25lciI6IjB4RTg1ZmJjNkYwNDQ5YTkyZUY5NThjNWE0NEQ0NzE5ZGRhQ0U5OEQ2QiIsInNwZW5kZXIiOiIweDREMjhEOTAwZTM4MWVDRTRCMzUxMzAyZjFBYmU1ODg0OTY3OTNBMmIiLCJ2YWx1ZSI6IjIyNjA4MTkiLCJub25jZSI6IjE3IiwiZGVhZGxpbmUiOiIxNzkxODI5OTA5In0sInByaW1hcnlUeXBlIjoiUGVybWl0In19LCJ0eXBlZERhdGEiOnsiZG9tYWluIjp7Im5hbWUiOiJVU0QgQ29pbiIsInZlcnNpb24iOiIyIiwiY2hhaW5JZCI6ODQ1MywidmVyaWZ5aW5nQ29udHJhY3QiOiIweDgzMzU4OWZDRDZlRGI2RTA4ZjRjN0MzMkQ0ZjcxYjU0YmRBMDI5MTMifSwidHlwZXMiOnsiUGVybWl0IjpbeyJuYW1lIjoib3duZXIiLCJ0eXBlIjoiYWRkcmVzcyJ9LHsibmFtZSI6InNwZW5kZXIiLCJ0eXBlIjoiYWRkcmVzcyJ9LHsibmFtZSI6InZhbHVlIiwidHlwZSI6InVpbnQyNTYifSx7Im5hbWUiOiJub25jZSIsInR5cGUiOiJ1aW50MjU2In0seyJuYW1lIjoiZGVhZGxpbmUiLCJ0eXBlIjoidWludDI1NiJ9XX0sIm1lc3NhZ2UiOnsib3duZXIiOiIweEU4NWZiYzZGMDQ0OWE5MmVGOTU4YzVhNDRENDcxOWRkYUNFOThENkIiLCJzcGVuZGVyIjoiMHg0RDI4RDkwMGUzODFlQ0U0QjM1MTMwMmYxQWJlNTg4NDk2NzkzQTJiIiwidmFsdWUiOiIyMjYwODE5Iiwibm9uY2UiOiIxNyIsImRlYWRsaW5lIjoiMTc5MTgyOTkwOSJ9LCJwcmltYXJ5VHlwZSI6IlBlcm1pdCJ9fX0seyJpZCI6InNpZ25hdHVyZV8xIiwiaW5kZXgiOjEsInR5cGUiOiJzaWduYXR1cmUiLCJraW5kIjoiYXV0aG9yaXphdGlvbiIsImhhc2giOiJ0eXpMUmN1aXc1aHF3SjBEY0ktdmFrd29jcHNVODFmMnpiOW04ckt2RVkwIiwiZXZpZGVuY2UiOnsidHlwZSI6InNpZ25hdHVyZSIsImluZGV4IjoxLCJpZCI6InNpZ25hdHVyZV8xIiwia2luZCI6ImF1dGhvcml6YXRpb24iLCJzZGtBY3Rpb24iOnsidHlwZSI6ImF1dGhvcml6YXRpb24iLCJhcmdzIjp7ImF1dGhvcml6ZWQiOiIweDREMjhEOTAwZTM4MWVDRTRCMzUxMzAyZjFBYmU1ODg0OTY3OTNBMmIiLCJpc0F1dGhvcml6ZWQiOnRydWUsImRlYWRsaW5lIjoiMTc5MTgyOTkwOSJ9LCJ0eXBlZERhdGEiOnsiZG9tYWluIjp7ImNoYWluSWQiOjg0NTMsInZlcmlmeWluZ0NvbnRyYWN0IjoiMHhCQkJCQmJiQkJiOWNDNWU5MGUzYjNBZjY0YmRBRjYyQzM3RUVGRkNiIn0sInR5cGVzIjp7IkF1dGhvcml6YXRpb24iOlt7Im5hbWUiOiJhdXRob3JpemVyIiwidHlwZSI6ImFkZHJlc3MifSx7Im5hbWUiOiJhdXRob3JpemVkIiwidHlwZSI6ImFkZHJlc3MifSx7Im5hbWUiOiJpc0F1dGhvcml6ZWQiLCJ0eXBlIjoiYm9vbCJ9LHsibmFtZSI6Im5vbmNlIiwidHlwZSI6InVpbnQyNTYifSx7Im5hbWUiOiJkZWFkbGluZSIsInR5cGUiOiJ1aW50MjU2In1dfSwibWVzc2FnZSI6eyJhdXRob3JpemVyIjoiMHhFODVmYmM2RjA0NDlhOTJlRjk1OGM1YTQ0RDQ3MTlkZGFDRTk4RDZCIiwiYXV0aG9yaXplZCI6IjB4NEQyOEQ5MDBlMzgxZUNFNEIzNTEzMDJmMUFiZTU4ODQ5Njc5M0EyYiIsImlzQXV0aG9yaXplZCI6dHJ1ZSwibm9uY2UiOiIxIiwiZGVhZGxpbmUiOiIxNzkxODI5OTA5In0sInByaW1hcnlUeXBlIjoiQXV0aG9yaXphdGlvbiJ9fSwidHlwZWREYXRhIjp7ImRvbWFpbiI6eyJjaGFpbklkIjo4NDUzLCJ2ZXJpZnlpbmdDb250cmFjdCI6IjB4QkJCQkJiYkJCYjljQzVlOTBlM2IzQWY2NGJkQUY2MkMzN0VFRkZDYiJ9LCJ0eXBlcyI6eyJBdXRob3JpemF0aW9uIjpbeyJuYW1lIjoiYXV0aG9yaXplciIsInR5cGUiOiJhZGRyZXNzIn0seyJuYW1lIjoiYXV0aG9yaXplZCIsInR5cGUiOiJhZGRyZXNzIn0seyJuYW1lIjoiaXNBdXRob3JpemVkIiwidHlwZSI6ImJvb2wifSx7Im5hbWUiOiJub25jZSIsInR5cGUiOiJ1aW50MjU2In0seyJuYW1lIjoiZGVhZGxpbmUiLCJ0eXBlIjoidWludDI1NiJ9XX0sIm1lc3NhZ2UiOnsiYXV0aG9yaXplciI6IjB4RTg1ZmJjNkYwNDQ5YTkyZUY5NThjNWE0NEQ0NzE5ZGRhQ0U5OEQ2QiIsImF1dGhvcml6ZWQiOiIweDREMjhEOTAwZTM4MWVDRTRCMzUxMzAyZjFBYmU1ODg0OTY3OTNBMmIiLCJpc0F1dGhvcml6ZWQiOnRydWUsIm5vbmNlIjoiMSIsImRlYWRsaW5lIjoiMTc5MTgyOTkwOSJ9LCJwcmltYXJ5VHlwZSI6IkF1dGhvcml6YXRpb24ifX19XX0.lzq-PlYRIXWdcmZsW0Sc85AhXpk8rtc4pseN1PkLOHfJxxVOJP8gkZ5j-EmzLi-uNKF3g0QIgsLO2n1pAAb9ow","expires_at":1791829909}}},"withdrawCollateralExactShares":{"summary":"Prepared exact-share compound repayment","value":{"data":{"action_id":"act_9fc8ce3a85304582a20d6a2922f96541","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1791829907,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"shares","value":"900000"},"max_repay_assets":"2","resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"2","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000002","value":"0"},{"id":"call_1","kind":"authorization","to":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb","data":"0xeecea0000000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000001","value":"0"},{"id":"call_2","kind":"blue_repay_withdraw_collateral","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbba00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000007a1200000000000000000000000000000000000000000000000000bdd91f852f5800000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006acd27930000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006acd208c22221111","value":"0"}],"action":"blue.repay","collateral_amount":{"unit":"assets","value":"500000"},"simulation":{"status":"success","block":{"number":"52519381","timestamp":1791828109},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-2"},{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"500000"}],"position_changes":{"supply_shares":"0","borrow_shares":"-900000","collateral_assets":"-500000"},"effects":{"repaid_assets":"2","repaid_shares":"900000","referral_fee_assets":"0","withdrawn_collateral_assets":"500000","ltv_bps":2501,"max_ltv_bps":8550}},"resolved_amount":{"unit":"shares","value":"900000"}}}},"withdrawCollateralAll":{"summary":"Prepared full compound repayment","value":{"data":{"action_id":"act_5b4a20d623064100aa107f36c6576b7f","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1792692770,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"all"},"max_repay_assets":"2263979","resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"2263979","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000228bab","value":"0"},{"id":"call_1","kind":"authorization","to":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb","data":"0xeecea0000000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000001","value":"0"},{"id":"call_2","kind":"blue_repay_withdraw_collateral","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000228bab000000000000000000000000000000000000000000000000000000000007a1200000000000000000000000000000000000000000000000000bdd91f852f5800000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ada52220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ada4b1c22221111","value":"0"}],"action":"blue.repay","collateral_amount":{"unit":"assets","value":"500000"},"simulation":{"status":"success","block":{"number":"52950812","timestamp":1792690971},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-2263973"},{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"500000"}],"position_changes":{"supply_shares":"0","borrow_shares":"-2012168105723","collateral_assets":"-500000"},"effects":{"repaid_assets":"2263973","repaid_shares":"2012168105723","referral_fee_assets":"0","withdrawn_collateral_assets":"500000","ltv_bps":0,"max_ltv_bps":8550}},"resolved_amount":{"unit":"shares","value":"2012168105723"}}}},"withdrawCollateralReferralFee":{"summary":"Prepared compound repayment with a referral fee","value":{"data":{"action_id":"act_209cdb6ca0024dedbef384335ea8c2cc","status":"prepared","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":1791829970,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"max_repay_assets":"1010101","referral_fee":{"bps":100,"recipient":"0x3000000000000000000000000000000000000003"},"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1010101","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b00000000000000000000000000000000000000000000000000000000000f69b5","value":"0"},{"id":"call_1","kind":"authorization","to":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb","data":"0xeecea0000000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000001","value":"0"},{"id":"call_2","kind":"blue_repay_withdraw_collateral","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f69b5000000000000000000000000000000000000000000000000000000000007a1200000000000000000000000000000000000000000000000000bdd91f852f58000000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000003000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000006acd27d20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006acd20cb22221111","value":"0"}],"action":"blue.repay","collateral_amount":{"unit":"assets","value":"500000"},"simulation":{"status":"success","block":{"number":"52519412","timestamp":1791828171},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1010101"},{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"500000"}],"position_changes":{"supply_shares":"0","borrow_shares":"-890019981439","collateral_assets":"-500000"},"effects":{"repaid_assets":"1000000","repaid_shares":"890019981439","referral_fee_assets":"10101","withdrawn_collateral_assets":"500000","ltv_bps":2501,"max_ltv_bps":8550}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"withdrawCollateralFailedSimulation":{"summary":"A rejected compound simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"blue.repay","chain_id":8453,"account":"0xE85fbc6F0449a92eF958c5a44D4719ddaCE98D6B","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"max_repay_assets":"1000000","collateral_amount":{"unit":"assets","value":"500000"},"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}}},"schema":{"$ref":"#/components/schemas/BlueRepayResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRepay400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRepay403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Morpho Blue market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"marketNotFound":{"summary":"The Morpho Blue market does not exist on this chain","description":"The selected Morpho Blue market was not found on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","message":"The Morpho Blue market does not exist on this chain.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRepay404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRepay413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The repayment, funding mode, position, continuation, or signature requirement is unsupported. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Morpho Blue repayments.","details":null,"request_id":"req_0123456789abcdef"}}},"fundingUnsupported":{"summary":"The native funding cap cannot fund this action","description":"Retry with ERC-20 funding by setting `funding.type` to `erc20`, or select `native`/`auto` with a cap covering the full action amount.","value":{"error":{"code":"FUNDING_UNSUPPORTED","message":"Unsupported funding mode.","details":[{"code":"custom","message":"The native funding cap is below the action amount","path":["funding","max_native_assets"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRepay422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueRepay500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"Chain state is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueRepay503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/blue/markets/{market-selector}/supply-collateral":{"post":{"operationId":"buildBlueSupplyCollateral","tags":["Blue"],"summary":"Blue Supply Collateral Asset","description":"Supply an exact amount of collateral assets to an existing Morpho Blue market. The API builds and simulates the wallet calls.\n\nUse `signature_mode` to select prerequisite approval calls or automatic ERC-2612 signature selection. For wrapped-native collateral, set `funding.type` to `native`, `erc20`, or balance-based `auto`. The API does not support mixed ERC-20 and native funding.","parameters":[{"schema":{"$ref":"#/components/schemas/MarketSelectorUsdcWeth"},"required":true,"description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"erc20":{"summary":"Supply collateral with ERC-20 funding","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"}}},"nativeFunding":{"summary":"Fund the collateral with native currency","description":"Available when the selected market collateral is the chain's registered wrapped-native asset.","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"native","max_native_assets":"1000000"}}},"autoFunding":{"summary":"Select collateral funding from the wallet balance","description":"Available when the selected market collateral is the chain's registered wrapped-native asset.","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"auto","max_native_assets":"1000000"}}},"continuation":{"summary":"Continue with the collected token signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}}},"schema":{"$ref":"#/components/schemas/BlueSupplyCollateralRequest"}}}},"responses":{"200":{"description":"A token signature request or prepared collateral-supply calls with simulation results.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared collateral supply","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791475548,"market":{"id":"0x8793cf302b8ffd655ab97bd1c695dbd967807e8367a65cb2f4edaf1380ba1bda","collateral_asset":{"address":"0x4200000000000000000000000000000000000006"}},"amount":{"unit":"assets","value":"1000000"},"resolved_funding":{"wrapped_asset":"0x4200000000000000000000000000000000000006","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x4200000000000000000000000000000000000006","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"blue_supply_collateral","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xb1268765000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000004200000000000000000000000000000000000006000000000000000000000000fea2d58cefcb9fcb597723c6bae66ffe4193afe400000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac7bf5c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac7a33e22221111","value":"0"}],"action":"blue.supply_collateral","simulation":{"status":"success","block":{"number":"52339502","timestamp":1791468351},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"-1000000"}],"position_changes":{"supply_shares":"0","borrow_shares":"0","collateral_assets":"1000000"},"effects":{"supplied_collateral_assets":"1000000"}}}}},"nativeFunding":{"summary":"Prepared native-funded collateral supply","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1791824588,"market":{"id":"0x8793cf302b8ffd655ab97bd1c695dbd967807e8367a65cb2f4edaf1380ba1bda","collateral_asset":{"address":"0x4200000000000000000000000000000000000006"}},"amount":{"unit":"assets","value":"1000000"},"calls":[{"id":"call_0","kind":"blue_supply_collateral","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xb1268765000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000004200000000000000000000000000000000000006000000000000000000000000fea2d58cefcb9fcb597723c6bae66ffe4193afe400000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006acd12cc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006acd0bc522221111","value":"1000000"}],"action":"blue.supply_collateral","resolved_funding":{"wrapped_asset":"0x4200000000000000000000000000000000000006","max_native_assets":"1000000","erc20_assets":"0","native_assets":"1000000"},"simulation":{"status":"success","block":{"number":"52516721","timestamp":1791822789},"wallet_changes":[{"asset":{"type":"native"},"difference":"-1000000"}],"position_changes":{"supply_shares":"0","borrow_shares":"0","collateral_assets":"1000000"},"effects":{"supplied_collateral_assets":"1000000"}}}}},"failedSimulation":{"summary":"Collateral supply simulation failed","description":"The wallet does not have enough balance to supply the requested collateral.","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791475548,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000000000"},"resolved_funding":{"wrapped_asset":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf","max_native_assets":"0","erc20_assets":"1000000000000","native_assets":"0"},"action":"blue.supply_collateral","simulation":{"status":"failed","failure":{"code":"INSUFFICIENT_BALANCE","message":"The account balance is insufficient.","call_id":"call_1"}}}}}},"schema":{"$ref":"#/components/schemas/BlueSupplyCollateralResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupplyCollateral400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupplyCollateral403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Morpho Blue market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"marketNotFound":{"summary":"The Morpho Blue market does not exist on this chain","description":"The selected Morpho Blue market was not found on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","message":"The Morpho Blue market does not exist on this chain.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupplyCollateral404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupplyCollateral413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The chain, funding mode, continuation, or signature requirement is unsupported. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Morpho Blue collateral actions.","details":null,"request_id":"req_0123456789abcdef"}}},"fundingUnsupported":{"summary":"The native funding cap cannot fund this action","description":"Retry with ERC-20 funding by setting `funding.type` to `erc20`, or select `native`/`auto` with a cap covering the full action amount.","value":{"error":{"code":"FUNDING_UNSUPPORTED","message":"Unsupported funding mode.","details":[{"code":"custom","message":"The native funding cap is below the action amount","path":["funding","max_native_assets"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupplyCollateral422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueSupplyCollateral500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"Chain state is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupplyCollateral503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/blue/markets/{market-selector}/withdraw-collateral":{"post":{"operationId":"buildBlueWithdrawCollateral","tags":["Blue"],"summary":"Blue Withdraw Collateral Asset","description":"Build and simulate wallet calls to withdraw an exact collateral asset amount from a Morpho Blue market. The API uses the wallet's accrued position. The withdrawal keeps a safety margin below the market's liquidation loan-to-value. Any `signature_mode` other than `none` requests Morpho authorization typed data instead of an authorization call when available.\n\nBefore POST, read the market user position from the Morpho Read API (`/v0/blue/markets/{market}/users/{user}/position`): `max_withdraw_collateral_assets` for an assets quote; no `all` mode is supported. `null` means the price-dependent limit is unknown or unavailable: do not send it as an amount. When the position has debt, the quote uses the market's exact liquidation loan-to-value while the API keeps a safety margin below it, so the API can reject amounts at or near the quote: leave headroom. With no debt, a positive quote is the full collateral balance and can be sent as is. A quote of `0` cannot be sent as an amount. The quote is a snapshot: the API reads live state when it builds the action, so a quoted amount can become unavailable.","parameters":[{"schema":{"$ref":"#/components/schemas/MarketSelectorUsdcCbBtc"},"required":true,"description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Withdraw an exact collateral amount","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"}}},"authorizationSignature":{"summary":"Request Morpho authorization","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"signature_mode":"auto"}},"continuation":{"summary":"Continue with the collected authorization","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawCollateralRequest"}}}},"responses":{"200":{"description":"A Morpho authorization request or prepared collateral-withdrawal calls with simulation results.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared collateral withdrawal","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"action":"blue.withdraw_collateral","calls":[{"id":"call_0","kind":"blue_withdraw_collateral","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0x827d6bd8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f4240ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b2800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"},"difference":"1000000"}],"position_changes":{"supply_shares":"0","borrow_shares":"0","collateral_assets":"-1000000"},"effects":{"withdrawn_collateral_assets":"1000000","ltv_bps":2501,"max_ltv_bps":8550}}}}},"failedSimulation":{"summary":"Collateral withdrawal simulation failed","description":"The collateral withdrawal would revert in simulation; do not execute it.","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","collateral_asset":{"address":"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"}},"amount":{"unit":"assets","value":"1000000"},"action":"blue.withdraw_collateral","simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}}}}},"signatureRequired":{"summary":"Morpho authorization signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"blue.withdraw_collateral","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","signatures":[{"id":"signature_0","kind":"authorization","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"},"types":{"Authorization":[{"name":"authorizer","type":"address"},{"name":"authorized","type":"address"},{"name":"isAuthorized","type":"bool"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"message":{"authorizer":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","authorized":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","isAuthorized":true,"nonce":"0","deadline":"1791824586"},"primaryType":"Authorization"}}],"continuation":"continuation_from_previous_response","expires_at":1791824586}}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawCollateralResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawCollateral400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawCollateral403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Morpho Blue market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"marketNotFound":{"summary":"The Morpho Blue market does not exist on this chain","description":"The selected Morpho Blue market was not found on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","message":"The Morpho Blue market does not exist on this chain.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawCollateral404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawCollateral413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The chain, position, continuation, or signature requirement is unsupported. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Morpho Blue collateral actions.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawCollateral422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueWithdrawCollateral500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"Chain state is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawCollateral503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/blue/markets/{market-selector}/supply":{"post":{"operationId":"buildBlueSupply","tags":["Blue"],"summary":"Blue Supply Loan Asset","description":"Supply an exact gross amount of loan assets to an existing Morpho Blue market. The API builds and simulates the wallet calls.\n\nUse `signature_mode` to select prerequisite approval calls or automatic ERC-2612 signature selection.\n\nFor wrapped-native markets, set `funding.type` to `native` to require native currency. Set it to `erc20` to require the token. Set it to `auto` to select from the current wrapped-token balance. The API does not support mixed funding.","parameters":[{"schema":{"$ref":"#/components/schemas/MarketSelectorUsdcCbBtc"},"required":true,"description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Supply an exact gross loan asset amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"}}},"nativeFunding":{"summary":"Supply an exact amount with native currency","description":"Available when the selected market loan asset is the chain's registered wrapped-native asset.","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"native","max_native_assets":"1000000"}}},"autoFunding":{"summary":"Select supply funding from the wallet balance","description":"Available when the selected market loan asset is the chain's registered wrapped-native asset.","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"auto","max_native_assets":"1000000"}}},"referralFee":{"summary":"Supply with a referral fee","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"}}},"continuation":{"summary":"Continue on this endpoint with the collected signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}},"signatureMode":{"summary":"Automatically select ERC-2612 signatures or approval calls","value":{"signature_mode":"auto","account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"}}}},"schema":{"$ref":"#/components/schemas/BlueSupplyRequest"}}}},"responses":{"200":{"description":"A signature request or prepared, simulated supply calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"approvalRequired":{"summary":"Prepared supply with required ERC-20 approval","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.supply","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461744,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"blue_supply","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xa4d5ece4000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac789700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac76d5122221111","value":"0"}],"simulation":{"status":"success","block":{"number":"52332599","timestamp":1791454545},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"supply_shares":"902138537700","borrow_shares":"0","collateral_assets":"0"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}}}}},"allowanceSufficient":{"summary":"Prepared supply using the existing allowance","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.supply","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"blue_supply","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xa4d5ece4000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac7919422221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"supply_shares":"900000","borrow_shares":"0","collateral_assets":"0"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}}}}},"signatureRequired":{"summary":"Typed-data signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"blue.supply","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"name":"USD Coin","version":"2","chainId":8453,"verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"message":{"owner":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","spender":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","value":"1000000","nonce":"106","deadline":"1791455115"},"primaryType":"Permit"}}],"continuation":"continuation_from_previous_response","expires_at":1791455115}}},"referralFee":{"summary":"Prepared supply with a referral fee","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.supply","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461745,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"blue_supply","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xa4d5ece4000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000008e1bc9bf040000000000000000000000000003000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000006ac789710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac76d5222221111","value":"0"}],"simulation":{"status":"success","block":{"number":"52332599","timestamp":1791454545},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"supply_shares":"899883191355","borrow_shares":"0","collateral_assets":"0"},"effects":{"gross_assets":"1000000","referral_fee_assets":"2500","net_assets":"997500"}}}}},"continuation":{"summary":"Prepared supply after the signature continuation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.supply","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"blue_supply","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xa4d5ece4000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000ee6b2800000000000000000000000000000000000000000000000000000000000000001c16de6fa02e4c4df40e260cd99680a557c302ce77537af9a3de5d8d727e7d75c91c2320eba6d8518f47db4e72d6f4f850b32745dcf2d20428f37baeba0e772eac","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"supply_shares":"900000","borrow_shares":"0","collateral_assets":"0"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}}}}},"failedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"blue.supply","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}}}}}},"schema":{"$ref":"#/components/schemas/BlueSupplyResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupply400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupply403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Morpho Blue market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"marketNotFound":{"summary":"The Morpho Blue market does not exist on this chain","description":"The selected Morpho Blue market was not found on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","message":"The Morpho Blue market does not exist on this chain.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupply404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupply413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The supply intent, chain, or funding mode is unsupported. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Morpho Blue supply.","details":null,"request_id":"req_0123456789abcdef"}}},"fundingUnsupported":{"summary":"The native funding cap cannot fund this action","description":"Retry with ERC-20 funding by setting `funding.type` to `erc20`, or select `native`/`auto` with a cap covering the full action amount.","value":{"error":{"code":"FUNDING_UNSUPPORTED","message":"Unsupported funding mode.","details":[{"code":"custom","message":"The native funding cap is below the action amount","path":["funding","max_native_assets"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupply422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueSupply500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"Chain state is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueSupply503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/blue/markets/{market-selector}/withdraw":{"post":{"operationId":"buildBlueWithdraw","tags":["Blue"],"summary":"Blue Withdraw Loan Asset","description":"Build and simulate wallet calls to withdraw from a Morpho Blue market. Withdraw an exact loan asset amount, burn an exact number of supply shares, or withdraw the maximum available amount. When the market lacks liquidity, the withdrawal can obtain liquidity from other markets through Morpho shared liquidity.\n\n`all` burns the full share balance when the market alone can cover the position. This includes interest that accrues before execution. Otherwise, it withdraws an assets amount, which can leave a small residual position. If market and shared liquidity cannot cover the position, it withdraws only the available amount. The rest remains supplied.\n\nAny `signature_mode` other than `none` requests Morpho authorization typed data instead of an authorization call when available.\n\nBefore POST, read the market user position from the Morpho Read API (`/v0/blue/markets/{market}/users/{user}/position`): `max_withdraw_assets` with `max_withdraw_limited_by` for an assets quote. The bound is position when supplied assets are less than or equal to market liquidity (ties including 0/0), otherwise market_liquidity. Market liquidity is total supply minus total borrow, floored at zero. The quote covers this market alone. It excludes liquidity that the withdrawal can obtain from other markets through shared liquidity, so the API's result can differ from the quote. The quote is also a snapshot: the API reads live state when it builds the action, so a quoted amount can become unavailable.","parameters":[{"schema":{"$ref":"#/components/schemas/MarketSelectorUsdcCbBtc"},"required":true,"description":"Morpho Blue market selector formatted as <chain_id>:<market_id>. The chain ID is at most 9007199254740991.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"assets":{"summary":"Withdraw an exact gross loan asset amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"}}},"shares":{"summary":"Burn an exact supply-share amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"shares","value":"900000"}}},"completeWithSignature":{"summary":"Withdraw the maximum available with Morpho authorization","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"all"},"signature_mode":"auto"}},"continuation":{"summary":"Continue on this endpoint with the collected signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawRequest"}}}},"responses":{"200":{"description":"A Morpho authorization signature request or prepared, simulated withdrawal calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"authorized":{"summary":"Prepared using an existing Morpho authorization","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.withdraw","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"calls":[{"id":"call_0","kind":"blue_withdraw","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xc0229fe8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"supply_shares":"-900000","borrow_shares":"0","collateral_assets":"0"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"authorizationRequired":{"summary":"Prepared with a Morpho authorization prerequisite","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.withdraw","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"calls":[{"id":"call_0","kind":"authorization","to":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb","data":"0xeecea0000000000000000000000000004d28d900e381ece4b351302f1abe588496793a2b0000000000000000000000000000000000000000000000000000000000000001","value":"0"},{"id":"call_1","kind":"blue_withdraw","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xc0229fe8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"supply_shares":"-900000","borrow_shares":"0","collateral_assets":"0"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"signatureRequired":{"summary":"Morpho authorization signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"blue.withdraw","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","signatures":[{"id":"signature_0","kind":"authorization","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"},"types":{"Authorization":[{"name":"authorizer","type":"address"},{"name":"authorized","type":"address"},{"name":"isAuthorized","type":"bool"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Authorization","message":{"authorizer":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","authorized":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","isAuthorized":true,"nonce":"0","deadline":"4000000000"}}}],"continuation":"continuation_from_previous_response","expires_at":4000000000}}},"all":{"summary":"Prepared withdrawal of the maximum available amount","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"blue.withdraw","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"all"},"calls":[{"id":"call_0","kind":"blue_withdraw","to":"0x4D28D900e381eCE4B351302f1Abe588496793A2b","data":"0xc0229fe8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"supply_shares":"-900000","borrow_shares":"0","collateral_assets":"0"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}},"resolved_amount":{"unit":"shares","value":"900000"}}}},"failedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"blue.withdraw","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}}},"schema":{"$ref":"#/components/schemas/BlueWithdrawResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdraw400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdraw403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Morpho Blue market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"marketNotFound":{"summary":"The Morpho Blue market does not exist on this chain","description":"The selected Morpho Blue market was not found on this chain.","value":{"error":{"code":"MARKET_NOT_FOUND","message":"The Morpho Blue market does not exist on this chain.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdraw404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdraw413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The withdrawal, chain, position, continuation, or signature requirement is unsupported. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Morpho Blue withdrawals.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdraw422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueWithdraw500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"Chain state is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/BlueWithdraw503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/markets/{market-selector}/repay":{"post":{"operationId":"buildMidnightRepay","tags":["Midnight"],"summary":"Midnight Repay","description":"Build calls to repay Midnight debt with one of two methods selected by `type`:\n- `direct` repays exact loan assets at face value now, or the complete debt with `amount: { \"unit\": \"all\" }`. It needs no offers or price guard. It rejects rate guards.\n- `market` purchases the debt from the market's open offers, possibly below face value. It requires a `guard`. Use `slippage`, or `min_rate` for a minimum simple rate per second with WAD scaling. Alternatively, use `min_units` for an assets amount or `max_assets` for a units amount.\n\n`collateral_withdrawals` can withdraw collateral in the same action with either method. Wrapped-native debt supports ERC-20, native, and balance-based auto funding.","parameters":[{"schema":{"$ref":"#/components/schemas/MidnightMarketSelector"},"required":true,"description":"Midnight market selector formatted as <chain_id>:<market_id>. Send the colon literally or as %3A.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Repay exact assets with ERC-20 funding","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","type":"direct","amount":{"unit":"assets","value":"1000000"},"funding":{"type":"erc20"}}},"completeAuto":{"summary":"Repay the full debt from wrapped-native balance, then native currency","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","type":"direct","amount":{"unit":"all"},"funding":{"type":"auto","max_native_assets":"250000"}}},"completeNative":{"summary":"Repay the full debt with native currency","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","type":"direct","amount":{"unit":"all"},"funding":{"type":"native","max_native_assets":"1000000"}}}},"schema":{"$ref":"#/components/schemas/MidnightRepayRequest"}}}},"responses":{"200":{"description":"Prepared, simulated Midnight repayment calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"exactAssets":{"summary":"Prepared exact-assets repayment","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}]},"action":"midnight.repay","amount":{"unit":"assets","value":"1000000"},"collateral_withdrawals":[],"resolved_funding":{"wrapped_asset":"0x4200000000000000000000000000000000000006","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"repay_and_withdraw_collateral","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0x934a8ebb00000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000003e00000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"-1000000"}],"position_changes":{"debt_units":"-1000000","collaterals":[]},"effects":{"repaid_assets":"1000000","withdrawn_collaterals":[]}},"resolved_amount":{"unit":"assets","value":"1000000"}}}}},"schema":{"$ref":"#/components/schemas/MidnightRepayResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightRepay400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightRepay403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightRepay404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightRepay413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The action, position, collateral selection, or funding mode is unsupported. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightRepay422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightRepay500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The Midnight action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightRepay503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/markets/{market-selector}/supply-collateral":{"post":{"operationId":"buildMidnightSupplyCollateral","tags":["Midnight"],"summary":"Midnight Supply Collateral","description":"Build and simulate a collateral supply to one configured Midnight collateral. Accepts one ERC-20 collateral and optional `funding` (`erc20`, `native`, or `auto`; omitting `funding` defaults to direct ERC-20 supply). It does not support signature continuations.\n\nWhen funded strictly with ERC-20 (`funding` omitted, `funding.type: erc20`, or `funding.type: auto` with sufficient wrapped-native balance or non-wrapped collateral), the action prepares a direct `supply_collateral` call with no on-chain deadline; `expires_at` specifies when the off-chain response expires.\n\nWhen native currency funds part or all of a wrapped-native collateral supply (`funding.type: native`, or `funding.type: auto` when the wrapped-native balance is below the supplied amount), the action prepares a payable `supply_collateral_with_native` call with `expires_at` as its on-chain deadline and any required approval and authorization calls. Native funding requires the collateral to be the chain's wrapped-native token; otherwise, the API returns 400 VALIDATION_FAILED (including on chains without a wrapped-native token).","parameters":[{"schema":{"$ref":"#/components/schemas/MidnightMarketSelector"},"required":true,"description":"Midnight market selector formatted as <chain_id>:<market_id>. Send the colon literally or as %3A.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"erc20":{"summary":"Direct ERC-20 collateral supply","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"amount":{"unit":"assets","value":"1000000"}}},"native":{"summary":"Native-funded wrapped-native collateral supply (requires a market with WETH collateral)","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","collateral":{"address":"0x4200000000000000000000000000000000000006"},"amount":{"unit":"assets","value":"1000000"},"funding":{"type":"native","max_native_assets":"1000000"}}}},"schema":{"$ref":"#/components/schemas/MidnightSupplyCollateralRequest"}}}},"responses":{"200":{"description":"Prepared and simulated Midnight collateral-supply calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"supplied":{"summary":"Prepared direct collateral supply","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}]},"action":"midnight.supply_collateral","max_collateral_approval_assets":"1000000","calls":[{"id":"call_0","kind":"supply_collateral","to":"0xAdedD8ab6dE832766Fedf0FaC4992E5C4D3EA18A","data":"0x32292d960000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf20000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c0","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"difference":"-1000000"}],"position_changes":{"collaterals":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"difference":"1000000"}]},"effects":{"supplied_collaterals":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"assets":"1000000"}]}},"collateral_supplies":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"amount":{"unit":"assets","value":"1000000"}}]}}}},"schema":{"$ref":"#/components/schemas/MidnightSupplyCollateralResponse"}}}},"400":{"description":"The request is malformed, carries unsupported fields, or requests native funding without a wrapped-native collateral supply. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightSupplyCollateral400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightSupplyCollateral403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightSupplyCollateral404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightSupplyCollateral413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The action, position, collateral selection, or funding mode is unsupported. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightSupplyCollateral422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightSupplyCollateral500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The Midnight action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightSupplyCollateral503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/markets/{market-selector}/borrow":{"post":{"operationId":"buildMidnightBorrow","tags":["Midnight"],"summary":"Midnight Borrow","description":"Build and simulate a borrow against the selected market's open offers. Use an exact loan asset amount (`unit: assets`) or an exact debt-unit amount (`unit: units`). Debt units are borrow-side units. One debt unit is redeemable for one loan asset base unit at market maturity.\n\nSet `guard` to one of these values:\n- `slippage`, relative to the API quote.\n- `max_rate`, for a maximum simple rate per second with WAD scaling.\n- `max_units` for an assets amount, or `min_assets` for a units amount. These are absolute bounds.\n\nWith slippage, the guarded seller price cannot fall below the price implied by a 100% fixed APR to maturity. The API rejects quotes below that floor. When `referral_fee` is present, its recipient must differ from the wallet that borrows.\n\nAdd `collateral_supplies` and `funding` to supply one or more configured collaterals in the same atomic action. Native or automatic funding applies only to the wrapped-native collateral portion. All other collateral uses ERC-20 funding. Native funding requires supplied collateral that is the chain's wrapped-native token. Otherwise, the API returns 400 VALIDATION_FAILED, including on chains without a wrapped-native token. On chains with a wrapped-native token, the API accepts automatic funding even without supplied wrapped-native collateral.","parameters":[{"schema":{"$ref":"#/components/schemas/MidnightMarketSelector"},"required":true,"description":"Midnight market selector formatted as <chain_id>:<market_id>. Send the colon literally or as %3A.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"assets":{"summary":"Borrow an exact loan asset amount","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50}}},"unitsWithReferral":{"summary":"Borrow exact debt units with a referral fee","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"units","value":"1000000"},"guard":{"type":"slippage","bps":50},"referral_fee":{"bps":10,"recipient":"0x545b6Cc751F0C47C202694cf835db2E3C071400A"}}},"supplyCollateralMultiCollateral":{"summary":"Supply two collaterals and borrow exact assets","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","collateral_supplies":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"amount":{"unit":"assets","value":"1000000"}},{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"amount":{"unit":"assets","value":"500000"}}],"amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50},"funding":{"type":"erc20"}}}},"schema":{"$ref":"#/components/schemas/MidnightBorrowRequest"}}}},"responses":{"200":{"description":"Prepared, quoted, and simulated Midnight borrow calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"borrowed":{"summary":"Prepared exact-assets borrow","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}]},"action":"midnight.borrow","amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50},"quote":{"average_best_price_wad":"999701089374277091","average_worst_price_wad":"994702583927405705","available_assets":"1000000","available_units":"1000299","offer_count":1},"max_borrow_units":"1005326","calls":[{"id":"call_0","kind":"borrow","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0xca7de09c000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f570e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf2000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000f436b00000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000200000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e8480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"1000000"}],"position_changes":{"credit_units":"0","debt_units":"1000299"},"effects":{"borrowed_assets":"1000000","borrowed_units":"1000299","referral_fee_assets":"0"}},"collateral_supplies":[]}}},"supplyCollateralSuppliedAndBorrowed":{"summary":"Prepared multi-collateral supply and borrow","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}]},"action":"midnight.borrow","amount":{"unit":"units","value":"1000000"},"guard":{"type":"slippage","bps":50},"quote":{"average_best_price_wad":"999701000000000000","average_worst_price_wad":"994702495000000000","available_assets":"999701","available_units":"1000000","offer_count":1},"max_borrow_units":"1000000","collateral_approvals":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"assets":"1000000"},{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"assets":"500000"}],"resolved_funding":{"wrapped_asset":"0x4200000000000000000000000000000000000006","max_native_assets":"0","erc20_assets":"0","native_assets":"0"},"calls":[{"id":"call_0","kind":"supply_collateral_and_borrow","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0xad43ff97000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f2d8e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf200000000000000000000000000000000000000000000000000000000000003800000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000200000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e8480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"999701"},{"asset":{"type":"erc20","address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"difference":"-1000000"},{"asset":{"type":"erc20","address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"difference":"-500000"}],"position_changes":{"credit_units":"0","debt_units":"1000000","collaterals":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"difference":"1000000"},{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"difference":"500000"}]},"effects":{"borrowed_assets":"999701","borrowed_units":"1000000","referral_fee_assets":"0","supplied_collaterals":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"assets":"1000000"},{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"assets":"500000"}]}},"collateral_supplies":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"amount":{"unit":"assets","value":"1000000"}},{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"amount":{"unit":"assets","value":"500000"}}]}}}},"schema":{"$ref":"#/components/schemas/MidnightBorrowResponse"}}}},"400":{"description":"The request is malformed, carries unsupported fields, or requests native funding without a wrapped-native collateral supply. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightBorrow400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightBorrow403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightBorrow404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightBorrow413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The action, position, collateral selection, funding mode, or verification is unsupported. Alternatively, one of these conditions applies:\n- The quote is stale or insufficient. QUOTE_INSUFFICIENT means that the API cannot fill the requested amount within the 75-offer quote limit or the price guard.\n- The wallet cannot fill any quoted offer. OFFER_NOT_FILLABLE means that the quote has no offer the wallet can fill. For example, every offer is the wallet's own, has zero units, or has a zero price.\n- The prepared action exceeds the complexity limit. ACTION_TOO_COMPLEX indicates take calldata above 110,000 bytes.\n\nRelevant outcomes include POSITION_EMPTY, POSITION_INSUFFICIENT, COLLATERAL_UNSUPPORTED, QUOTE_STALE, QUOTE_INSUFFICIENT, OFFER_NOT_FILLABLE, ACTION_TOO_COMPLEX, and VERIFICATION_REJECTED. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightBorrow422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightBorrow500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The quote source, action verification, or simulation dependency is unavailable. Alternatively, the quote source returned a malformed, reordered, or mismatched quote. Relevant quote outcomes include QUOTE_UNAVAILABLE, QUOTE_INVALID, QUOTE_ORDER_INVALID, and QUOTE_MARKET_MISMATCH. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightBorrow503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/offers/borrow":{"post":{"operationId":"buildMidnightMakeBorrow","tags":["Midnight"],"summary":"Midnight Make Borrow Offer","description":"Build and simulate the calls that publish a public set of borrow offers. `offers.type` determines the price: `price` specifies a fixed price per unit, and `rate` specifies an interest rate. Price offers require a nonzero tick. Tick 0 returns 422 `ACTION_UNSUPPORTED`.\n\nEntries can target different markets on one chain when every market uses the same loan asset. Each offer must expire by its market maturity. Each offer has the requested loan asset cap. Fills across all offers in the group count toward one shared total. The group cannot fill more than that cap.\n\nFor an entry market that does not yet exist, include its parameters in `market_params`. Otherwise, the route returns 404 `MARKET_NOT_FOUND`. With `p2p: true`, the maker intends to share the offer directly with a taker. The API does not check it against the public offer book's admission rules.\n\nWhen `collateral_supplies` is present, the action supplies the collaterals atomically. Offer publication does not move loan assets.","requestBody":{"required":true,"content":{"application/json":{"example":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","chain_id":8453,"amount":{"unit":"assets","value":"1000000"},"offers":{"type":"price","entries":[{"market_id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","tick":"5000","starts_at":0,"expires_at":1793000000}]}},"schema":{"$ref":"#/components/schemas/MidnightOffersBorrowRequest"}}}},"responses":{"200":{"description":"Prepared and simulated Midnight borrow-offer publication calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared price-based borrow-offer publication","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"midnight.make_borrow","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"offer":{"groups":["0xd2420823311ff567933f4c50fb0a2c34744096f50204ac38dfc896f0ed808b4f"],"entry_count":1},"calls":[{"id":"call_0","kind":"cancel_and_publish","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0xb4691380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000008a0e69772315652165921d722b3caaea4c326e695dbdc4799df6cf7061479c7e4727794ed50ea5ec605b596fbda8f764b3af8e300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017e01000001791f8b08000000000000036360c00b14f04b3330129027a4df01bf344b0201eb1f10301f0564ed9ef57af2cbf52c276efed56ed99fb3e2ede1579f48d18f61de7d2602ee17eeb8e4c4a16c28ff357db2bd4fc06f2e1d931287695f9958d658dc3f31edc3db866e7f4aec67606041750f01ff712c7836bdc8302c482c52f1bad2e653eb961c567b4699fd0400bf1381f02104145991796bdfde589dfbc2a82cffed875f4766eac5f8da2dec429677c234800dbff9f8936fd6930d1f70c99937dd3a3777027ed3a9009890395a8f3fbea9970f103aff6a8344f49faac5e779df28e1d2c82b1b50e7b0af01a7c12c9a173225e6a18a6db0085d1bf537bb7707a7ecd55099357ed7146fa2a48f5fa5bc1738e7adddaeeb20e472aff85c75e7db9ffc38ed9fb9e2dcf147b83d86cdfe05fa49330af7995ebbcddf71d2e5fcd4d09037ed07709b40145830f5f61df799f773beb389541e7f52543ee56dc0abb863ac5ba7fdbed55fe66df5e33185e6e30e6022010058bffc93800500000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[],"position_changes":{},"effects":{"groups":["0xd2420823311ff567933f4c50fb0a2c34744096f50204ac38dfc896f0ed808b4f"],"entry_count":1}}}}}},"schema":{"$ref":"#/components/schemas/MidnightOffersBorrowResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeBorrow400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightMakeBorrow403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeBorrow404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeBorrow413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The offers, selected markets, pricing, offer lifetime, or cancellation set is unsupported. Relevant outcomes include ACTION_UNSUPPORTED, ACTION_TOO_COMPLEX, and VERIFICATION_REJECTED. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightMakeBorrow422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeBorrow500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"Midnight market state, allowance data, or simulation is temporarily unavailable. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeBorrow503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/offers/lend":{"post":{"operationId":"buildMidnightMakeLend","tags":["Midnight"],"summary":"Midnight Make Lend Offer","description":"Build and simulate the calls that publish a public set of lend offers. `offers.type` determines the price: `price` specifies a fixed price per unit, and `rate` specifies an interest rate. Entries can target different markets on one chain when every market uses the same loan asset. Each offer must expire by its market maturity.\n\nFills across all offers in the group count toward one shared cap. Wallet-funded offers use the requested loan asset amount as the cap. Variable-rate-market-funded offers use the maximum uint128 as the cap; the requested amount is what publication supplies to the funding address, not a limit on later fills. Fills still depend on available funding. For public offers, the funding amount must also meet the order book's minimum offer size.\n\nFor an entry market that does not yet exist, include its parameters in `market_params`. Otherwise, the route returns 404 `MARKET_NOT_FOUND`. With `p2p: true`, the maker intends to share the offer directly with a taker. The API does not check it against the public offer book's admission rules.\n\nWith `funding_source.type` `wallet` (the default), the wallet funds the offers. The approval threshold is `max(new, currentAllowance + new)`, where `new` is the new loan asset cap. If the current allowance is below that threshold, the API requests a persistent maximum (`maxUint256`) approval, not the exact threshold. The token-specific approval cap applies to the threshold and approval.\n\nWith `variable_rate_market`, the API supplies loan assets to the selected market for a dedicated funding address while the offers are live. It does not supply them to the wallet's own supply position. `funding` describes how the API supplies those assets.\n\nWith wallet funding, offer publication does not transfer loan assets or change the wallet's supply position. With variable-rate-market funding, publication debits the wallet's funding assets. It supplies them into that dedicated funding address's variable-rate supply position.","requestBody":{"required":true,"content":{"application/json":{"example":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","chain_id":8453,"amount":{"unit":"assets","value":"1000000"},"offers":{"type":"price","entries":[{"market_id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","tick":"5000","starts_at":0,"expires_at":1793000000}]}},"schema":{"$ref":"#/components/schemas/MidnightOffersLendRequest"}}}},"responses":{"200":{"description":"Prepared and simulated Midnight lend-offer publication calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared price-based lend-offer publication","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"midnight.make_lend","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"offer":{"groups":["0x8a5a61e963bbb7b75df0c23ccc4116b981cadc135aa3a8dd220e0ec5e7bcf95c"],"entry_count":1},"calls":[{"id":"call_0","kind":"cancel_and_publish","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0xb4691380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000008a0e69772315652165921d722b3caaea4c326e6d408af886ec8229d52eb6333b210d43c84c85adbfa6d3ee0f36e3bd546e2e34200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000068e77f080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000174010000016f1f8b08000000000000136360c00b14f04b33303250a6df01bf344b0201eb1f90e2beacddb35e4f7eb99ee5c4cdbfda2dfb7356bc3dfcea13030520eb3e1301f70b77744525be4cdebd7d7bec874336671cc576369eba231cb578c55d253ebea3cff7fc8ca1c47e0606169254732c7836bdc8302c482c52f1bad2e653eb961c567bc6404bc0ef44207c0801455664dedab73756e7be302acb7ffbe1d791997a31be760bbb90e59d300d60a324f9663dd9f001979c79d3ad73732730d01a302173b41e7f7c532f1f2074fed50689e83f558bcff3be51c2a5915736a0ce615f034e8359342f644acc4315db6011ba36ea6f76ef0e4ed9aba1326bfcae29de44491fbf4a792f70ce5bbb5dd741c8e55ef1b9eaceb73ff971da3f73c5b9e38f1848b27f817ed28cc27da6d76ef3779c74393f3534e44dfb01dc261005165ce158df917742696ed0eb64e34d02576c5a4e44ddfe956bf7e0739ef555b7478fb124199200ee002612000060535ff880050000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[],"position_changes":{},"effects":{"groups":["0x8a5a61e963bbb7b75df0c23ccc4116b981cadc135aa3a8dd220e0ec5e7bcf95c"],"entry_count":1}}}}}},"schema":{"$ref":"#/components/schemas/MidnightOffersLendResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeLend400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightMakeLend403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeLend404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeLend413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The offers, selected markets, pricing, offer lifetime, or cancellation set is unsupported. Relevant outcomes include ACTION_UNSUPPORTED, ACTION_TOO_COMPLEX, and VERIFICATION_REJECTED. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightMakeLend422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeLend500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"Midnight market state, allowance data, or simulation is temporarily unavailable. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeLend503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/offers/repay":{"post":{"operationId":"buildMidnightMakeRepay","tags":["Midnight"],"summary":"Midnight Make Repay Offer","description":"Build and simulate the calls that publish a public set of reduce-only debt-repayment offers priced by `offers.type`. Each offer has the requested debt-unit cap. Fills across all offers in the group count toward one shared total. The group cannot fill more than that cap.\n\nThe API derives the new loan asset approval requirement (`new`) from the debt-unit cap in `amount.value`. The approval threshold is `max(new, currentAllowance + new)`. If the current allowance is below that threshold, the API requests a persistent maximum (`maxUint256`) approval, not the exact threshold. The token-specific approval cap applies to the threshold and approval.\n\nEntries can target different markets on one chain when every market uses the same loan asset. Each offer must expire by its market maturity. With `p2p: true`, the maker intends to share the offer directly with a taker. The API does not check it against the public offer book's admission rules. Offer publication does not transfer loan assets or change a position.","requestBody":{"required":true,"content":{"application/json":{"example":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","chain_id":8453,"amount":{"unit":"units","value":"1000000"},"offers":{"type":"rate","entries":[{"market_id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","tick":"4513","starts_at":0,"expires_at":1793000000,"rate_wad":"1000000000"}]}},"schema":{"$ref":"#/components/schemas/MidnightOffersRepayRequest"}}}},"responses":{"200":{"description":"Prepared and simulated Midnight repayment-offer publication calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared rate-based repayment-offer publication","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"midnight.make_repay","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"offer":{"groups":["0x8306585ae2d17ab16b540b390c4e18b755ea9c62c718aa584a2912ccd8cdbb4a"],"entry_count":1},"calls":[{"id":"call_0","kind":"cancel_and_publish","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0xb4691380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000003b2fba901c88f026bf50a12c8b28484cd81f952628c2ed3bff7018c78511a6a4501656efa086529a9133ab5f41f2259c3bcf7eec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017801000001731f8b08000000000000136360c00b14f04b33303250a6df01bf344b0201eb1f90e2beacddb35e4f7eb99ee5c4cdbfda2dfb7356bc3dfcea13030520eb3e1301f70b2e6c668b887a74b16a637608b7258f9fc4f6d05773928e4bac8af0d2143a73e3ec6e2f4aec6760602149b5b5feae09321d1fd4f6072cd4e9d6f0f0b9213f558da2f8e57722e07f4a81222b326feddb1bab735f1895e5bffdf0ebc84cbd185fbb855dc8f24e9806b051e2bdac271b3ee092336fba756eee04065a0326648ed6e38f6feae50384cebfda2011fda76af179de374ab834f2ca06d439ec6bc069308be6854c8979a8621b2c42d746fdcdeeddc1297b3554668ddf35c59bcf90e57f95f25ee09cb776bbae8390cbbde273d59d6f7ff2e3b47fe68a73c71f319064ff02fda41985fb4cafdde6ef38e9727e6a68c89bf603b84d200a1cd038f4d6fa7f81c4f156c1654b02c4c2de2f680b9a35d17875bce327d539d6e7ebde5068fe027c92d6b34e51683c03030059d8d1daa00500000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[],"position_changes":{},"effects":{"groups":["0x8306585ae2d17ab16b540b390c4e18b755ea9c62c718aa584a2912ccd8cdbb4a"],"entry_count":1}}}}}},"schema":{"$ref":"#/components/schemas/MidnightOffersRepayResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeRepay400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightMakeRepay403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeRepay404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeRepay413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The wallet has no Midnight debt for the reduce-only offers. Alternatively, the offers, selected markets, prices, offer lifetime, or cancellation set is unsupported. Relevant outcomes include POSITION_EMPTY, ACTION_UNSUPPORTED, ACTION_TOO_COMPLEX, and VERIFICATION_REJECTED. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"positionEmpty":{"summary":"Empty position","value":{"error":{"code":"POSITION_EMPTY","message":"The Midnight debt position is empty.","details":[{"code":"no_maker_debt","message":"The maker has no debt in market 0x1111111111111111111111111111111111111111111111111111111111111111.","path":["offers","entries",0]}],"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightMakeRepay422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeRepay500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"Midnight market state, allowance data, or simulation is temporarily unavailable. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeRepay503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/offers/withdraw":{"post":{"operationId":"buildMidnightMakeWithdraw","tags":["Midnight"],"summary":"Midnight Make Withdraw Offer","description":"Build and simulate the calls that publish a public set of reduce-only credit-withdrawal offers priced by `offers.type`. Price offers require a nonzero tick. Tick 0 returns 422 `ACTION_UNSUPPORTED`.\n\nEntries can target different markets on one chain when every market uses the same loan asset. Each offer must expire by its market maturity. Each offer has the requested credit-unit cap. Fills across all offers in the group count toward one shared total. The group cannot fill more than that cap. The offers are reduce-only and cannot open debt.\n\nWith `p2p: true`, the maker intends to share the offer directly with a taker. The API does not check it against the public offer book's admission rules.","requestBody":{"required":true,"content":{"application/json":{"example":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","chain_id":8453,"amount":{"unit":"units","value":"1000000"},"offers":{"type":"rate","entries":[{"market_id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","tick":"5000","starts_at":0,"expires_at":1793000000,"rate_wad":"1000000000"}]}},"schema":{"$ref":"#/components/schemas/MidnightOffersWithdrawRequest"}}}},"responses":{"200":{"description":"Prepared and simulated Midnight withdrawal-offer publication calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared rate-based withdrawal-offer publication","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"midnight.make_withdraw","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"offer":{"groups":["0xc85cc2662ff7d3e2fc1637e825c615ae660fdefe763062878c14272482ba4d07"],"entry_count":1},"calls":[{"id":"call_0","kind":"cancel_and_publish","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0xb4691380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000003b2fba901c88f026bf50a12c8b28484cd81f95260ab1cbc7548804e8b2a9f3959022bc48913005e60d56c72d2af2e5b9cc0fc36000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018601000001811f8b08000000000000036360c00b14f04b3330129027a4df01bf344b0201eb1f10301f0564ed9ef57af2cbf52c276efed56ed99fb3e2ede1579f48d18f61de7d2602ee17ee381173284dfffbe5477fc4cc5fa81e135d97c67fef5f9941527b8f88ba4ad32e5f764aec67606041750f01ff59ebef9a20d3f1416d7fc0429d6e0d0f9f1bf253d50858803f7ef99d08f89f52a0c88acc5bfbf6c6eadc174665f96f3ffc3a32532fc6d76e6117b2bc13a6016cf8cdc7efbdac271b3ee092336fba756eee04fca65301302173b41e7f7c532f1f2074fed50689e83f558bcff3be51c2a5915736a0ce615f034e8359342f644acc4315db6011ba36ea6f76ef0e4ed9aba1326bfcae29de7c862cffab94f702e7bcb5db751d845cee159fabee7cfb931fa7fd33579c3bfe08b7c7b0d9bf403f6946e13ed36bb7f93b4eba9c9f1a1af2a6fd006e13880207b8369e3e1ed2c1f262d3cacf532728edf19868c0fa8c37ecb8aed6a7a73bcff01f2650be10040bf0495acf3a45a1f10c0c009b216e97a00500000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[],"position_changes":{},"effects":{"groups":["0xc85cc2662ff7d3e2fc1637e825c615ae660fdefe763062878c14272482ba4d07"],"entry_count":1}}}}}},"schema":{"$ref":"#/components/schemas/MidnightOffersWithdrawResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeWithdraw400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightMakeWithdraw403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeWithdraw404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeWithdraw413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The wallet has no Midnight credit for the reduce-only offers. Alternatively, the offers, selected markets, prices, offer lifetime, or cancellation set is unsupported. Relevant outcomes include POSITION_EMPTY, ACTION_UNSUPPORTED, ACTION_TOO_COMPLEX, and VERIFICATION_REJECTED. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"positionEmpty":{"summary":"Empty position","value":{"error":{"code":"POSITION_EMPTY","message":"The Midnight credit position is empty.","details":[{"code":"no_maker_credit","message":"The maker has no credit in market 0x1111111111111111111111111111111111111111111111111111111111111111.","path":["offers","entries",0]}],"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightMakeWithdraw422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeWithdraw500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"Midnight market state, allowance data, or simulation is temporarily unavailable. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightMakeWithdraw503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/offers/cancel":{"post":{"operationId":"buildMidnightCancelOffers","tags":["Midnight"],"summary":"Midnight Cancel Offers","description":"Build and simulate an unconditional, complete cancellation of one or more offer groups. `group_id` values come from the Morpho API `/v0/midnight/users/{user_address}/offer-groups` or the `groups` returned by the offer-publication routes. Each group must belong to the wallet. The Morpho API `/v0/midnight/offer-groups/{group_id}` must already return each group. A group published moments ago can return 422 `ACTION_UNSUPPORTED`. In that case, retry shortly.\n\nThe response contains one `cancel_offers` call to Midnight: `setConsumed` for one group or an atomic `multicall` for multiple groups. No Morpho authorization is needed. `expires_at` limits the prepared response and proof, not the on-chain call.\n\nCancellation does not withdraw supplied funding. After confirmation of the cancellation, recover variable-rate funding with POST /v0/actions/midnight/offers/funding/withdraw. Use the publication response's `funding_address` and the id of its `funding_market`.","requestBody":{"required":true,"content":{"application/json":{"example":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","chain_id":8453,"groups":["0x1111111111111111111111111111111111111111111111111111111111111111"]},"schema":{"$ref":"#/components/schemas/MidnightCancelOffersRequest"}}}},"responses":{"200":{"description":"Prepared and simulated Midnight offer-cancellation calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared complete offer-group cancellation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"midnight.cancel_offers","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"groups":["0x1111111111111111111111111111111111111111111111111111111111111111"],"calls":[{"id":"call_0","kind":"cancel_offers","to":"0xAdedD8ab6dE832766Fedf0FaC4992E5C4D3EA18A","data":"0xf01fc06c111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000ffffffffffffffffffffffffffffffff0000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf2","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[],"position_changes":{},"effects":{"cancelled_groups":["0x1111111111111111111111111111111111111111111111111111111111111111"]}}}}}},"schema":{"$ref":"#/components/schemas/MidnightCancelOffersResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightCancelOffers400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightCancelOffers403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightCancelOffers404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightCancelOffers413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The offers, selected markets, pricing, offer lifetime, or cancellation set is unsupported. Relevant outcomes include ACTION_UNSUPPORTED, ACTION_TOO_COMPLEX, and VERIFICATION_REJECTED.\n\nEach group must belong to the wallet. The Morpho API `/v0/midnight/offer-groups/{group_id}` must already return each group. A group published moments ago that is not yet available can return 422 `ACTION_UNSUPPORTED`. In that case, retry shortly. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightCancelOffers422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightCancelOffers500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The offer-group lookup can be unavailable or return invalid data. Midnight chain-state validation or action verification can also be unavailable or return a malformed response. Relevant outcomes include QUOTE_UNAVAILABLE, QUOTE_INVALID, STATE_UNAVAILABLE, VERIFICATION_UNAVAILABLE, and VERIFICATION_INVALID_RESPONSE. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightCancelOffers503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/offers/funding/withdraw":{"post":{"operationId":"buildMidnightWithdrawFunding","tags":["Midnight"],"summary":"Midnight Withdraw Offer Funding","description":"Recover the entire supply position of the wallet's funding address in a variable-rate market.\n1. Publish a lend offer funded from a variable-rate market through POST /v0/actions/midnight/offers/lend.\n2. Keep its funding_address and funding_market.\n3. Choose one option:\n   - Cancel the offers with POST /v0/actions/midnight/offers/cancel. Confirm the cancellation.\n   - Wait for the offers to expire.\n4. Call this route with that funding_address and the id of that funding_market.\n\nThis route does not cancel offers or check their cancellation or expiry. POSITION_EMPTY means that no position remains to withdraw. The route returns exactly one call to withdraw all supply shares from funding_address to account. It accepts no amount or signature continuation. expires_at specifies when the off-chain response expires, not an on-chain deadline.\n\nThe simulation confirms the burned shares and loan assets that the wallet receives. The API rejects reverted or unverifiable simulations.","requestBody":{"required":true,"content":{"application/json":{"example":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","chain_id":8453,"funding_address":"0xEd9664ADD48a793A5c3f291FC77e1bF7beB4C4AC","funding_market":"0x84662b4f95b85d6b082b68d32cf71bb565b3f22f216a65509cc2ede7dccdfe8c"},"schema":{"$ref":"#/components/schemas/MidnightWithdrawFundingRequest"}}}},"responses":{"200":{"description":"Attested complete funding withdrawal with independently verified simulation effects.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared complete funding withdrawal","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"midnight.withdraw_funding","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"funding_address":"0xEd9664ADD48a793A5c3f291FC77e1bF7beB4C4AC","market":{"id":"0x84662b4f95b85d6b082b68d32cf71bb565b3f22f216a65509cc2ede7dccdfe8c","loan_asset":{"address":"0x4200000000000000000000000000000000000006"}},"calls":[{"id":"call_0","kind":"withdraw_funding","to":"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb","data":"0x5c2bea4900000000000000000000000042000000000000000000000000000000000000060000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e600000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e8d4a51000000000000000000000000000ed9664add48a793a5c3f291fc77e1bf7beb4c4ac0000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf2","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"1000000"}],"position_changes":{"supply_shares":"-1000000000000"},"effects":{"shares":"1000000000000","assets":"1000000"}}}}}},"schema":{"$ref":"#/components/schemas/MidnightWithdrawFundingResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawFunding400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightWithdrawFunding403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawFunding404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawFunding413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The API returns ACTION_UNSUPPORTED for an unsupported chain or failed funding checks. The distinct details[].code values are:\n- unregistered_funding_address: the funding address is unregistered.\n- funding_address_owner_mismatch: the wallet does not own the funding address.\n- funding_address_unauthorized: the wallet lacks withdrawal authorization.\n\nThe API returns POSITION_EMPTY when the funding address has no supply shares. It returns SHARED_LIQUIDITY_INSUFFICIENT when the funding market cannot cover the entire supply position. It can also return ACTION_TOO_COMPLEX or VERIFICATION_REJECTED. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawFunding422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawFunding500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"Midnight market state, allowance data, or simulation is temporarily unavailable. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawFunding503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/offer-groups/{group-selector}/take":{"post":{"operationId":"buildMidnightTake","tags":["Midnight"],"summary":"Midnight Take Offer","description":"Build and simulate a take of one active Midnight offer group identified by <chain_id>:<group_id>. `group_id` values come from the Morpho API `/v0/midnight/users/{user_address}/offer-groups` or the `groups` returned by the offer-publication routes.\n\nThe group determines the side. For a maker that lends (`buy: true`), the taker borrows and can include `collateral_supplies`. For a maker that borrows (`buy: false`), the taker lends and must include `funding`.\n\nOn the borrow side with `collateral_supplies`, native or automatic funding applies only to the wrapped-native collateral portion. All other collateral uses ERC-20 funding. Native funding requires a positive wrapped-native collateral total. Otherwise, the route returns 422 FUNDING_UNSUPPORTED. On chains with a wrapped-native token, the API accepts automatic funding even without supplied wrapped-native collateral.\n\nWhen the group has live offers on multiple markets, include `market_id` to select one market. Include exactly one `guard`:\n- `slippage`.\n- A simple rate per second with WAD scaling: `max_rate` on the borrow side or `min_rate` on the lend side.\n- One absolute bound on the borrow side: `max_units` for assets or `min_assets` for units.\n- One absolute bound on the lend side: `min_units` for assets or `max_assets` for units.\n\nRate guards also work with `p2p: true` and markets that do not yet exist. On the borrow side with slippage, the guarded seller price cannot fall below the price implied by 100% fixed APR to maturity. The API rejects quotes below that floor. On the lend side with only `slippage`, the API caps the guarded buyer price at par. Par is one loan asset base unit per credit unit.\n\nOn the lend side with only `slippage`, if the best quoted price is already above par, the route returns 422 QUOTE_INSUFFICIENT. To accept an above-par price, use an `amount` with `unit` set to `units` and a `max_assets` guard. On the lend side, with native or `auto` funding and a `units` target, the API wraps native tokens. It wraps at most `max_lend_assets`, the maximum spend. Any unused wrapped amount remains in the wallet as the wrapped token (for example WETH). With an `assets` target, no wrapped amount remains unused.\n\nThe API rejects `reduce_only`, expired, cancelled, filled, or not-yet-active groups. With `p2p: true`, the take uses the offer group that the maker shared directly. This includes offers absent from the public offer book.\n\nFor vault adapter offers shared with `p2p: true`, borrows cannot exceed the vault's idle loan assets plus available variable-rate funding. Loans cannot exceed the maker's gross credit after accrued fees. The API does not subtract remaining pending fees again. Unrecognized funding sources add no available amount.\n\nIf the group has enough remaining amount but the maker cannot fund the request, the route returns 422 OFFER_GROUP_MAKER_CANNOT_PAY. Requests above the group's remaining amount return 422 QUOTE_INSUFFICIENT. The simulation checks vault allocation and duration limits.","parameters":[{"schema":{"$ref":"#/components/schemas/MidnightGroupSelector"},"required":true,"description":"Midnight offer-group selector formatted as <chain_id>:<group_id>. Send the colon literally or as %3A.","name":"group-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"borrow":{"summary":"Take a borrow-side offer group","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50}}},"borrowWithCollateral":{"summary":"Supply collateral while taking a borrow-side group","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"units","value":"1000000"},"guard":{"type":"slippage","bps":50},"collateral_supplies":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"amount":{"unit":"assets","value":"1000000"}}],"funding":{"type":"erc20"}}},"lend":{"summary":"Take a lend-side offer group","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50},"funding":{"type":"erc20"}}}},"schema":{"$ref":"#/components/schemas/MidnightTakeRequest"}}}},"responses":{"200":{"description":"Prepared and simulated Midnight take calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"borrow":{"summary":"Prepared borrow-side group take","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}],"tick_spacing":4},"action":"midnight.take_borrow","amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50},"quote":{"average_best_price_wad":"999701089374277091","average_worst_price_wad":"994702583927405705","available_assets":"1000000","available_units":"1000299","offer_count":1},"max_borrow_units":"1005326","calls":[{"id":"call_0","kind":"borrow","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0xca7de09c000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f570e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf2000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000f436b00000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000200000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e8480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"1000000"}],"position_changes":{"credit_units":"0","debt_units":"1000299"},"effects":{"borrowed_assets":"1000000","borrowed_units":"1000299","referral_fee_assets":"0"}},"p2p":false,"group":"0x0000000000000000000000000000000000000000000000000000000000000000","maker":"0x2000000000000000000000000000000000000002","collateral_supplies":[]}}},"borrowWithCollateral":{"summary":"Prepared collateral supply and borrow-side take","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}],"tick_spacing":4},"action":"midnight.supply_collateral_take_borrow","amount":{"unit":"units","value":"1000000"},"guard":{"type":"slippage","bps":50},"quote":{"average_best_price_wad":"999701000000000000","average_worst_price_wad":"994702495000000000","available_assets":"999701","available_units":"1000000","offer_count":1},"max_borrow_units":"1000000","collateral_approvals":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"assets":"1000000"},{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"assets":"500000"}],"resolved_funding":{"wrapped_asset":"0x4200000000000000000000000000000000000006","max_native_assets":"0","erc20_assets":"0","native_assets":"0"},"calls":[{"id":"call_0","kind":"supply_collateral_and_borrow","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0xad43ff97000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f2d8e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf200000000000000000000000000000000000000000000000000000000000003800000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000007a120000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000200000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e8480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"999701"},{"asset":{"type":"erc20","address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"difference":"-1000000"},{"asset":{"type":"erc20","address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"difference":"-500000"}],"position_changes":{"credit_units":"0","debt_units":"1000000","collaterals":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"difference":"1000000"},{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"difference":"500000"}]},"effects":{"borrowed_assets":"999701","borrowed_units":"1000000","referral_fee_assets":"0","supplied_collaterals":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"assets":"1000000"},{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"assets":"500000"}]}},"p2p":false,"group":"0x0000000000000000000000000000000000000000000000000000000000000000","maker":"0x2000000000000000000000000000000000000002","collateral_supplies":[{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"amount":{"unit":"assets","value":"1000000"}},{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"amount":{"unit":"assets","value":"500000"}}]}}},"lend":{"summary":"Prepared lend-side group take","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}],"tick_spacing":4},"action":"midnight.take_lend","amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50},"quote":{"average_best_price_wad":"1000000000000000000","average_worst_price_wad":"1005000000000000000","available_assets":"1000000","available_units":"1000000","offer_count":1},"max_lend_assets":"1000000","resolved_funding":{"wrapped_asset":"0x4200000000000000000000000000000000000006","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"lend","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0x934a8ebb00000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f2ed00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000008c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000020000000000000000000000000000000000000020000000000000000000000005000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e8480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000212340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"-1000000"}],"position_changes":{"credit_units":"1000000","debt_units":"0"},"effects":{"lent_assets":"1000000","lent_units":"1000000","referral_fee_assets":"0"}},"p2p":false,"group":"0x0000000000000000000000000000000000000000000000000000000000000000","maker":"0x2000000000000000000000000000000000000002","collateral_supplies":[]}}}},"schema":{"$ref":"#/components/schemas/MidnightTakeResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightTake400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightTake403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight offer group does not exist on this chain. Relevant outcome: OFFER_GROUP_NOT_FOUND. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightTake404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightTake413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"One of these conditions applies:\n- The selected chain does not support Midnight offer-group takes.\n- The offer group does not permit a take. It is expired, cancelled, filled, not yet active, or reduce-only.\n- The group spans multiple markets without a supplied `market_id`, or has no live offers on the requested market.\n- Its offers mix both sides.\n- The quote is stale, insufficient, or violates the price guard.\n- The request specifies native funding without a wrapped-native collateral supply.\n- The maker cannot fill the requested amount now.\n- The take requires more than 75 offers or exceeds 110,000 calldata bytes.\n\nRelevant outcomes include ACTION_UNSUPPORTED, FUNDING_UNSUPPORTED, QUOTE_STALE, QUOTE_INSUFFICIENT, OFFER_GROUP_MAKER_CANNOT_PAY, ACTION_TOO_COMPLEX, and VERIFICATION_REJECTED. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedChain":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"Midnight offer-group takes are not supported on this chain.","details":null,"request_id":"req_0123456789abcdef"}}},"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightTake422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightTake500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The Midnight action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightTake503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/markets/{market-selector}/lend":{"post":{"operationId":"buildMidnightLend","tags":["Midnight"],"summary":"Midnight Lend","description":"Build and simulate a lend against the selected market's open offers. Use an exact loan asset spend (`unit: assets`, including any referral fee) or an exact credit-unit amount (`unit: units`). Credit units are lend-side units. One credit unit is redeemable for one loan asset base unit at market maturity.\n\nSet `guard` to one of these values:\n- `slippage`.\n- `min_rate`, for a minimum simple rate per second with WAD scaling.\n- `min_units` for an assets amount, or `max_assets` for a units amount. These are absolute bounds.\n\nWith only `slippage`, the API caps the guarded buyer price at par (one loan asset base unit per credit unit). If the best quoted price is already above par, the route returns 422 QUOTE_INSUFFICIENT. To accept an above-par price, use an `amount` with `unit` set to `units` and a `max_assets` guard.\n\nOn the lend side, with native or `auto` funding and a `units` target, the API wraps native tokens. It wraps at most `max_lend_assets`, the maximum spend. Any unused wrapped amount remains in the wallet as the wrapped token (for example WETH). With an `assets` target, no wrapped amount remains unused. When `referral_fee` is present, its recipient must differ from the wallet that lends.","parameters":[{"schema":{"$ref":"#/components/schemas/MidnightMarketSelector"},"required":true,"description":"Midnight market selector formatted as <chain_id>:<market_id>. Send the colon literally or as %3A.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"assets":{"summary":"Lend an exact total loan asset amount","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50},"funding":{"type":"erc20"}}},"unitsWithReferral":{"summary":"Buy exact credit units with a referral fee","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"units","value":"1000000"},"guard":{"type":"slippage","bps":50},"funding":{"type":"auto","max_native_assets":"1000000"},"referral_fee":{"bps":10,"recipient":"0x545b6Cc751F0C47C202694cf835db2E3C071400A"}}}},"schema":{"$ref":"#/components/schemas/MidnightLendRequest"}}}},"responses":{"200":{"description":"Prepared, quoted, and simulated Midnight lend calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"lent":{"summary":"Prepared exact-assets lend","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}]},"action":"midnight.lend","amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50},"quote":{"average_best_price_wad":"1000000000000000000","average_worst_price_wad":"1005000000000000000","available_assets":"1000000","available_units":"1000000","offer_count":1},"max_lend_assets":"1000000","resolved_funding":{"wrapped_asset":"0x4200000000000000000000000000000000000006","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"lend","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0x934a8ebb00000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f2ed00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000008c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000020000000000000000000000000000000000000020000000000000000000000005000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e8480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000212340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"-1000000"}],"position_changes":{"credit_units":"1000000","debt_units":"0"},"effects":{"lent_assets":"1000000","lent_units":"1000000","referral_fee_assets":"0"}}}}}},"schema":{"$ref":"#/components/schemas/MidnightLendResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightLend400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightLend403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightLend404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightLend413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The action, position, collateral selection, funding mode, or verification is unsupported. Alternatively, one of these conditions applies:\n- The quote is stale or insufficient. QUOTE_INSUFFICIENT means that the API cannot fill the requested amount within the 75-offer quote limit or the price guard.\n- The wallet cannot fill any quoted offer. OFFER_NOT_FILLABLE means that the quote has no offer the wallet can fill. For example, every offer is the wallet's own, has zero units, or has a zero price.\n- The prepared action exceeds the complexity limit. ACTION_TOO_COMPLEX indicates take calldata above 110,000 bytes.\n\nRelevant outcomes include POSITION_EMPTY, POSITION_INSUFFICIENT, COLLATERAL_UNSUPPORTED, QUOTE_STALE, QUOTE_INSUFFICIENT, OFFER_NOT_FILLABLE, ACTION_TOO_COMPLEX, and VERIFICATION_REJECTED. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightLend422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightLend500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The quote source, action verification, or simulation dependency is unavailable. Alternatively, the quote source returned a malformed, reordered, or mismatched quote. Relevant quote outcomes include QUOTE_UNAVAILABLE, QUOTE_INVALID, QUOTE_ORDER_INVALID, and QUOTE_MARKET_MISMATCH. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightLend503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/markets/{market-selector}/withdraw":{"post":{"operationId":"buildMidnightWithdraw","tags":["Midnight"],"summary":"Midnight Withdraw","description":"Withdraw an exact loan asset amount (`unit: assets`) or an exact credit-unit amount (`unit: units`) from a Midnight credit position. The action first redeems available market liquidity. It sells any remainder against open offers. The returned quote covers that remainder.\n\nSend `amount: { \"unit\": \"all\" }` to redeem the accrued position's current face value directly from market liquidity. This method takes no offers and uses no price guard. Before maturity, it can leave pending fees and a residual credit position. Thus, it is not a full exit before maturity. The market must have enough withdrawable liquidity to cover the face value. Otherwise, the request returns 422 INSUFFICIENT_LIQUIDITY.\n\nAlternatively, with `allow_partial: true` and `amount.unit: all`, directly redeem the smaller of accrued credit and currently withdrawable liquidity. This method sells to no offers and accepts no guard. Zero credit returns `POSITION_EMPTY`. Zero withdrawable liquidity returns `INSUFFICIENT_LIQUIDITY`.\n\n`allow_partial` defaults to false. The API rejects `allow_partial` with exact amounts, even when false, with `VALIDATION_FAILED`. The response's `resolved_amount.value` and simulation redeemed-unit effect report the actual redemption. `amount` remains `{ \"unit\": \"all\" }` without a value.\n\nTo withdraw through a partial sale of the position, send a `units` amount equal to the position's credit units. Include a guard. A sell remainder requires a `guard`:\n- `slippage`.\n- `max_rate`, for a maximum simple rate per second with WAD scaling.\n- The matching absolute bound: `max_units` for an assets amount, or `min_assets` for a units amount.\n\nOnly exact withdrawals accept `max_rate`. Complete withdrawals reject rate guards. With slippage, the guarded seller price cannot fall below the price implied by a 100% fixed APR to maturity. The API rejects quotes below that floor.\n\nThe same floor applies to a `units` withdrawal's sold remainder when direct redemption already covers `min_assets`. In that case, the API increases the encoded minimum. The minimum equals the redeemed units' value plus the remainder priced at that floor, net of the referral fee. The action can return `QUOTE_RATE_ABOVE_CEILING`. The action is reduce-only and cannot open debt.\n\nAn exact Midnight withdrawal has an exception when available liquidity covers the whole withdrawal. The response is a `midnight.redeem` action. Its `amount` specifies the redeemed credit units, regardless of the requested unit. Face-value redemption still satisfies `max_rate`. The API rejects `referral_fee` in that case.","parameters":[{"schema":{"$ref":"#/components/schemas/MidnightMarketSelector"},"required":true,"description":"Midnight market selector formatted as <chain_id>:<market_id>. Send the colon literally or as %3A.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"assets":{"summary":"Withdraw an exact loan asset amount","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"assets","value":"1000000"},"guard":{"type":"slippage","bps":50}}},"unitsWithReferral":{"summary":"Withdraw exact credit units with a referral fee","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","amount":{"unit":"units","value":"1000000"},"guard":{"type":"slippage","bps":50},"referral_fee":{"bps":10,"recipient":"0x545b6Cc751F0C47C202694cf835db2E3C071400A"}}}},"schema":{"$ref":"#/components/schemas/MidnightWithdrawRequest"}}}},"responses":{"200":{"description":"Prepared, quoted, and simulated Midnight withdrawal calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"withdrawn":{"summary":"Prepared quoted credit withdrawal","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}]},"action":"midnight.withdraw","amount":{"unit":"units","value":"1000000"},"guard":{"type":"slippage","bps":50},"quote":{"average_best_price_wad":"999701089374277091","average_worst_price_wad":"994702583927405705","available_assets":"1000000","available_units":"1000000","offer_count":1},"max_withdraw_units":"1000000","calls":[{"id":"call_0","kind":"withdraw","to":"0x0bF30B530f816a619C3F28a3b9f44C441122555D","data":"0xad43ff97000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f1b3000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf2000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000200000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068e77f08000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e8480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"1000000"}],"position_changes":{"credit_units":"-1000000","debt_units":"0"},"effects":{"withdrawn_assets":"1000000","withdrawn_units":"1000000","referral_fee_assets":"0"}},"resolved_amount":{"unit":"units","value":"1000000"}}}},"redeemed":{"summary":"Prepared direct credit redemption","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}]},"action":"midnight.redeem","amount":{"unit":"units","value":"1000000"},"calls":[{"id":"call_0","kind":"redeem","to":"0xAdedD8ab6dE832766Fedf0FaC4992E5C4D3EA18A","data":"0xa6db1750000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf20000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf20000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c0","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x4200000000000000000000000000000000000006"},"difference":"1000000"}],"position_changes":{"credit_units":"-1000000","debt_units":"0"},"effects":{"redeemed_assets":"1000000","redeemed_units":"1000000"}},"resolved_amount":{"unit":"units","value":"1000000"}}}}},"schema":{"$ref":"#/components/schemas/MidnightWithdrawResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdraw400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightWithdraw403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdraw404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdraw413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"One of these conditions applies:\n- The position is empty or insufficient.\n- The market lacks withdrawable liquidity.\n- The action is unsupported.\n- The quote is stale or insufficient. QUOTE_INSUFFICIENT means that the API cannot fill the requested amount within the 75-offer quote limit or the price guard.\n- The wallet cannot fill any quoted offer. OFFER_NOT_FILLABLE means that the quote has no offer the wallet can fill. For example, every offer is the wallet's own, has zero units, or has a zero price.\n- The prepared action exceeds the complexity limit. ACTION_TOO_COMPLEX indicates take calldata above 110,000 bytes.\n\nRelevant outcomes include POSITION_EMPTY, POSITION_INSUFFICIENT, INSUFFICIENT_LIQUIDITY, ACTION_UNSUPPORTED, QUOTE_STALE, QUOTE_INSUFFICIENT, OFFER_NOT_FILLABLE, ACTION_TOO_COMPLEX, and VERIFICATION_REJECTED. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightWithdraw422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdraw500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The quote source, action verification, or simulation dependency is unavailable. Alternatively, the quote source returned a malformed, reordered, or mismatched quote. Relevant quote outcomes include QUOTE_UNAVAILABLE, QUOTE_INVALID, QUOTE_ORDER_INVALID, and QUOTE_MARKET_MISMATCH. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdraw503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/midnight/markets/{market-selector}/withdraw-collateral":{"post":{"operationId":"buildMidnightWithdrawCollateral","tags":["Midnight"],"summary":"Midnight Withdraw Collateral","description":"Build calls to withdraw exact or complete balances of one or more configured collaterals from a Midnight position. The API processes collaterals in request order. Addresses must be unique. The response never requires signatures.\n\nThe response contains one call to Midnight: `withdraw_collateral` (`withdrawCollateral`) for one collateral or `withdraw_collateral_batch` (an atomic `multicall`) for several. No Morpho authorization is needed. An `all` amount is encoded as the collateral balance read when the action is prepared. `expires_at` limits the prepared response and proof, not the on-chain call.","parameters":[{"schema":{"$ref":"#/components/schemas/MidnightMarketSelector"},"required":true,"description":"Midnight market selector formatted as <chain_id>:<market_id>. Send the colon literally or as %3A.","name":"market-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"orderedWithdrawals":{"summary":"Withdraw two collaterals in order, one completely and one exactly","value":{"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","collateral_withdrawals":[{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"amount":{"unit":"all"}},{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"amount":{"unit":"assets","value":"500000"}}]}}},"schema":{"$ref":"#/components/schemas/MidnightWithdrawCollateralRequest"}}}},"responses":{"200":{"description":"Prepared, simulated Midnight collateral-withdrawal calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"orderedWithdrawals":{"summary":"Prepared ordered collateral withdrawals","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x6aBB9Aeb93e9aF04c8D9FD2b84BF6ca8EDC3eAf2","expires_at":1760001800,"market":{"id":"0xcdea4ca06837feca3026b23a95f0bd96c3eabdc77d1211472ce0346fcc200649","loan_asset":{"address":"0x4200000000000000000000000000000000000006"},"collaterals":[{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"}]},"action":"midnight.withdraw_collateral","collateral_withdrawals":[{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"amount":{"unit":"all"}},{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"amount":{"unit":"assets","value":"500000"}}],"calls":[{"id":"call_0","kind":"withdraw_collateral_batch","to":"0xAdedD8ab6dE832766Fedf0FaC4992E5C4D3EA18A","data":"0xac9650d8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000002c4a121e2a900000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000003d0900000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf20000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf20000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c4a121e2a900000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007a1200000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf20000000000000000000000006abb9aeb93e9af04c8d9fd2b84bf6ca8edc3eaf20000000000000000000000000000000000000000000000000000000000002105000000000000000000000000adedd8ab6de832766fedf0fac4992e5c4d3ea18a00000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000006ae4b0f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec220000000000000000000000000000000000000000000000000d1d507e40be80000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000b03855ad5afd6b8db8091dd5551cac4ed621d9e6000000000000000000000000fa750dd0099eadb72d401244de73ce7b89edf90f0000000000000000000000000000000000000000000000000d99a8cec7e200000000000000000000000000000000000000000000000000000429d069189e0000000000000000000000000000a02f629871be35d6db0f88c944cf955554ec87c000000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"difference":"500000"},{"asset":{"type":"erc20","address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"difference":"250000"}],"position_changes":{"collaterals":[{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"difference":"-250000"},{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"difference":"-500000"}]},"effects":{"withdrawn_collaterals":[{"collateral":{"address":"0xFa750DD0099eAdB72d401244De73ce7B89edf90F"},"assets":"250000"},{"collateral":{"address":"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22"},"assets":"500000"}]}}}}}},"schema":{"$ref":"#/components/schemas/MidnightWithdrawCollateralResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawCollateral400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightWithdrawCollateral403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The selected Midnight market does not exist. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawCollateral404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawCollateral413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The action, position, collateral selection, or funding mode is unsupported. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"unsupportedAction":{"summary":"Unsupported action","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"This action is not supported.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/MidnightWithdrawCollateral422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawCollateral500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The Midnight action cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MidnightWithdrawCollateral503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/vaults-v1/{vault-selector}/deposit":{"post":{"operationId":"buildVaultV1Deposit","tags":["Vaults V1"],"summary":"Vault V1 Deposit","description":"Build and simulate wallet calls for a deposit into an approved Morpho Vault V1 vault. The API returns the calls in sequence. Vault V1 is the legacy vault version. Use Vault V2 for new integrations when possible.\n\nFor wrapped-native vaults, set `funding.type` to `native`, `erc20`, or balance-based `auto`. The API does not support mixed funding. Use `signature_mode` to select prerequisite approval calls or automatic ERC-2612 signature selection.","parameters":[{"schema":{"$ref":"#/components/schemas/VaultV1Selector"},"required":true,"description":"Vault identifier formatted as <chain_id>:<vault_address>. Send the colon literally or as %3A. Mixed-case addresses must use a valid EIP-55 checksum.","name":"vault-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Deposit an exact asset amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"erc20"}}},"nativeFunding":{"summary":"Deposit with native currency","description":"Available when the selected vault asset is the chain's registered wrapped-native asset.","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"native","max_native_assets":"1000000"}}},"autoFunding":{"summary":"Select deposit funding from the wallet balance","description":"Available when the selected vault asset is the chain's registered wrapped-native asset.","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"auto","max_native_assets":"1000000"}}},"referralFee":{"summary":"Deposit with a referral fee","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"erc20"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"}}},"continuation":{"summary":"Continue with the collected signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}},"signatureMode":{"summary":"Automatically select ERC-2612 signatures or approval calls","value":{"signature_mode":"auto","account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"erc20"}}}},"schema":{"$ref":"#/components/schemas/VaultV1DepositRequest"}}}},"responses":{"200":{"description":"A signature request or prepared, simulated deposit calls.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"approvalRequired":{"summary":"Prepared deposit with required ERC-20 approval","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461738,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000002b08a911f48de25a7e305d910afb5597abe8ea7b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"vault_v1_deposit","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x6bbba4e0000000000000000000000000beef010f9cb27031ad51e3333f9af9c6b122818300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000003f0b91cd2965f00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac7896a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac76d4b22221111","value":"0"}],"simulation":{"status":"success","block":{"number":"52332596","timestamp":1791454539},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"vault_shares":"906144529135072660"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}}}}},"allowanceSufficient":{"summary":"Prepared deposit using the existing allowance","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"vault_v1_deposit","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x6bbba4e0000000000000000000000000beef010f9cb27031ad51e3333f9af9c6b122818300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000003ec03f6be0c5200000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac7919322221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"vault_shares":"1000000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}}}}},"signatureRequired":{"summary":"Typed-data signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"name":"USD Coin","version":"2","chainId":8453,"verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"message":{"owner":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","spender":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","value":"1000000","nonce":"106","deadline":"1791455109"},"primaryType":"Permit"}}],"continuation":"continuation_from_previous_response","expires_at":1791455109}}},"referralFee":{"summary":"Prepared deposit with a referral fee","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461739,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000002b08a911f48de25a7e305d910afb5597abe8ea7b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"vault_v1_deposit","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x6bbba4e0000000000000000000000000beef010f9cb27031ad51e3333f9af9c6b122818300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000003f0b91ce3ebd400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000008e1bc9bf040000000000000000000000000003000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000006ac7896b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac76d4c22221111","value":"0"}],"simulation":{"status":"success","block":{"number":"52332597","timestamp":1791454541},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"vault_shares":"903879165960750679"},"effects":{"gross_assets":"1000000","referral_fee_assets":"2500","net_assets":"997500"}}}}},"noFee":{"summary":"Prepared deposit without a referral fee","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"vault_v1_deposit","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x6bbba4e0000000000000000000000000beef010f9cb27031ad51e3333f9af9c6b122818300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000003ec03f6be0c5200000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac7919322221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"vault_shares":"1000000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}}}}},"immediateFinalization":{"summary":"Signature request prepared immediately","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"vault_v1_deposit","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x6bbba4e0000000000000000000000000beef010f9cb27031ad51e3333f9af9c6b122818300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000003ec03f6be0c5200000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac7919322221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"vault_shares":"1000000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}}}}},"continuation":{"summary":"Prepared deposit after the signature continuation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"vault_v1_deposit","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x6bbba4e0000000000000000000000000beef010f9cb27031ad51e3333f9af9c6b122818300000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000003ec03f6be0c5200000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac7919322221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"vault_shares":"1000000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}}}}},"rejectedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_1"}}}}},"insufficientBalanceFailure":{"summary":"Wallet balance is below the resolved funding amount","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"simulation":{"status":"failed","failure":{"code":"INSUFFICIENT_BALANCE","message":"The account balance is insufficient.","call_id":"call_1"}}}}},"capExceededFailure":{"summary":"Vault capacity is below the deposit amount","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"vault_v1.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"simulation":{"status":"failed","failure":{"code":"CAP_EXCEEDED","message":"The action would exceed a protocol cap.","call_id":"call_1"}}}}}},"schema":{"$ref":"#/components/schemas/VaultV1DepositResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Deposit400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Deposit403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The address is not a Vault V1 vault on that chain. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"vaultNotFound":{"summary":"The Vault V1 address was not found","description":"The selected address is not a supported vault.","value":{"error":{"code":"VAULT_NOT_FOUND","message":"The vault is not deployed by a registered Vault V1 factory.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Deposit404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Deposit413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The action or requested funding mode is not supported on this chain or vault, or the deposit amount rounds down to zero vault shares. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Vault V1 deposits.","details":null,"request_id":"req_0123456789abcdef"}}},"fundingUnsupported":{"summary":"The native funding cap cannot fund this action","description":"Retry with ERC-20 funding by setting `funding.type` to `erc20`, or select `native`/`auto` with a cap covering the full action amount.","value":{"error":{"code":"FUNDING_UNSUPPORTED","message":"Unsupported funding mode.","details":[{"code":"custom","message":"The native funding cap is below the action amount","path":["funding","max_native_assets"]}],"request_id":"req_0123456789abcdef"}}},"amountTooSmall":{"summary":"The deposit amount rounds down to zero vault shares","description":"Increase the deposit amount so it mints at least one vault share.","value":{"error":{"code":"AMOUNT_TOO_SMALL","message":"The deposit amount rounds down to zero vault shares.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Deposit422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultV1Deposit500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The deposit cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"The vault state cannot be read right now.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Deposit503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/vaults-v1/{vault-selector}/withdraw":{"post":{"operationId":"buildVaultV1Withdraw","tags":["Vaults V1"],"summary":"Vault V1 Withdraw","description":"Build and simulate a Vault V1 exit. Set `amount` to `{ unit: \"assets\", value }`, `{ unit: \"shares\", value }`, or `{ unit: \"all\" }`. Only an assets amount accepts `slippage_bps`. The API enforces this bound while it builds the action, but on-chain execution does not.\n\nAfter the API returns the response, an assets withdrawal has no maximum-share guard. Later share-price changes can increase the shares that it burns. Share-based and `all` exits have no on-chain minimum-assets guarantee. The received amount can change until execution, up to `expires_at`. The wallet supplies vault shares and receives assets. Set `signature_mode` to request vault-share Permit typed data instead of an approval call when available.\n\nBefore POST, read the Vault V1 user position from the Morpho Read API (`/v0/vaults-v1/{vault}/users/{user}/position`): `max_withdraw_assets` with `max_withdraw_limited_by`. The bound is position when position assets are less than or equal to available vault liquidity (ties including 0/0), otherwise vault_liquidity. For a positive position, a quote of \"0\" means withdrawal is currently unavailable: do not send an assets amount of 0. For a positive quote, use `amount: {unit: \"all\"}` when `max_withdraw_limited_by` is position, otherwise use the quoted assets amount. Available vault liquidity can change before the API builds the action. If the API rejects the quoted amount, read a new quote and retry.","parameters":[{"schema":{"$ref":"#/components/schemas/VaultV1Selector"},"required":true,"description":"Vault identifier formatted as <chain_id>:<vault_address>. Send the colon literally or as %3A. Mixed-case addresses must use a valid EIP-55 checksum.","name":"vault-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Withdraw an exact gross asset amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3}},"exactShares":{"summary":"Withdraw an exact vault-share amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"shares","value":"1000000000000000000"}}},"allShares":{"summary":"Withdraw the full vault-share balance","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"all"}}},"permitSignature":{"summary":"Use a vault-share Permit","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"signature_mode":"auto"}},"continuation":{"summary":"Continue with the collected Permit signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}},"referralFee":{"summary":"Withdraw with a referral fee","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"}}}},"schema":{"$ref":"#/components/schemas/VaultV1WithdrawRequest"}}}},"responses":{"200":{"description":"Withdrawal calls and simulation, or typed data to sign first.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"allowanceSufficient":{"summary":"Prepared using an existing sufficient allowance","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v1.withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"calls":[{"id":"call_0","kind":"vault_v1_withdraw","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x932084a8000000000000000000000000beef010f9cb27031ad51e3333f9af9c6b122818300000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28006ac7968c22221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"approvalRequired":{"summary":"Prepared with a persistent approval prerequisite","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v1.withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"calls":[{"id":"call_0","kind":"approval","to":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","data":"0x095ea7b30000000000000000000000002b08a911f48de25a7e305d910afb5597abe8ea7bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","value":"0"},{"id":"call_1","kind":"vault_v1_withdraw","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x932084a8000000000000000000000000beef010f9cb27031ad51e3333f9af9c6b122818300000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28006ac7968c22221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"permitRequired":{"summary":"Vault-share Permit signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"vault_v1.withdraw","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Permit","message":{"owner":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","spender":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"4000000000"}}}],"continuation":"continuation_from_previous_response","expires_at":4000000000}}},"failedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461740,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"action":"vault_v1.withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_1"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"failedShareSimulation":{"summary":"Prepared share exit rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1792522158,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"action":"vault_v1.withdraw","amount":{"unit":"shares","value":"1000000000000000000"},"share_decimals":18,"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_1"}},"resolved_amount":{"unit":"shares","value":"1000000000000000000"}}}},"referralFee":{"summary":"Prepared withdrawal with a referral fee","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeeF010f9cb27031ad51e3333f9aF9C6B1228183","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v1.withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"},"calls":[{"id":"call_0","kind":"vault_v1_withdraw","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x932084a8000000000000000000000000beef010f9cb27031ad51e3333f9af9c6b122818300000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28006ac7968c22221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"997500"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"2500","net_assets":"997500"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}}},"schema":{"$ref":"#/components/schemas/VaultV1WithdrawResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Withdraw400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Withdraw403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The address is not a Vault V1 vault on that chain. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"vaultNotFound":{"summary":"The Vault V1 address was not found","description":"The selected address is not a supported vault.","value":{"error":{"code":"VAULT_NOT_FOUND","message":"The vault is not deployed by a registered Vault V1 factory.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Withdraw404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Withdraw413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The requested Vault V1 exit is not supported. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Vault V1 exits.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Withdraw422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultV1Withdraw500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The Vault V1 exit cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"The vault state cannot be read right now.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV1Withdraw503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/vaults-v2/{vault-selector}/deposit":{"post":{"operationId":"buildVaultV2Deposit","tags":["Vaults V2"],"summary":"Vault V2 Deposit","description":"Build and simulate wallet calls for a deposit into an approved Morpho Vault V2 vault. The API returns the calls in sequence. Amounts use the vault asset's base units. The API does not support vaults that contain a Midnight adapter. That adapter accepts only self-allocation.\n\nFor wrapped-native vaults, set `funding.type` to `native`, `erc20`, or balance-based `auto`. The API does not support mixed funding. Use `signature_mode` to select prerequisite approval calls or automatic ERC-2612 signature selection.","parameters":[{"schema":{"$ref":"#/components/schemas/VaultV2Selector"},"required":true,"description":"Vault identifier formatted as <chain_id>:<vault_address>. Send the colon literally or as %3A. Mixed-case addresses must use a valid EIP-55 checksum.","name":"vault-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Deposit an exact asset amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"erc20"}}},"nativeFunding":{"summary":"Deposit with native currency","description":"Available when the selected vault asset is the chain's registered wrapped-native asset.","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"native","max_native_assets":"1000000"}}},"autoFunding":{"summary":"Select deposit funding from the wallet balance","description":"Available when the selected vault asset is the chain's registered wrapped-native asset.","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"auto","max_native_assets":"1000000"}}},"referralFee":{"summary":"Deposit with a referral fee","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"erc20"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"}}},"continuation":{"summary":"Continue with the collected signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}},"signatureMode":{"summary":"Automatically select ERC-2612 signatures or approval calls","value":{"signature_mode":"auto","account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"funding":{"type":"erc20"}}}},"schema":{"$ref":"#/components/schemas/VaultV2DepositRequest"}}}},"responses":{"200":{"description":"Deposit calls and simulation, or typed data to sign first.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared deposit with a successful simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"vault_v2.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461741,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000002b08a911f48de25a7e305d910afb5597abe8ea7b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"vault_v2_deposit","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x6bbba4e0000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c900000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000003b9bd6e4d7e0500000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac7896d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac76d4e22221111","value":"0"}],"simulation":{"status":"success","block":{"number":"52332598","timestamp":1791454543},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"vault_shares":"958386138112080689"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}}}}},"referralFee":{"summary":"Prepared deposit with a referral fee","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"vault_v2.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461741,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"},"calls":[{"id":"call_0","kind":"approval","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x095ea7b30000000000000000000000002b08a911f48de25a7e305d910afb5597abe8ea7b00000000000000000000000000000000000000000000000000000000000f4240","value":"0"},{"id":"call_1","kind":"vault_v2_deposit","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x6bbba4e0000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c900000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000003b9bd6e4d7e0500000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000008e1bc9bf040000000000000000000000000003000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000006ac7896d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000006ac76d4f22221111","value":"0"}],"simulation":{"status":"success","block":{"number":"52332598","timestamp":1791454543},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"-1000000"}],"position_changes":{"vault_shares":"955990172766800487"},"effects":{"gross_assets":"1000000","referral_fee_assets":"2500","net_assets":"997500"}}}}},"signatureRequired":{"summary":"Typed-data signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"vault_v2.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"name":"USD Coin","version":"2","chainId":8453,"verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"message":{"owner":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","spender":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","value":"1000000","nonce":"106","deadline":"1791455112"},"primaryType":"Permit"}}],"continuation":"continuation_from_previous_response","expires_at":1791455112}}},"insufficientBalanceFailure":{"summary":"Wallet balance is below the resolved funding amount","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"simulation_failed","action":"vault_v2.deposit","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461741,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"slippage_bps":50,"resolved_funding":{"wrapped_asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","max_native_assets":"0","erc20_assets":"1000000","native_assets":"0"},"simulation":{"status":"failed","failure":{"code":"INSUFFICIENT_BALANCE","message":"The account balance is insufficient.","call_id":"call_1"}}}}}},"schema":{"$ref":"#/components/schemas/VaultV2DepositResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Deposit400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Deposit403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The address is not a Vault V2 vault on that chain. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"vaultNotFound":{"summary":"The Vault V2 address was not found","description":"The selected address is not a supported vault.","value":{"error":{"code":"VAULT_NOT_FOUND","message":"The vault is not deployed by the registered Vault V2 factory.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Deposit404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Deposit413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The action or requested funding mode is not supported on this chain or vault, or the deposit amount rounds down to zero vault shares. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Vault V2 deposits.","details":null,"request_id":"req_0123456789abcdef"}}},"fundingUnsupported":{"summary":"The native funding cap cannot fund this action","description":"Retry with ERC-20 funding by setting `funding.type` to `erc20`, or select `native`/`auto` with a cap covering the full action amount.","value":{"error":{"code":"FUNDING_UNSUPPORTED","message":"Unsupported funding mode.","details":[{"code":"custom","message":"The native funding cap is below the action amount","path":["funding","max_native_assets"]}],"request_id":"req_0123456789abcdef"}}},"amountTooSmall":{"summary":"The deposit amount rounds down to zero vault shares","description":"Increase the deposit amount so it mints at least one vault share.","value":{"error":{"code":"AMOUNT_TOO_SMALL","message":"The deposit amount rounds down to zero vault shares.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Deposit422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultV2Deposit500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The deposit cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"The vault state cannot be read right now.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Deposit503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/vaults-v2/{vault-selector}/withdraw":{"post":{"operationId":"buildVaultV2Withdraw","tags":["Vaults V2"],"summary":"Vault V2 Withdraw","description":"Build and simulate a Vault V2 exit. Set `amount` to `{ unit: \"assets\", value }`, `{ unit: \"shares\", value }`, or `{ unit: \"all\" }`. Only an assets amount accepts `slippage_bps`. The API enforces this bound while it builds the action, but on-chain execution does not. The API does not support vaults that contain a Midnight adapter.\n\nAfter the API returns the response, an assets withdrawal has no maximum-share guard. Later share-price changes can increase the shares that it burns. Share-based and `all` exits have no on-chain minimum-assets guarantee. The received amount can change until execution, up to `expires_at`.\n\nNormal exits cannot exceed the vault's currently available assets. These include its idle assets plus assets that its liquidity adapter can withdraw. A larger exit returns 422 INSUFFICIENT_LIQUIDITY, with the currently withdrawable amount in `details`. Use force-withdraw or redeem-in-kind where the vault supports them.\n\nThe wallet supplies vault shares and receives assets. Set `signature_mode` to request vault-share Permit typed data instead of an approval call when available.\n\nBefore POST, read the Vault V2 user position from the Morpho Read API (`/v0/vaults-v2/{vault}/users/{user}/position`): `max_withdraw_assets` with `max_withdraw_limited_by`. The bound is position when position assets are less than or equal to available vault liquidity (ties including 0/0), otherwise vault_liquidity. A null quote means the limit is unknown: do not build a MAX amount from it or send null as an assets value. The bound is null exactly when the quote is null. V2 quotes compare accrued position assets with idle assets plus liquidity-adapter available assets. For a positive position, a quote of \"0\" means withdrawal is currently unavailable: do not send an assets amount of 0. For a positive quote, use `amount: {unit: \"all\"}` when `max_withdraw_limited_by` is position, otherwise use the quoted assets amount. Available vault liquidity can change before the API builds the action. If the API rejects the quoted amount, read a new quote and retry.","parameters":[{"schema":{"$ref":"#/components/schemas/VaultV2Selector"},"required":true,"description":"Vault identifier formatted as <chain_id>:<vault_address>. Send the colon literally or as %3A. Mixed-case addresses must use a valid EIP-55 checksum.","name":"vault-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Withdraw an exact gross asset amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3}},"exactShares":{"summary":"Withdraw an exact vault-share amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"shares","value":"500000000000000000"}}},"allShares":{"summary":"Withdraw the full vault-share balance","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"all"}}},"permitSignature":{"summary":"Use a vault-share Permit","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"signature_mode":"auto"}},"continuation":{"summary":"Continue with the collected Permit signature","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}},"referralFee":{"summary":"Withdraw with a referral fee","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"}}}},"schema":{"$ref":"#/components/schemas/VaultV2WithdrawRequest"}}}},"responses":{"200":{"description":"Withdrawal calls and simulation, or typed data to sign first.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"allowanceSufficient":{"summary":"Prepared with an existing sufficient allowance","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v2.withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"calls":[{"id":"call_0","kind":"vault_v2_withdraw","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x932084a8000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c900000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28006ac7919522221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"approvalRequired":{"summary":"Prepared with a persistent approval prerequisite","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461742,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"calls":[{"id":"call_0","kind":"approval","to":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","data":"0x095ea7b30000000000000000000000002b08a911f48de25a7e305d910afb5597abe8ea7bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","value":"0"},{"id":"call_1","kind":"vault_v2_withdraw","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x932084a8000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c900000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac7896e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac7896e6ac76d4f22221111","value":"0"}],"action":"vault_v2.withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"simulation":{"status":"success","block":{"number":"52332598","timestamp":1791454543},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1000000"}],"position_changes":{"vault_shares":"-958386138112080690"},"effects":{"gross_assets":"1000000","referral_fee_assets":"0","net_assets":"1000000"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"exactShares":{"summary":"Prepared exact-share withdrawal","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791462060,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"calls":[{"id":"call_0","kind":"approval","to":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","data":"0x095ea7b30000000000000000000000002b08a911f48de25a7e305d910afb5597abe8ea7bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","value":"0"},{"id":"call_1","kind":"vault_v2_redeem","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x932084a8000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac78aac00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac78aac6ac76e8d22221111","value":"0"}],"action":"vault_v2.withdraw","amount":{"unit":"shares","value":"500000000000000000"},"share_decimals":18,"simulation":{"status":"success","block":{"number":"52332757","timestamp":1791454861},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"521710"}],"position_changes":{"vault_shares":"-500000000000000000"},"effects":{"gross_assets":"521710","referral_fee_assets":"0","net_assets":"521710"}},"resolved_amount":{"unit":"shares","value":"500000000000000000"}}}},"allShares":{"summary":"Prepared full-position withdrawal","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461743,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"calls":[{"id":"call_0","kind":"approval","to":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","data":"0x095ea7b30000000000000000000000002b08a911f48de25a7e305d910afb5597abe8ea7bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","value":"0"},{"id":"call_1","kind":"vault_v2_redeem","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x932084a8000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f31e5cbb8f3f54400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac7896f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac7896f6ac76d5022221111","value":"0"}],"action":"vault_v2.withdraw","amount":{"unit":"all"},"share_decimals":18,"simulation":{"status":"success","block":{"number":"52332599","timestamp":1791454545},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"1142450"}],"position_changes":{"vault_shares":"-1094908847571858756"},"effects":{"gross_assets":"1142450","referral_fee_assets":"0","net_assets":"1142450"}},"resolved_amount":{"unit":"shares","value":"1094908847571858756"}}}},"permitRequired":{"summary":"Vault-share Permit signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"vault_v2.withdraw","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Permit","message":{"owner":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","spender":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"4000000000"}}}],"continuation":"continuation_from_previous_response","expires_at":4000000000}}},"failedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"simulation_failed","action":"vault_v2.withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"referralFee":{"summary":"Prepared withdrawal with a referral fee","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v2.withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"},"calls":[{"id":"call_0","kind":"vault_v2_withdraw","to":"0x2B08A911f48dE25A7e305D910Afb5597aBE8ea7B","data":"0x932084a8000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c900000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28006ac7919522221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"997500"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"gross_assets":"1000000","referral_fee_assets":"2500","net_assets":"997500"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}}},"schema":{"$ref":"#/components/schemas/VaultV2WithdrawResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Withdraw400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Withdraw403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The address is not a Vault V2 vault on that chain. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"vaultNotFound":{"summary":"The Vault V2 address was not found","description":"The selected address is not a supported vault.","value":{"error":{"code":"VAULT_NOT_FOUND","message":"The vault is not deployed by the registered Vault V2 factory.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Withdraw404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Withdraw413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The requested Vault V2 exit is not supported or exceeds currently withdrawable liquidity (INSUFFICIENT_LIQUIDITY). Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Vault V2 exits.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Withdraw422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultV2Withdraw500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The Vault V2 exit cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"The vault state cannot be read right now.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2Withdraw503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/vaults-v2/{vault-selector}/force-withdraw":{"post":{"operationId":"buildVaultV2ForceWithdraw","tags":["Vaults V2"],"summary":"Vault V2 Force-Withdraw","description":"Build and simulate Vault V2 force exits when the vault lacks idle liquidity. The API does not support vaults that contain a Midnight adapter. Set `amount` to `{ unit: \"assets\", value }` for an exact asset amount. For the full position, set it to `{ unit: \"all\" }` with `max_penalty_bps`. If the API cannot safely plan a full exit within `max_penalty_bps`, it returns `ACTION_UNSUPPORTED` (422). In that case, retry with an assets amount.\n\nThe exit can incur a force-deallocate penalty, which `simulation.effects.penalty_assets` reports. For an `amount: { unit: \"all\" }` request, `residual_shares` is the planned vault shares that remain after the all-position force-redeem. `simulation.effects.remaining_shares` reports the vault shares that the simulation left in the wallet. These values can differ slightly.\n\nFor an assets amount, the returned force-withdraw call reverts after `expires_at`. For `{ unit: \"all\" }`, `expires_at` specifies when the off-chain response expires. The returned force-redeem multicall has no on-chain deadline. Set `signature_mode` to request vault-share Permit typed data instead of an approval call when available.","parameters":[{"schema":{"$ref":"#/components/schemas/VaultV2Selector"},"required":true,"description":"Vault identifier formatted as <chain_id>:<vault_address>. Send the colon literally or as %3A. Mixed-case addresses must use a valid EIP-55 checksum.","name":"vault-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Force withdraw a penalty-inclusive asset amount","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3}},"allShares":{"summary":"Force withdraw the full position within a penalty limit","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"all"},"max_penalty_bps":200}},"permitSignature":{"summary":"Use a vault-share Permit","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"signature_mode":"auto"}},"continuation":{"summary":"Continue with the collected Permit","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}}},"schema":{"$ref":"#/components/schemas/VaultV2ForceWithdrawRequest"}}}},"responses":{"200":{"description":"A vault-share signature request or prepared, simulated force withdrawal.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"allowanceSufficient":{"summary":"Prepared with an existing vault-share allowance","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v2.force_withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"calls":[{"id":"call_0","kind":"vault_v2_force_withdraw","to":"0xE52E169C342C096C4949ABb944DC9f30E3F5Ea84","data":"0x902118db000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c9000000000000000000000000fdd31cdf6712c47a4e67037d9f2e35587f5404c000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b2800","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"990000"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"received_assets":"990000","referral_fee_assets":"0","penalty_assets":"10000","remaining_shares":"10"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"fullPosition":{"summary":"Prepared full-position force exit","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v2.force_withdraw","amount":{"unit":"all"},"calls":[{"id":"call_0","kind":"vault_v2_force_redeem","to":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","data":"0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000064ba08765200000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000545b6cc751f0c47c202694cf835db2e3c071400a000000000000000000000000545b6cc751f0c47c202694cf835db2e3c071400a00000000000000000000000000000000000000000000000000000000","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"990000"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"received_assets":"990000","penalty_assets":"10000","remaining_shares":"10"}},"share_decimals":18,"residual_shares":"10","planned_penalty_assets":"10000","planned_penalty_shares":"10000","planned_redeem_assets":"980000","max_penalty_bps":200,"resolved_amount":{"unit":"shares","value":"1000000"}}}},"approvalRequired":{"summary":"Prepared with a persistent vault-share approval","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v2.force_withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"calls":[{"id":"call_0","kind":"approval","to":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","data":"0x095ea7b3000000000000000000000000e52e169c342c096c4949abb944dc9f30e3f5ea84ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","value":"0"},{"id":"call_1","kind":"vault_v2_force_withdraw","to":"0xE52E169C342C096C4949ABb944DC9f30E3F5Ea84","data":"0x902118db000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c9000000000000000000000000fdd31cdf6712c47a4e67037d9f2e35587f5404c000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b2800","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"990000"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"received_assets":"990000","referral_fee_assets":"0","penalty_assets":"10000","remaining_shares":"10"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"permitRequired":{"summary":"Vault-share Permit signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"vault_v2.force_withdraw","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Permit","message":{"owner":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","spender":"0xE52E169C342C096C4949ABb944DC9f30E3F5Ea84","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"4000000000"}}}],"continuation":"continuation_from_previous_response","expires_at":4000000000}}},"preparedContinuation":{"summary":"Prepared after the signature continuation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v2.force_withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"calls":[{"id":"call_0","kind":"vault_v2_force_withdraw","to":"0xE52E169C342C096C4949ABb944DC9f30E3F5Ea84","data":"0x902118db000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c9000000000000000000000000fdd31cdf6712c47a4e67037d9f2e35587f5404c000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b2800","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"990000"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"received_assets":"990000","referral_fee_assets":"0","penalty_assets":"10000","remaining_shares":"10"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"referralFee":{"summary":"Prepared with a referral fee","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v2.force_withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"referral_fee":{"bps":25,"recipient":"0x3000000000000000000000000000000000000003"},"calls":[{"id":"call_0","kind":"vault_v2_force_withdraw","to":"0xE52E169C342C096C4949ABb944DC9f30E3F5Ea84","data":"0x902118db000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c9000000000000000000000000fdd31cdf6712c47a4e67037d9f2e35587f5404c000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b2800","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"987525"}],"position_changes":{"vault_shares":"-1000000"},"effects":{"received_assets":"987525","referral_fee_assets":"2475","penalty_assets":"10000","remaining_shares":"10"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}},"failedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"simulation_failed","action":"vault_v2.force_withdraw","amount":{"unit":"assets","value":"1000000"},"slippage_bps":3,"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}},"resolved_amount":{"unit":"assets","value":"1000000"}}}}},"schema":{"$ref":"#/components/schemas/VaultV2ForceWithdrawResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2ForceWithdraw400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}},"counterpartyNotServed":{"value":{"error":{"code":"COUNTERPARTY_NOT_SERVED","message":"This request can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2ForceWithdraw403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The address is not a Vault V2 vault on that chain. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"vaultNotFound":{"summary":"The Vault V2 address was not found","description":"The selected address is not a supported vault.","value":{"error":{"code":"VAULT_NOT_FOUND","message":"The vault is not deployed by the registered Vault V2 factory.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2ForceWithdraw404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2ForceWithdraw413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The API does not support the requested Vault V2 force exit. VAULT_UNSUPPORTED can also indicate an unsupported configuration of the vault's liquidity adapter, including for an all-position exit. The error message identifies the cause.\n\nFor that configuration error, use another exit method. Alternatively, ask the vault curator to update its liquidity adapter and data. No Vault V2 exit currently supports a vault that contains a Midnight adapter. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Vault V2 force exits.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2ForceWithdraw422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultV2ForceWithdraw500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The Vault V2 exit cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"The vault state cannot be read right now.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2ForceWithdraw503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}},"/v0/actions/vaults-v2/{vault-selector}/redeem-in-kind":{"post":{"operationId":"buildVaultV2InKindRedeem","tags":["Vaults V2"],"summary":"Vault V2 Redeem In-Kind","description":"Build and simulate an exact Vault V2 exit. It returns idle assets to the wallet and supplies the illiquid portion into one caller-selected Morpho Blue market. The API does not support vaults that contain a Midnight adapter. The simulation reports the idle/in-kind split and the current force-deallocate penalty in `simulation.effects.penalty_assets`. The vault recomputes both at execution before `expires_at`.\n\nWhen the current penalty is below 2% and its setter is not abdicated, include `max_penalty_bps` that covers a 2% penalty. This requirement applies regardless of the setter's timelock. If the required cap is absent or below the worst case for the whole exit, the API returns 422 ACTION_UNSUPPORTED. The API checks the cap on preparation and each continuation, never at execution. The bundle accepts no penalty bound. A penalty change already in the queue can exceed the cap at execution.\n\nThe vault must allocate the selected market with enough capacity. Not every vault supports this route. Set `amount` to the exact amount to exit. The API does not silently reduce it. Set `signature_mode` to request a vault-share Permit when available.","parameters":[{"schema":{"$ref":"#/components/schemas/VaultV2Selector"},"required":true,"description":"Vault identifier formatted as <chain_id>:<vault_address>. Send the colon literally or as %3A. Mixed-case addresses must use a valid EIP-55 checksum.","name":"vault-selector","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"examples":{"exactAssets":{"summary":"Redeem into a selected Morpho Blue market","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"market":"8453:0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","max_penalty_bps":200}},"permitSignature":{"summary":"Use a vault-share Permit","value":{"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","amount":{"unit":"assets","value":"1000000"},"market":"8453:0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","max_penalty_bps":200,"signature_mode":"auto"}},"continuation":{"summary":"Continue with the collected Permit","value":{"continuation":"continuation_from_previous_response","signatures":[{"id":"signature_0","signature":"0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}]}}},"schema":{"$ref":"#/components/schemas/VaultV2InKindRedeemRequest"}}}},"responses":{"200":{"description":"A vault-share signature request or prepared, simulated in-kind redemption.","headers":{"Morpho-Action-Proof":{"$ref":"#/components/headers/MorphoActionProof","required":true},"X-Request-Id":{"$ref":"#/components/headers/RequestId"},"Server-Timing":{"$ref":"#/components/headers/ServerTiming"},"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}}},"content":{"application/json":{"examples":{"prepared":{"summary":"Prepared in-kind redemption","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"prepared","action":"vault_v2.redeem_in_kind","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":1791461744,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"calls":[{"id":"call_0","kind":"approval","to":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","data":"0x095ea7b3000000000000000000000000e52e169c342c096c4949abb944dc9f30e3f5ea84ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","value":"0"},{"id":"call_1","kind":"vault_v2_in_kind_redeem","to":"0xE52E169C342C096C4949ABb944DC9f30E3F5Ea84","data":"0x3debf2f0000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c9000000000000000000000000fdd31cdf6712c47a4e67037d9f2e35587f5404c0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac78970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006ac789700000000000000000000000000000000000000000000000000000000000000001000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600006ac76d5122221111","value":"0"}],"simulation":{"status":"success","block":{"number":"52332599","timestamp":1791454545},"wallet_changes":[],"position_changes":{"vault_shares":"-958386135494236729","market_supply_shares":"902129516314"},"effects":{"wallet_assets":"0","supplied_assets":"999990","penalty_assets":"10"}}}}},"approvalRequired":{"summary":"Prepared with a persistent vault-share approval","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v2.redeem_in_kind","market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"calls":[{"id":"call_0","kind":"approval","to":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","data":"0x095ea7b3000000000000000000000000e52e169c342c096c4949abb944dc9f30e3f5ea84ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","value":"0"},{"id":"call_1","kind":"vault_v2_in_kind_redeem","to":"0xE52E169C342C096C4949ABb944DC9f30E3F5Ea84","data":"0x3debf2f0000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c9000000000000000000000000fdd31cdf6712c47a4e67037d9f2e35587f5404c0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600006ac791d122221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"250000"}],"position_changes":{"vault_shares":"-1000000","market_supply_shares":"740000"},"effects":{"wallet_assets":"250000","supplied_assets":"742500","penalty_assets":"7500"}}}}},"permitRequired":{"summary":"Vault-share Permit signature required","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","status":"signature_required","action":"vault_v2.redeem_in_kind","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","signatures":[{"id":"signature_0","kind":"permit","typed_data":{"domain":{"chainId":8453,"verifyingContract":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9"},"types":{"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]},"primaryType":"Permit","message":{"owner":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","spender":"0xE52E169C342C096C4949ABb944DC9f30E3F5Ea84","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"4000000000"}}}],"continuation":"continuation_from_previous_response","expires_at":4000000000}}},"permitPrepared":{"summary":"Prepared after the signature continuation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"prepared","action":"vault_v2.redeem_in_kind","market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"calls":[{"id":"call_0","kind":"vault_v2_in_kind_redeem","to":"0xE52E169C342C096C4949ABb944DC9f30E3F5Ea84","data":"0x3debf2f0000000000000000000000000beef0e0834849acc03f0089f01f4f1eeb06873c9000000000000000000000000fdd31cdf6712c47a4e67037d9f2e35587f5404c0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee6b28000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000663becd10dae6c4a3dcd89f1d76c1174199639b900000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600006ac791d122221111","value":"0"}],"simulation":{"status":"success","block":{"number":"21000000","timestamp":1760000000},"wallet_changes":[{"asset":{"type":"erc20","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"difference":"250000"}],"position_changes":{"vault_shares":"-1000000","market_supply_shares":"740000"},"effects":{"wallet_assets":"250000","supplied_assets":"742500","penalty_assets":"7500"}}}}},"failedSimulation":{"summary":"Prepared calls rejected by simulation","value":{"data":{"action_id":"act_0123456789abcdef0123456789abcdef","chain_id":8453,"account":"0x545b6Cc751F0C47C202694cf835db2E3C071400A","expires_at":4000000000,"vault":{"address":"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9","asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"status":"simulation_failed","action":"vault_v2.redeem_in_kind","market":{"id":"0x9103c3b4e834476c9a62ea009ba2c884ee42e94e6e314a26f04d312434191836","loan_asset":{"address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}},"amount":{"unit":"assets","value":"1000000"},"simulation":{"status":"failed","failure":{"code":"EXECUTION_REVERTED","message":"The action would revert in simulation.","call_id":"call_0"}}}}}},"schema":{"$ref":"#/components/schemas/VaultV2InKindRedeemResponse"}}}},"400":{"description":"The request is malformed or carries unsupported fields. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"validationFailed":{"summary":"The request contains an invalid amount","description":"The amount must be a positive decimal string that fits uint256.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a positive decimal string","path":["amount","value"]},{"code":"custom","message":"Expected an amount that fits in uint256","path":["amount","value"]}],"request_id":"req_0123456789abcdef"}}},"invalidAddress":{"summary":"The wallet is not a valid EVM address","description":"The wallet must be a valid 20-byte EVM address.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_format","message":"Expected a 20-byte EVM address","path":["account"]},{"code":"custom","message":"Expected a valid EVM address","path":["account"]}],"request_id":"req_0123456789abcdef"}}},"invalidJson":{"summary":"The request body is not valid UTF-8 JSON","description":"The request body must be valid UTF-8 JSON.","value":{"error":{"code":"VALIDATION_FAILED","message":"Validation failed","details":[{"code":"invalid_json","message":"Expected valid UTF-8 JSON","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2InKindRedeem400ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"403":{"description":"The initial request cannot be served. No reason is disclosed. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"accountNotServed":{"value":{"error":{"code":"ACCOUNT_NOT_SERVED","message":"This account can't be served.","details":null,"request_id":"req_0123456789abcdef0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2InKindRedeem403ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"404":{"description":"The address is not a Vault V2 vault on that chain. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"vaultNotFound":{"summary":"The Vault V2 address was not found","description":"The selected address is not a supported vault.","value":{"error":{"code":"VAULT_NOT_FOUND","message":"The vault is not deployed by the registered Vault V2 factory.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2InKindRedeem404ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"413":{"description":"The request exceeds the route limit. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"payloadTooLarge":{"summary":"The request body exceeds the size limit","description":"Request bodies must not exceed 16384 bytes.","value":{"error":{"code":"PAYLOAD_TOO_LARGE","message":"Request body too large.","details":[{"code":"too_big","message":"Request body exceeds the 16384-byte limit","path":["body"]}],"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2InKindRedeem413ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"422":{"description":"The requested Vault V2 in-kind redemption is not supported. ACTION_UNSUPPORTED is returned before preparation when a nonzero remainder above idle assets rounds to zero supplied assets after the force-deallocate penalty. Idle-only exits remain supported; the requested amount is never silently reduced. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"signatureRefreshRequired":{"summary":"The submitted signature must be refreshed","description":"Restart the same action without the continuation, sign the newly returned typed data, then finalize with the new continuation.","value":{"error":{"code":"SIGNATURE_REFRESH_REQUIRED","message":"The prepared signature nonce or deadline is no longer usable.","details":null,"request_id":"req_0123456789abcdef"}}},"continuationInvalid":{"summary":"The action continuation is invalid or expired","description":"Restart the action without the continuation.","value":{"error":{"code":"ACTION_CONTINUATION_INVALID","message":"The action continuation is invalid or expired.","details":null,"request_id":"req_0123456789abcdef"}}},"actionUnsupported":{"summary":"The selected chain is not supported for this action","description":"This action is unavailable on the selected chain.","value":{"error":{"code":"ACTION_UNSUPPORTED","message":"The chain does not support Vault V2 in-kind redemption.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2InKindRedeem422ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"429":{"description":"Rate limit exceeded at the API gateway. Retry after the `Retry-After` header (seconds).","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"500":{"description":"An unexpected error occurred. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VaultV2InKindRedeem500ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}},"503":{"description":"The Vault V2 exit cannot be prepared right now. Future versions can add codes. Treat unknown codes as a generic failure for the HTTP status.","content":{"application/json":{"examples":{"stateUnavailable":{"summary":"Chain state is temporarily unavailable","description":"Chain state is temporarily unavailable. Retry the request.","value":{"error":{"code":"STATE_UNAVAILABLE","message":"The vault state cannot be read right now.","details":null,"request_id":"req_0123456789abcdef"}}},"requestTimeout":{"summary":"The request timed out","description":"The request exceeded the server timeout. Retry the request.","value":{"error":{"code":"SERVICE_UNAVAILABLE","message":"Request timed out. Please retry.","details":[{"code":"timeout","message":"Timed out after 10000ms","path":["request"]}],"request_id":"req_0123456789abcdef"}}},"verificationUnavailable":{"summary":"Action verification is temporarily unavailable","description":"Action verification is temporarily unavailable. Retry the request.","value":{"error":{"code":"VERIFICATION_UNAVAILABLE","message":"Action verification is temporarily unavailable.","details":null,"request_id":"req_0123456789abcdef"}}}},"schema":{"$ref":"#/components/schemas/VaultV2InKindRedeem503ErrorResponse"}}},"headers":{"Cache-Control":{"description":"Action responses are not cacheable.","required":true,"schema":{"type":"string","enum":["private, no-store, no-transform"]}},"X-Request-Id":{"$ref":"#/components/headers/RequestId"}}}}}}}}