{"components":{"schemas":{"AdjustQuote":{"properties":{"expiresAt":{"description":"Unix ms after which this quote must not be used.","type":"integer"},"quote":{"properties":{"borrowAmount":{"description":"Projected debt after the adjustment.","pattern":"^\\d+$","type":"string"},"delta":{"description":"Absolute collateral change, in base units.","pattern":"^\\d+$","type":"string"},"flashLoanFee":{"description":"Flash-loan fee in 1e18 fixed point. Absent when the route needs no flash loan.","pattern":"^\\d+$","type":"string"},"healthFactor":{"description":"Projected health factor after the operation. Below 1 the position is liquidatable.","type":"number"},"liquidationPrice":{"description":"Projected collateral price at which the position becomes liquidatable, as a decimal string with four fractional digits. A human-readable price, not base units. `\"0\"` when it cannot be computed.","pattern":"^\\d+(\\.\\d+)?$","type":"string"},"maxPossibleLeverage":{"description":"Realistic leverage cap given the live flash-loan fee and requested slippage, 1e18 fixed point. Absent on a pull, on a 1x push (a plain deposit with no flash loan), and when the fee or the strategy collateral factor is unknown; fall back to the strategy hard max.","pattern":"^\\d+$","type":"string"},"slippageApplied":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"}},"required":["borrowAmount","delta","healthFactor","liquidationPrice","slippageApplied"],"type":"object"},"quoteId":{"format":"uuid","type":"string"}},"required":["expiresAt","quote","quoteId"],"type":"object"},"BorrowQuote":{"properties":{"expiresAt":{"type":"integer"},"quote":{"properties":{"borrowed":{"description":"Amount borrowed, in borrow-token base units.","pattern":"^\\d+$","type":"string"},"healthFactor":{"description":"Projected health factor after the operation. Below 1 the position is liquidatable.","type":"number"},"liquidationPrice":{"description":"Projected collateral price at which the position becomes liquidatable, as a decimal string with four fractional digits. A human-readable price, not base units. `\"0\"` when it cannot be computed.","pattern":"^\\d+(\\.\\d+)?$","type":"string"}},"required":["borrowed","healthFactor","liquidationPrice"],"type":"object"},"quoteId":{"format":"uuid","type":"string"}},"required":["expiresAt","quote","quoteId"],"type":"object"},"BuildResult":{"properties":{"buildId":{"description":"Server-issued id for this build, on every `/build/*` response. `/simulate` answers with the same `buildId` when it is given these steps, so a build and its simulations share one key. On `/build/open`, `/build/adjust` and `/build/close` it is also the id of the recorded position event: echo it back when reporting a confirmed transaction so the event can be reconciled. A `dryRun` build records no event, so there it tracks the build only. `/build/borrow`, `/build/repay` and `/build/claim` record no position event, so their id tracks the build only. It is not what the expiry is checked against: `/simulate` matches the steps themselves.","format":"uuid","type":"string"},"dryRun":{"const":true,"description":"Present, and `true`, only on a response to a `dryRun: true` request. See `executable`.","type":"boolean"},"estimatedGas":{"description":"Per-step gas figure, positionally aligned with `steps`. This is what one execution measured, not a limit to send — use `suggestedGasLimit` for that, and do not derive a limit from this field by picking a multiplier of your own. Entries whose `gasEstimateSource` is `floor` are conservative lower bounds rather than measurements.","items":{"description":"Gas units.","pattern":"^\\d+$","type":"string"},"type":"array"},"executable":{"const":false,"description":"Present only on a dry run, and always `false` there: the steps were simulated against a balance the wallet does not have. Do not sign them; rebuild without `dryRun` once the wallet is funded.","type":"boolean"},"expiresAt":{"description":"Unix ms after which these steps must be rebuilt. 180 seconds from issue. Enforced: the server records it against these steps, and `/simulate` answers 410 `build_expired` past it.","type":"integer"},"fundingOverride":{"description":"Dry run only. The balance the simulation gave the wallet, or `null` when the batch pulls nothing from it (an auto repay). `applied: false` means the token’s balance could not be overridden, so the simulation ran on the real balance and is expected to revert at the pull.","nullable":true,"properties":{"amount":{"description":"Base units the wallet was funded with.","pattern":"^\\d+$","type":"string"},"applied":{"type":"boolean"},"token":{"description":"Token funded; the native-currency sentinel for a native `tokenIn`.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"type":"object"},"gasEstimateSource":{"description":"Provenance of each `estimatedGas` entry, positionally aligned with it. `measured` is a real `eth_estimateGas` result; an `execute` that depends on an approve which has not been mined is still measured, by re-estimating it with the allowance the build's own approve step is about to grant. `floor` means the step could not be estimated even that way — an SCA that is not yet deployed is the usual case, since the call target has no code — so the number is a conservative lower bound for that step kind rather than a measurement. An `approve` raising an allowance behind its own reset step is floored too, since it cannot run until the reset is mined. Either way, prefer `suggestedGasLimit` when sizing the transaction: an over-reserved gas limit is refunded, an under-reserved one burns the whole fee and reverts as an out-of-gas inner call, which surfaces as a protocol error rather than as a gas problem.","items":{"enum":["measured","floor"],"type":"string"},"type":"array"},"refund":{"description":"Deposit-token amount the build actually pays out. Present on payout builds (auto-repay) only.","properties":{"amount":{"description":"Amount actually released.","pattern":"^\\d+$","type":"string"},"bounded":{"description":"True when `amount` was clamped below `requested` by the collateral bound — render the shortfall rather than the request.","type":"boolean"},"requested":{"description":"Amount originally requested.","pattern":"^\\d+$","type":"string"},"token":{"description":"Token paid out.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["amount","bounded","requested","token"],"type":"object"},"simulation":{"description":"Dry run only. `passed` carries `results`, one per step. Each clean step’s `assetChanges` is `{ assetChanges: { spend, receive }, approvals, assetChangesIncomplete? }`: what the EOA spends and receives and the allowances it grants in that step, the expected outputs. `assetChangesIncomplete: true` means those lists may be partial. `reverted` adds `stepIndex`, `kind`, `label` and `revertReason`/`decoded` when the revert could be named. `unavailable` carries `reason`: `rate_limited`, `budget`, `simulator` or `incomplete`; the steps are still returned.","properties":{"decoded":{},"kind":{"enum":["approve","sca-deploy","execute"],"type":"string"},"label":{"type":"string"},"reason":{"enum":["budget","incomplete","rate_limited","simulator"],"type":"string"},"results":{"items":{"type":"object"},"type":"array"},"revertReason":{"type":"string"},"status":{"enum":["passed","reverted","unavailable"],"type":"string"},"stepIndex":{"type":"integer"}},"type":"object"},"steps":{"items":{"description":"One unsigned transaction. Send in array order; each step must confirm before the next is sent.","properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"data":{"description":"Calldata, 0x-prefixed hex.","pattern":"^0x[0-9a-fA-F]*$","type":"string"},"kind":{"description":"`sca-deploy` deploys or installs a module on the smart account, `approve` grants an ERC-20 allowance (two in a row when a stale non-zero allowance is first reset to zero, which tokens such as USDT require), `execute` performs the Loopr operation.","enum":["sca-deploy","approve","execute"],"type":"string"},"label":{"description":"Human-readable step description, safe to show in a UI.","type":"string"},"to":{"description":"Destination contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"value":{"description":"Native value to send with the call, in wei.","pattern":"^\\d+$","type":"string"}},"required":["chainId","data","kind","label","to","value"],"type":"object"},"type":"array"},"suggestedGasLimit":{"description":"The gas limit to put on each transaction, positionally aligned with `steps`. Buffer already applied — this is a number to use, not one to multiply. Prefer it over `estimatedGas` when sizing a transaction: an estimate is what one execution measured, a limit is what you are willing to spend, and picking your own multiplier off the estimate is where builds run out of gas mid-batch and burn the fee.","items":{"description":"Gas units.","pattern":"^\\d+$","type":"string"},"type":"array"}},"required":["buildId","estimatedGas","expiresAt","steps"],"type":"object"},"ClaimQuote":{"description":"Discriminated on `quote.mode`. `compound` additionally carries per-reward swap projections.","properties":{"expiresAt":{"type":"integer"},"quote":{"discriminator":{"propertyName":"mode"},"oneOf":[{"properties":{"mode":{"const":"send","type":"string"},"rewards":{"items":{"type":"object"},"type":"array"}},"required":["mode","rewards"],"type":"object"},{"properties":{"depositAmount":{"description":"Gross, pre-slippage upper bound on the deposit-token added to the position. The build applies slippage per swap and drops unroutable rewards, so the realized deposit is at most this value. An optimistic estimate, never a guaranteed minimum.","pattern":"^\\d+$","type":"string"},"mode":{"const":"compound","type":"string"},"projections":{"items":{"type":"object"},"type":"array"},"rewards":{"items":{"type":"object"},"type":"array"},"slippageApplied":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"}},"required":["depositAmount","mode","projections","rewards","slippageApplied"],"type":"object"}]},"quoteId":{"format":"uuid","type":"string"}},"required":["expiresAt","quote","quoteId"],"type":"object"},"CloseQuote":{"properties":{"expiresAt":{"type":"integer"},"quote":{"properties":{"borrowedAmount":{"description":"Outstanding debt being repaid.","pattern":"^\\d+$","type":"string"},"borrowToken":{"description":"Debt token repaid on close.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"depositedAmount":{"description":"Collateral currently in the position.","pattern":"^\\d+$","type":"string"},"depositToken":{"description":"Collateral token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"estimatedReceiving":{"description":"Estimated amount the user receives, in `receiveToken` base units.","pattern":"^\\d+$","type":"string"},"flashBorrowToken":{"description":"Token flash-borrowed to unwind.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"flashLoanAmount":{"description":"Flash loan principal.","pattern":"^\\d+$","type":"string"},"flashLoanRepayAmount":{"description":"Flash loan principal plus fee.","pattern":"^\\d+$","type":"string"},"slippageApplied":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"transferOutAmount":{"description":"Amount transferred out to the user.","pattern":"^\\d+$","type":"string"}},"required":["borrowToken","borrowedAmount","depositToken","depositedAmount","estimatedReceiving","flashBorrowToken","flashLoanAmount","flashLoanRepayAmount","slippageApplied","transferOutAmount"],"type":"object"},"quoteId":{"format":"uuid","type":"string"}},"required":["expiresAt","quote","quoteId"],"type":"object"},"OpenQuote":{"properties":{"expiresAt":{"type":"integer"},"quote":{"properties":{"expectedCollateral":{"description":"Projected collateral after looping, in deposit-token base units.","pattern":"^\\d+$","type":"string"},"expectedDebt":{"description":"Projected debt, in borrow-token base units.","pattern":"^\\d+$","type":"string"},"flashLoanFee":{"description":"Flash-loan fee in 1e18 fixed point. Absent when the quote path did not surface one.","pattern":"^\\d+$","type":"string"},"healthFactor":{"description":"Projected health factor after the operation. Below 1 the position is liquidatable.","type":"number"},"liquidationPrice":{"description":"Projected collateral price at which the position becomes liquidatable, as a decimal string with four fractional digits. A human-readable price, not base units. `\"0\"` when it cannot be computed.","pattern":"^\\d+(\\.\\d+)?$","type":"string"},"maxPossibleLeverage":{"description":"Realistic leverage cap given the live flash-loan fee and requested slippage, 1e18 fixed point.","pattern":"^\\d+$","type":"string"},"slippageApplied":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"}},"required":["expectedCollateral","expectedDebt","healthFactor","liquidationPrice","slippageApplied"],"type":"object"},"quoteId":{"format":"uuid","type":"string"}},"required":["expiresAt","quote","quoteId"],"type":"object"},"Position":{"description":"An open Loopr position. Amounts are base-unit decimal strings; `healthFactor` below 1 is liquidatable.","properties":{"address":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"availableLiquidity":{"description":"What can still be borrowed from the market, reallocatable liquidity included: `raw` in base units of the borrow asset, `scaled` in whole tokens, and its `symbol`. Same age as `utilization`.","properties":{"raw":{"description":"Base units of the borrow asset.","pattern":"^\\d+$","type":"string"},"scaled":{"type":"number"},"symbol":{"type":"string"}},"type":"object"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"healthFactor":{"type":"number"},"interestRate":{"description":"Borrow rate the position pays, as a percentage (`5.2` is 5.2%). Read live from chain on every request; see `interestRateAsOf`.","type":"number"},"interestRateAsOf":{"description":"Unix ms when `interestRate` was read: the time of this request. `Strategy.interestRate` is cached and carries its own `ratesAsOf`, so during a rate spike the two differ and this one is current.","type":"integer"},"liquidityAsOf":{"description":"Unix ms of the strategy reads `utilization` and `availableLiquidity` come from (the strategy’s `ratesAsOf`). They are not read live per position.","type":"integer"},"loopedApy":{"description":"Yield of the position at its own leverage, as a percentage, before the performance fee and rewards. Already net of the borrow cost: `(collateralApy - interestRate) * (leverage - 1) + collateralApy`. Negative when the borrow rate has overtaken the collateral yield. Mixes the live `interestRate` with a collateral APY cached for up to 30 minutes. `null` when an input could not be read.","nullable":true,"type":"number"},"netApy":{"description":"What the position earns, as a percentage: `loopedApy` less the performance fee, plus Merkl rewards leveraged to the position (`netApyRewardsApr`). Derived from `loopedApy`, not computed independently. The fee is charged only on a positive `loopedApy`, so when `loopedApy` is zero or negative and the strategy has no rewards, `netApy` equals `loopedApy` exactly. That is expected during a rate spike, not a copy error. Absent when the position’s strategy is not in the catalog or `loopedApy` is `null`.","type":"number"},"netApyRewardsApr":{"description":"Reward APR leveraged to the position (`rewardsLendApr * L + rewardsBorrowApr * (L - 1)`): the rewards term inside `netApy`.","type":"number"},"performanceFee":{"description":"Performance fee, percent, charged on a positive `loopedApy` only.","type":"number"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"},"utilization":{"description":"Borrow-market utilization as a 0..1 fraction (`0.925` is 92.5%). Near 1 the market’s rate curve steepens, which is what drives a borrow-rate spike. From the strategy catalog, not a live read: see `ratesAsOf` on a strategy and `liquidityAsOf` on a position.","type":"number"}},"type":"object"},"RepayQuote":{"description":"Discriminated on `quote.mode`.","properties":{"expiresAt":{"type":"integer"},"quote":{"discriminator":{"propertyName":"mode"},"oneOf":[{"properties":{"flashLoanAmount":{"description":"Flash loan principal.","pattern":"^\\d+$","type":"string"},"flashLoanRepayAmount":{"description":"Principal plus fee.","pattern":"^\\d+$","type":"string"},"healthFactor":{"description":"Projected health factor after the operation. Below 1 the position is liquidatable.","type":"number"},"liquidationPrice":{"description":"Projected collateral price at which the position becomes liquidatable, as a decimal string with four fractional digits. A human-readable price, not base units. `\"0\"` when it cannot be computed.","pattern":"^\\d+(\\.\\d+)?$","type":"string"},"mode":{"const":"auto","type":"string"},"repaid":{"description":"Debt repaid.","pattern":"^\\d+$","type":"string"},"slippageApplied":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"transferOutAmount":{"description":"Amount transferred to the user.","pattern":"^\\d+$","type":"string"},"withdrawn":{"description":"Collateral withdrawn to fund the repay.","pattern":"^\\d+$","type":"string"}},"required":["flashLoanAmount","flashLoanRepayAmount","healthFactor","liquidationPrice","mode","repaid","slippageApplied","transferOutAmount","withdrawn"],"type":"object"},{"properties":{"healthFactor":{"description":"Projected health factor after the operation. Below 1 the position is liquidatable.","type":"number"},"liquidationPrice":{"description":"Projected collateral price at which the position becomes liquidatable, as a decimal string with four fractional digits. A human-readable price, not base units. `\"0\"` when it cannot be computed.","pattern":"^\\d+(\\.\\d+)?$","type":"string"},"mode":{"const":"manual","type":"string"},"repaid":{"description":"Debt repaid from the user's own balance.","pattern":"^\\d+$","type":"string"}},"required":["healthFactor","liquidationPrice","mode","repaid"],"type":"object"}]},"quoteId":{"format":"uuid","type":"string"}},"required":["expiresAt","quote","quoteId"],"type":"object"},"Strategy":{"description":"A Loopr strategy: a (protocol, chain, collateral, debt) tuple with its live rates and limits.","properties":{"availableLiquidity":{"description":"What can still be borrowed from the market, reallocatable liquidity included: `raw` in base units of the borrow asset, `scaled` in whole tokens, and its `symbol`. Same age as `utilization`.","properties":{"raw":{"description":"Base units of the borrow asset.","pattern":"^\\d+$","type":"string"},"scaled":{"type":"number"},"symbol":{"type":"string"}},"type":"object"},"borrowAsset":{"properties":{"address":{"description":"Debt token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"decimals":{"type":"integer"},"symbol":{"type":"string"}},"type":"object"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"collaterals":{"properties":{"asset":{"properties":{"address":{"description":"Collateral token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"balance":{"description":"Owner balance of the collateral token. Present only when `?owner=` was supplied and the read succeeded.","pattern":"^\\d+$","type":"string"},"decimals":{"type":"integer"},"symbol":{"type":"string"}},"type":"object"}},"type":"object"},"interestRate":{"description":"Borrow rate at the lending market, as a percentage (`5.2` is 5.2%). Read from chain and cached server-side with the rest of the strategy list for up to two minutes; `ratesAsOf` says when it was read. A position reports its own `interestRate` from a separate, live read, so during a rate spike this figure lags the position’s; treat the position’s as current. It is a simple annual rate with no compounding. On Morpho, Euler V2, Compound V3 and LayerBank it is the market’s per-second rate multiplied out over the year the strategy contract uses: 365.25 days on Morpho and Euler V2 markets, 365 days on Compound V3 and LayerBank. Recomputing it from chain with the other year length is off by about 0.07% of the rate. A Synth strategy reports the synthetic asset’s annual rate as it is set, so no year length is involved.","type":"number"},"liquidity":{"description":"Raw market liquidity. `totalLiquidity` (base units of `borrowAsset`) is what can still be borrowed, reallocatable liquidity included; `currentUtilization` is the 0..1 utilization that `utilization` mirrors. As of `ratesAsOf`.","properties":{"currentUtilization":{"type":"number"},"totalLiquidity":{"description":"Borrowable now, in base units.","pattern":"^\\d+$","type":"string"}},"type":"object"},"protocol":{"description":"Lending protocol slug, e.g. `aave-v3`, `morpho`.","type":"string"},"ratesAsOf":{"description":"Unix ms when this strategy’s market reads started: `interestRate`, `collateralFactor`, `liquidity`, `utilization`, `availableLiquidity` and the rate leg of `estimatedAPY`. The strategy list is cached for up to two minutes, and longer while a refresh is failing, so this is how old those figures are. A position’s own `interestRate` is read live; compare its `interestRateAsOf`.","type":"integer"},"source":{"description":"`partner` for a strategy this integration created in the partner portal; `odyssey` for Odyssey’s catalog.","enum":["odyssey","partner"],"type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"},"utilization":{"description":"Borrow-market utilization as a 0..1 fraction (`0.925` is 92.5%). Near 1 the market’s rate curve steepens, which is what drives a borrow-rate spike. From the strategy catalog, not a live read: see `ratesAsOf` on a strategy and `liquidityAsOf` on a position.","type":"number"}},"type":"object"}},"securitySchemes":{"partnerId":{"description":"Partner API key id (`pk_live_…`), issued during onboarding. Public by design — it identifies the caller and ships in browser bundles; it is not a secret and grants nothing beyond the partner's registered scope. Sent alone, it is accepted only from an `Origin` in the partner's registered allowlist; a server-side caller with no browser `Origin` sends the key's server secret as well (`partnerSecret`). Every endpoint carries a request budget keyed per partner and client IP, sized by route family — see the 429 on any operation. `/simulate` and the pre-flight a build runs additionally share one per-IP ceiling across all partners.","in":"header","name":"X-Partner-Id","type":"apiKey"},"partnerSecret":{"description":"Server secret (`sk_live_…`) for the key sent in `X-Partner-Id`, generated in the partner portal and shown once. Server-side only, and refused on browser requests: `X-Api-Key` is not a CORS-allowed header, any request carrying it with a `Sec-Fetch-Site` header (which every current browser sets) is rejected with 401 `invalid_api_key`, and the SDK throws if `apiKey` is set in browser code. A valid secret replaces the `Origin` allowlist check, so a server-side caller needs no `Origin` header at all; key status, partner status and scope still apply. A key holds up to two active secrets, so you can rotate with no downtime: generate a second, deploy it, then revoke the first. A value that matches no active secret for the key, including on a key with none, is rejected with 401 `invalid_api_key` rather than falling back to the `Origin` check.","in":"header","name":"X-Api-Key","type":"apiKey"}}},"info":{"contact":{"url":"https://discord.com/invite/0xodyssey"},"description":"REST API for Loopr, the leveraged yield farming product in the Odyssey app.\n\nA path that matches no operation in this document is answered by the application, not by this API, and its 404 has its own shape: `{ \"error\": \"Not found\", \"code\": \"NOT_FOUND\" }`.\n\nThe integration flow is three calls: `/strategies` to find a strategy, `/quote/*` to price an operation, `/build/*` to get unsigned transaction steps. Send `steps` in array order and wait for each to confirm before sending the next. `/simulate` dry-runs those steps first so a revert surfaces before the user signs.\n\nAll amounts are base-unit decimal strings, never JSON numbers — JSON numbers lose precision above 2^53. Ratios (leverage, slippage, flash-loan fees) are 1e18 fixed point, also as decimal strings.\n\nThe `@odysseyfi/loopr-sdk` client takes human units and converts them: `leverage: 2` and `slippage: 0.01` go on the wire as `\"2000000000000000000\"` (2x) and `\"10000000000000000\"` (1%). Calling the API directly, send the 1e18 strings yourself — a bare `\"2\"` is 2e-18, not 2x, and is refused with 400 `invalid_parameters` because leverage must be at least 1x (1.01x on an open).\n\nQuotes and builds both expire 180 seconds after issue (`expiresAt`, unix ms). The window is enforced, not advisory: the server records each build’s expiry and `/simulate` answers 410 `build_expired` past it whether or not the caller sends `expiresAt`. A build submitted on-chain after expiry may revert. To refresh, quote and build again.\n\nA strategy is identified by `(chainId, strategyId, deposit token, borrow token)`. `strategyId` alone is not unique, on one chain or across chains.\n\nPositions are held by a smart contract account deterministically derived from the end-user EOA. Never pass a smart account address where an `eoaAddress` is asked for: the derivation happens server-side precisely so the deploy address, the kernel encoding, and the execute destination cannot disagree.\n\nEvery response is JSON. Errors carry a stable machine-readable `error` code; branch on that, not on the status code alone.","license":{"name":"Proprietary"},"title":"Odyssey Loopr Partner API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/accounts/sca/{eoa}":{"get":{"description":"Deterministic — the same EOA always maps to the same smart contract account on every chain, whether or not it is deployed yet.","operationId":"getScaForEoa","parameters":[{"in":"path","name":"eoa","required":true,"schema":{"description":"End-user externally-owned account.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"eoa":{"description":"Echoed request address, EIP-55 checksummed.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"sca":{"description":"Derived smart contract account address.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["eoa","sca"],"type":"object"}}},"description":"The derived smart contract account address."},"400":{"content":{"application/json":{"schema":{"description":"`eoa` is not a valid EVM address.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_address"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`eoa` is not a valid EVM address."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered domain allowlist, and no `X-Api-Key` server secret was sent.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered domain allowlist, and no `X-Api-Key` server secret was sent."},"429":{"content":{"application/json":{"schema":{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Resolve the smart contract account for an EOA","tags":["Loopr"]}},"/build/adjust":{"post":{"description":"Discriminated on `direction`. `push` adds collateral and re-levers to the target `leverage`; `pull` withdraws collateral to `tokenOut`. The field names differ from `/quote/adjust`, which takes one `amount` for both directions: a push build takes `amountIn`, and a pull build takes `withdrawAmount` (or `withdrawAll`) plus `token` and `tokenOut`.","operationId":"buildAdjust","requestBody":{"content":{"application/json":{"schema":{"discriminator":{"propertyName":"direction"},"oneOf":[{"properties":{"amountIn":{"description":"Amount to add, in base units of `token` — or of `tokenIn` when it is set, since a zap-in is priced against what the EOA actually pays with.","pattern":"^\\d+$","type":"string"},"approvalMode":{"description":"`exact` approves only `amountIn`; `max` approves an unlimited allowance, saving an approval on later operations.","enum":["exact","max"],"type":"string"},"borrowToken":{"description":"Debt token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"direction":{"const":"push","type":"string"},"dryRun":{"description":"Preview the build without holding the funds. Every build the wallet funds (`/build/open`, `/build/adjust` push, `/build/repay` manual) otherwise reads the balance of whatever the batch pulls and answers 422 `insufficient_balance` (`token`, `required`, `available`) when the wallet holds less, simulated or not. With `dryRun: true` that check is skipped, the steps are built as usual and simulated in one Tenderly bundle with the wallet funded by a state override, and the 200 carries `dryRun: true`, `executable: false`, `fundingOverride` and `simulation` beside the steps. Nothing is recorded as a position intent. The steps are real calldata but were checked against a balance the wallet does not have: do not sign them. Rebuild without `dryRun` once the wallet is funded. `simulate` is ignored on a dry run, and the simulation counts against the `/simulate` rate limit.","type":"boolean"},"eoaAddress":{"description":"End-user externally-owned account. The smart contract account that holds the position is derived from it server-side — it is deliberately not a request parameter, so the deploy address, the kernel encoding, and the execute step destination cannot disagree.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"leverage":{"description":"Target leverage in 1e18 fixed point. `2000000000000000000` is 2x. Must be between `1000000000000000000` (1x) and 1000x; anything outside is refused with 400 `invalid_parameters`, so a human `\"5\"` is rejected rather than read as 5 wei of leverage. The strategy’s own ceiling is enforced separately.","pattern":"^\\d+$","type":"string"},"maxPriceImpact":{"description":"Abort the build with 422 when the routed swap price impact exceeds this fraction (0–1).","maximum":1,"minimum":0,"type":"number"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"simulate":{"description":"Dry-run the assembled steps before returning them. The steps go to Tenderly as one bundle with state carried across frames, which is the only way a revert that depends on an earlier step — an approve, the SCA deploy — is observable before signing. A reverting build answers 422 with the failing `stepIndex` and a decoded reason, and writes no position-intent row. One case is retried first: an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is rebuilt once on the swapper and simulated again, and if that build passes its steps are returned with a 200; otherwise the original 422 stands. Default: `true` for a zap-in (`tokenIn` set), which is simulated unasked because no quote route prices one, so nothing else has checked it; send `false` to skip the round trip and run your own check. Any other build has three states, not two. Omitted, it is never answered a pre-flight error, but an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is still simulated once, unpublished: if it reverts and the swapper build simulates clean the 200 carries the steps of the swapper build, and in every other case, an unreachable simulator and a revert the swapper does not clear included, it carries the build as built. That is a rescue, not a check, so a build that would revert on either engine still comes back as steps. `false` skips the server-side simulation entirely, for a caller that simulates on its side. The balance check is not part of this flag: every build the wallet funds answers 422 `insufficient_balance` for a wallet short of what it pulls, simulated or not (see `dryRun`). A passing pre-flight publishes nothing; a failing one publishes the failing frame as a public, unauthenticated Tenderly link showing the EOA, smart account and calldata of the end user. A build that passes only after the swapper retry has already published the first, failing frame.","type":"boolean"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"},"token":{"description":"Collateral token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"tokenIn":{"description":"Token the user is paying with, when it differs from the collateral token. A zap-in swap leg is added. Also changes what `amountIn` is denominated in: base units of `tokenIn`, not of `token`.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"tokenInSwapper":{"enum":["lifi","matcha","custom","1inch","pendle"],"type":"string"}},"required":["amountIn","borrowToken","chainId","direction","eoaAddress","leverage","positionAddress","slippage","strategyId","token"],"type":"object"},{"properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"direction":{"const":"pull","type":"string"},"eoaAddress":{"description":"End-user externally-owned account. The smart contract account that holds the position is derived from it server-side — it is deliberately not a request parameter, so the deploy address, the kernel encoding, and the execute step destination cannot disagree.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"simulate":{"description":"Dry-run the assembled steps before returning them. The steps go to Tenderly as one bundle with state carried across frames, which is the only way a revert that depends on an earlier step — an approve, the SCA deploy — is observable before signing. A reverting build answers 422 with the failing `stepIndex` and a decoded reason, and writes no position-intent row. One case is retried first: an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is rebuilt once on the swapper and simulated again, and if that build passes its steps are returned with a 200; otherwise the original 422 stands. Default: `true` for a zap-in (`tokenIn` set), which is simulated unasked because no quote route prices one, so nothing else has checked it; send `false` to skip the round trip and run your own check. Any other build has three states, not two. Omitted, it is never answered a pre-flight error, but an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is still simulated once, unpublished: if it reverts and the swapper build simulates clean the 200 carries the steps of the swapper build, and in every other case, an unreachable simulator and a revert the swapper does not clear included, it carries the build as built. That is a rescue, not a check, so a build that would revert on either engine still comes back as steps. `false` skips the server-side simulation entirely, for a caller that simulates on its side. The balance check is not part of this flag: every build the wallet funds answers 422 `insufficient_balance` for a wallet short of what it pulls, simulated or not (see `dryRun`). A passing pre-flight publishes nothing; a failing one publishes the failing frame as a public, unauthenticated Tenderly link showing the EOA, smart account and calldata of the end user. A build that passes only after the swapper retry has already published the first, failing frame.","type":"boolean"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"},"token":{"description":"Collateral token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"tokenOut":{"description":"Token the user receives.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"withdrawAll":{"description":"Withdraw the full collateral balance. The amount is only known at execution time, so the response carries no priced payout.","type":"boolean"},"withdrawAmount":{"description":"Collateral to withdraw, in base units. Mutually exclusive with `withdrawAll`.","pattern":"^\\d+$","type":"string"}},"required":["chainId","direction","eoaAddress","positionAddress","strategyId","token","tokenOut"],"type":"object"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildResult"}}},"description":"Unsigned transaction steps, ready to sign and send in order."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"No strategy in this integration’s catalog matches the supplied `strategyId`/`chainId`: never listed, hidden, or outside its scope.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"No strategy in this integration’s catalog matches the supplied `strategyId`/`chainId`: never listed, hidden, or outside its scope."},"422":{"content":{"application/json":{"schema":{"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","borrow_cap_exceeded","borrow_exceeds_collateral","borrow_market_inactive","deleverage_exceeds_collateral","insufficient_balance","insufficient_vault_liquidity","manual_repay_unsupported","reward_proof_invalid","simulation_reverted","strategy_disabled","strategy_expired","supply_cap_exceeded","swapper_transfer_rounding"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["simulation_unavailable","partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Build transactions to add or remove collateral","tags":["Loopr"]}},"/build/borrow":{"post":{"operationId":"buildBorrow","requestBody":{"content":{"application/json":{"schema":{"properties":{"borrowAmount":{"description":"Amount to borrow, in base units.","pattern":"^\\d+$","type":"string"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"eoaAddress":{"description":"End-user externally-owned account. The smart contract account that holds the position is derived from it server-side — it is deliberately not a request parameter, so the deploy address, the kernel encoding, and the execute step destination cannot disagree.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"marketId":{"description":"Morpho market id. Required only where the strategy spans several markets.","pattern":"^0x[0-9a-fA-F]{64}$","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"simulate":{"description":"Dry-run the assembled steps before returning them. The steps go to Tenderly as one bundle with state carried across frames, which is the only way a revert that depends on an earlier step — an approve, the SCA deploy — is observable before signing. A reverting build answers 422 with the failing `stepIndex` and a decoded reason, and writes no position-intent row. One case is retried first: an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is rebuilt once on the swapper and simulated again, and if that build passes its steps are returned with a 200; otherwise the original 422 stands. Default: `true` for a zap-in (`tokenIn` set), which is simulated unasked because no quote route prices one, so nothing else has checked it; send `false` to skip the round trip and run your own check. Any other build has three states, not two. Omitted, it is never answered a pre-flight error, but an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is still simulated once, unpublished: if it reverts and the swapper build simulates clean the 200 carries the steps of the swapper build, and in every other case, an unreachable simulator and a revert the swapper does not clear included, it carries the build as built. That is a rescue, not a check, so a build that would revert on either engine still comes back as steps. `false` skips the server-side simulation entirely, for a caller that simulates on its side. The balance check is not part of this flag: every build the wallet funds answers 422 `insufficient_balance` for a wallet short of what it pulls, simulated or not (see `dryRun`). A passing pre-flight publishes nothing; a failing one publishes the failing frame as a public, unauthenticated Tenderly link showing the EOA, smart account and calldata of the end user. A build that passes only after the swapper retry has already published the first, failing frame.","type":"boolean"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["borrowAmount","chainId","eoaAddress","positionAddress","strategyId"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildResult"}}},"description":"Unsigned transaction steps, ready to sign and send in order."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"No strategy in this integration’s catalog matches the supplied `strategyId`/`chainId`: never listed, hidden, or outside its scope.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"No strategy in this integration’s catalog matches the supplied `strategyId`/`chainId`: never listed, hidden, or outside its scope."},"422":{"content":{"application/json":{"schema":{"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","borrow_cap_exceeded","borrow_exceeds_collateral","borrow_market_inactive","deleverage_exceeds_collateral","insufficient_balance","insufficient_vault_liquidity","manual_repay_unsupported","reward_proof_invalid","simulation_reverted","strategy_disabled","strategy_expired","supply_cap_exceeded","swapper_transfer_rounding"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["simulation_unavailable","partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Build transactions to borrow against an open position","tags":["Loopr"]}},"/build/claim":{"post":{"description":"`send` transfers rewards to the user. `compound` swaps them into the deposit token and adds them to the position, and requires `slippage`.","operationId":"buildClaim","requestBody":{"content":{"application/json":{"schema":{"properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"eoaAddress":{"description":"End-user externally-owned account. The smart contract account that holds the position is derived from it server-side — it is deliberately not a request parameter, so the deploy address, the kernel encoding, and the execute step destination cannot disagree.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"mode":{"enum":["send","compound"],"type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"rewards":{"description":"Merkl reward entries to claim. Pass the `rewards` of a fresh `/quote/claim` through verbatim: each is checked against the distributor’s current root, and one that does not match answers 422 `reward_proof_invalid`.","items":{"properties":{"amount":{"description":"Claimable amount, base units.","pattern":"^\\d+$","type":"string"},"proof":{"items":{"pattern":"^0x[0-9a-fA-F]*$","type":"string"},"type":"array"},"recipient":{"description":"Reward recipient.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"token":{"description":"Reward token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["amount","proof","recipient","token"],"type":"object"},"minItems":1,"type":"array"},"simulate":{"description":"Dry-run the assembled steps before returning them. The steps go to Tenderly as one bundle with state carried across frames, which is the only way a revert that depends on an earlier step — an approve, the SCA deploy — is observable before signing. A reverting build answers 422 with the failing `stepIndex` and a decoded reason, and writes no position-intent row. One case is retried first: an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is rebuilt once on the swapper and simulated again, and if that build passes its steps are returned with a 200; otherwise the original 422 stands. Default: `true` for a zap-in (`tokenIn` set), which is simulated unasked because no quote route prices one, so nothing else has checked it; send `false` to skip the round trip and run your own check. Any other build has three states, not two. Omitted, it is never answered a pre-flight error, but an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is still simulated once, unpublished: if it reverts and the swapper build simulates clean the 200 carries the steps of the swapper build, and in every other case, an unreachable simulator and a revert the swapper does not clear included, it carries the build as built. That is a rescue, not a check, so a build that would revert on either engine still comes back as steps. `false` skips the server-side simulation entirely, for a caller that simulates on its side. The balance check is not part of this flag: every build the wallet funds answers 422 `insufficient_balance` for a wallet short of what it pulls, simulated or not (see `dryRun`). A passing pre-flight publishes nothing; a failing one publishes the failing frame as a public, unauthenticated Tenderly link showing the EOA, smart account and calldata of the end user. A build that passes only after the swapper retry has already published the first, failing frame.","type":"boolean"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["chainId","eoaAddress","mode","positionAddress","rewards","strategyId"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildResult"}}},"description":"Unsigned transaction steps, ready to sign and send in order."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope).","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope)."},"422":{"content":{"application/json":{"schema":{"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","borrow_cap_exceeded","borrow_exceeds_collateral","borrow_market_inactive","deleverage_exceeds_collateral","insufficient_balance","insufficient_vault_liquidity","manual_repay_unsupported","reward_proof_invalid","simulation_reverted","strategy_disabled","strategy_expired","supply_cap_exceeded","swapper_transfer_rounding"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["simulation_unavailable","partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Build transactions to claim or compound rewards","tags":["Loopr"]}},"/build/close":{"post":{"operationId":"buildClose","requestBody":{"content":{"application/json":{"schema":{"properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"eoaAddress":{"description":"End-user externally-owned account. The smart contract account that holds the position is derived from it server-side — it is deliberately not a request parameter, so the deploy address, the kernel encoding, and the execute step destination cannot disagree.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"receiveToken":{"description":"Token the user receives. Accepts a bare address, or `{ address, symbol }` to skip the on-chain `symbol()` lookup. Defaults to the collateral token.","oneOf":[{"description":"Token address.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},{"properties":{"address":{"description":"Token address.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"symbol":{"type":"string"}},"required":["address","symbol"],"type":"object"}]},"simulate":{"description":"Dry-run the assembled steps before returning them. The steps go to Tenderly as one bundle with state carried across frames, which is the only way a revert that depends on an earlier step — an approve, the SCA deploy — is observable before signing. A reverting build answers 422 with the failing `stepIndex` and a decoded reason, and writes no position-intent row. One case is retried first: an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is rebuilt once on the swapper and simulated again, and if that build passes its steps are returned with a 200; otherwise the original 422 stands. Default: `true` for a zap-in (`tokenIn` set), which is simulated unasked because no quote route prices one, so nothing else has checked it; send `false` to skip the round trip and run your own check. Any other build has three states, not two. Omitted, it is never answered a pre-flight error, but an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is still simulated once, unpublished: if it reverts and the swapper build simulates clean the 200 carries the steps of the swapper build, and in every other case, an unreachable simulator and a revert the swapper does not clear included, it carries the build as built. That is a rescue, not a check, so a build that would revert on either engine still comes back as steps. `false` skips the server-side simulation entirely, for a caller that simulates on its side. The balance check is not part of this flag: every build the wallet funds answers 422 `insufficient_balance` for a wallet short of what it pulls, simulated or not (see `dryRun`). A passing pre-flight publishes nothing; a failing one publishes the failing frame as a public, unauthenticated Tenderly link showing the EOA, smart account and calldata of the end user. A build that passes only after the swapper retry has already published the first, failing frame.","type":"boolean"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["chainId","eoaAddress","positionAddress","slippage","strategyId"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildResult"}}},"description":"Unsigned transaction steps, ready to sign and send in order."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope).","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope)."},"422":{"content":{"application/json":{"schema":{"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","borrow_cap_exceeded","borrow_exceeds_collateral","borrow_market_inactive","deleverage_exceeds_collateral","insufficient_balance","insufficient_vault_liquidity","manual_repay_unsupported","reward_proof_invalid","simulation_reverted","strategy_disabled","strategy_expired","supply_cap_exceeded","swapper_transfer_rounding"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["simulation_unavailable","partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Build transactions to close a position in full","tags":["Loopr"]}},"/build/open":{"post":{"description":"Returns the unsigned steps that open a leveraged position. The smart contract account is derived server-side from `eoaAddress`.","operationId":"buildOpen","requestBody":{"content":{"application/json":{"schema":{"properties":{"amountIn":{"description":"Amount to deposit, in base units of `token` — or of `tokenIn` when it is set, since a zap-in is priced against what the EOA actually pays with.","pattern":"^\\d+$","type":"string"},"approvalMode":{"enum":["exact","max"],"type":"string"},"borrowToken":{"description":"Debt token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"dryRun":{"description":"Preview the build without holding the funds. Every build the wallet funds (`/build/open`, `/build/adjust` push, `/build/repay` manual) otherwise reads the balance of whatever the batch pulls and answers 422 `insufficient_balance` (`token`, `required`, `available`) when the wallet holds less, simulated or not. With `dryRun: true` that check is skipped, the steps are built as usual and simulated in one Tenderly bundle with the wallet funded by a state override, and the 200 carries `dryRun: true`, `executable: false`, `fundingOverride` and `simulation` beside the steps. Nothing is recorded as a position intent. The steps are real calldata but were checked against a balance the wallet does not have: do not sign them. Rebuild without `dryRun` once the wallet is funded. `simulate` is ignored on a dry run, and the simulation counts against the `/simulate` rate limit.","type":"boolean"},"eoaAddress":{"description":"End-user externally-owned account. The smart contract account that holds the position is derived from it server-side — it is deliberately not a request parameter, so the deploy address, the kernel encoding, and the execute step destination cannot disagree.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"leverage":{"description":"Target leverage in 1e18 fixed point. `2000000000000000000` is 2x. An open must borrow, so this starts at `1010000000000000000` (1.01x) and runs to 1000x; anything outside is refused with 400 `invalid_parameters`, so a human `\"5\"` is rejected rather than read as 5 wei of leverage, and so is exactly 1x. The strategy’s own ceiling is enforced separately.","pattern":"^\\d+$","type":"string"},"marketLiquidity":{"description":"Caller-supplied liquidity bound used to size the loop.","pattern":"^\\d+$","type":"string"},"maxPriceImpact":{"maximum":1,"minimum":0,"type":"number"},"simulate":{"description":"Dry-run the assembled steps before returning them. The steps go to Tenderly as one bundle with state carried across frames, which is the only way a revert that depends on an earlier step — an approve, the SCA deploy — is observable before signing. A reverting build answers 422 with the failing `stepIndex` and a decoded reason, and writes no position-intent row. One case is retried first: an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is rebuilt once on the swapper and simulated again, and if that build passes its steps are returned with a 200; otherwise the original 422 stands. Default: `true` for a zap-in (`tokenIn` set), which is simulated unasked because no quote route prices one, so nothing else has checked it; send `false` to skip the round trip and run your own check. Any other build has three states, not two. Omitted, it is never answered a pre-flight error, but an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is still simulated once, unpublished: if it reverts and the swapper build simulates clean the 200 carries the steps of the swapper build, and in every other case, an unreachable simulator and a revert the swapper does not clear included, it carries the build as built. That is a rescue, not a check, so a build that would revert on either engine still comes back as steps. `false` skips the server-side simulation entirely, for a caller that simulates on its side. The balance check is not part of this flag: every build the wallet funds answers 422 `insufficient_balance` for a wallet short of what it pulls, simulated or not (see `dryRun`). A passing pre-flight publishes nothing; a failing one publishes the failing frame as a public, unauthenticated Tenderly link showing the EOA, smart account and calldata of the end user. A build that passes only after the swapper retry has already published the first, failing frame.","type":"boolean"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"},"strategyKey":{"description":"Names one market when several strategies share `strategyId`, chain and tokens, written `{chainId}:{strategyId}:{protocol}:{identity}`. Optional: send it only after a request answered `ambiguous_strategy` (pick one of that response’s `strategyKeys`, or the `strategyKey` of a `/strategies/{id}` candidate). A strategy keyed to another market never matches it.","type":"string"},"token":{"description":"Collateral token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"tokenIn":{"description":"Token the user is paying with, when it differs from the collateral token — a zap-in. Also changes what `amountIn` is denominated in: base units of `tokenIn`, not of `token`.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"tokenInSwapper":{"enum":["lifi","matcha","custom","1inch","pendle"],"type":"string"}},"required":["amountIn","borrowToken","chainId","eoaAddress","leverage","slippage","strategyId","token"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildResult"}}},"description":"Unsigned transaction steps, ready to sign and send in order."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"No strategy in this integration’s catalog matches the supplied `strategyId`/`chainId`: never listed, hidden, or outside its scope.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"No strategy in this integration’s catalog matches the supplied `strategyId`/`chainId`: never listed, hidden, or outside its scope."},"422":{"content":{"application/json":{"schema":{"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","borrow_cap_exceeded","borrow_exceeds_collateral","borrow_market_inactive","deleverage_exceeds_collateral","insufficient_balance","insufficient_vault_liquidity","manual_repay_unsupported","reward_proof_invalid","simulation_reverted","strategy_disabled","strategy_expired","supply_cap_exceeded","swapper_transfer_rounding"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["simulation_unavailable","partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Build transactions to open a leveraged position","tags":["Loopr"]}},"/build/repay":{"post":{"description":"`auto` (deleverage) withdraws collateral via a flash loan to repay debt and can pay the user out — see `refund` on the response. `manual` repays from the user's own balance and may emit an `approve` step.","operationId":"buildRepay","requestBody":{"content":{"application/json":{"schema":{"discriminator":{"propertyName":"mode"},"oneOf":[{"properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"dryRun":{"description":"Preview the build without holding the funds. Every build the wallet funds (`/build/open`, `/build/adjust` push, `/build/repay` manual) otherwise reads the balance of whatever the batch pulls and answers 422 `insufficient_balance` (`token`, `required`, `available`) when the wallet holds less, simulated or not. With `dryRun: true` that check is skipped, the steps are built as usual and simulated in one Tenderly bundle with the wallet funded by a state override, and the 200 carries `dryRun: true`, `executable: false`, `fundingOverride` and `simulation` beside the steps. Nothing is recorded as a position intent. The steps are real calldata but were checked against a balance the wallet does not have: do not sign them. Rebuild without `dryRun` once the wallet is funded. `simulate` is ignored on a dry run, and the simulation counts against the `/simulate` rate limit.","type":"boolean"},"eoaAddress":{"description":"End-user externally-owned account. The smart contract account that holds the position is derived from it server-side — it is deliberately not a request parameter, so the deploy address, the kernel encoding, and the execute step destination cannot disagree.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"mode":{"const":"auto","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"repayAmount":{"description":"Debt to repay, in base units.","pattern":"^\\d+$","type":"string"},"simulate":{"description":"Dry-run the assembled steps before returning them. The steps go to Tenderly as one bundle with state carried across frames, which is the only way a revert that depends on an earlier step — an approve, the SCA deploy — is observable before signing. A reverting build answers 422 with the failing `stepIndex` and a decoded reason, and writes no position-intent row. One case is retried first: an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is rebuilt once on the swapper and simulated again, and if that build passes its steps are returned with a 200; otherwise the original 422 stands. Default: `true` for a zap-in (`tokenIn` set), which is simulated unasked because no quote route prices one, so nothing else has checked it; send `false` to skip the round trip and run your own check. Any other build has three states, not two. Omitted, it is never answered a pre-flight error, but an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is still simulated once, unpublished: if it reverts and the swapper build simulates clean the 200 carries the steps of the swapper build, and in every other case, an unreachable simulator and a revert the swapper does not clear included, it carries the build as built. That is a rescue, not a check, so a build that would revert on either engine still comes back as steps. `false` skips the server-side simulation entirely, for a caller that simulates on its side. The balance check is not part of this flag: every build the wallet funds answers 422 `insufficient_balance` for a wallet short of what it pulls, simulated or not (see `dryRun`). A passing pre-flight publishes nothing; a failing one publishes the failing frame as a public, unauthenticated Tenderly link showing the EOA, smart account and calldata of the end user. A build that passes only after the swapper retry has already published the first, failing frame.","type":"boolean"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"},"withdrawAmount":{"description":"Collateral to withdraw alongside the repay. May be clamped by the collateral bound — check `refund.bounded`.","pattern":"^\\d+$","type":"string"}},"required":["chainId","eoaAddress","mode","positionAddress","repayAmount","slippage","strategyId"],"type":"object"},{"properties":{"approvalMode":{"enum":["exact","max"],"type":"string"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"dryRun":{"description":"Preview the build without holding the funds. Every build the wallet funds (`/build/open`, `/build/adjust` push, `/build/repay` manual) otherwise reads the balance of whatever the batch pulls and answers 422 `insufficient_balance` (`token`, `required`, `available`) when the wallet holds less, simulated or not. With `dryRun: true` that check is skipped, the steps are built as usual and simulated in one Tenderly bundle with the wallet funded by a state override, and the 200 carries `dryRun: true`, `executable: false`, `fundingOverride` and `simulation` beside the steps. Nothing is recorded as a position intent. The steps are real calldata but were checked against a balance the wallet does not have: do not sign them. Rebuild without `dryRun` once the wallet is funded. `simulate` is ignored on a dry run, and the simulation counts against the `/simulate` rate limit.","type":"boolean"},"eoaAddress":{"description":"End-user externally-owned account. The smart contract account that holds the position is derived from it server-side — it is deliberately not a request parameter, so the deploy address, the kernel encoding, and the execute step destination cannot disagree.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"mode":{"const":"manual","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"repayAmount":{"description":"Debt to repay, in base units.","pattern":"^\\d+$","type":"string"},"simulate":{"description":"Dry-run the assembled steps before returning them. The steps go to Tenderly as one bundle with state carried across frames, which is the only way a revert that depends on an earlier step — an approve, the SCA deploy — is observable before signing. A reverting build answers 422 with the failing `stepIndex` and a decoded reason, and writes no position-intent row. One case is retried first: an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is rebuilt once on the swapper and simulated again, and if that build passes its steps are returned with a 200; otherwise the original 422 stands. Default: `true` for a zap-in (`tokenIn` set), which is simulated unasked because no quote route prices one, so nothing else has checked it; send `false` to skip the round trip and run your own check. Any other build has three states, not two. Omitted, it is never answered a pre-flight error, but an `open`, a deposit through `adjust`, a `close` or an auto `repay` built on the routing engine is still simulated once, unpublished: if it reverts and the swapper build simulates clean the 200 carries the steps of the swapper build, and in every other case, an unreachable simulator and a revert the swapper does not clear included, it carries the build as built. That is a rescue, not a check, so a build that would revert on either engine still comes back as steps. `false` skips the server-side simulation entirely, for a caller that simulates on its side. The balance check is not part of this flag: every build the wallet funds answers 422 `insufficient_balance` for a wallet short of what it pulls, simulated or not (see `dryRun`). A passing pre-flight publishes nothing; a failing one publishes the failing frame as a public, unauthenticated Tenderly link showing the EOA, smart account and calldata of the end user. A build that passes only after the swapper retry has already published the first, failing frame.","type":"boolean"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["chainId","eoaAddress","mode","positionAddress","repayAmount","strategyId"],"type":"object"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildResult"}}},"description":"Unsigned transaction steps, ready to sign and send in order."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope).","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope)."},"422":{"content":{"application/json":{"schema":{"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","borrow_cap_exceeded","borrow_exceeds_collateral","borrow_market_inactive","deleverage_exceeds_collateral","insufficient_balance","insufficient_vault_liquidity","manual_repay_unsupported","reward_proof_invalid","simulation_reverted","strategy_disabled","strategy_expired","supply_cap_exceeded","swapper_transfer_rounding"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The build is well-formed but cannot be produced against current on-chain state — no swap route, price impact above the supplied bound, a size that does not fit the position's collateral, or an operation the position's protocol does not support. The `swap-*` codes come from the swap leg and carry a structured `detail`. `insufficient_balance` comes from the balance check every build the wallet funds runs (`/build/open`, `/build/adjust` push, `/build/repay` manual), whether or not it is simulated: it carries `token`, `required` and `available` (base units), and means the account holds less than the build would pull. For a native `tokenIn` the check compares the ether balance with the amount alone, so the wallet also needs gas on top. Send `dryRun: true` to preview such a build anyway. `simulation_reverted` comes from the pre-flight, which runs when the request set `simulate: true` and by default on a zap-in. `simulation_reverted` carries `stepIndex`, the step's `kind` (`approve`, `sca-deploy` or `execute`) and `label`, `revertReason`/`decoded` when the revert could be named, and `simulationId` — the Tenderly simulation the bundle already published, viewable at `dashboard.tenderly.co/shared/simulation/{simulationId}`. That link is public and unauthenticated, and shows the user's EOA, smart account and calldata. A revert that returns no data, as a failed USDT `transferFrom` does, is reported as `invalid opcode` followed by a sentence naming the likely cause (a transfer above the balance or the allowance). `reward_proof_invalid` is `/build/claim` only: a reward whose proof does not lead to the Merkl distributor's current root, or whose `recipient` is not the position. A proof goes stale each time Merkl publishes a root, so fetch a fresh `/quote/claim`. `strategy_disabled` means the strategy no longer takes new exposure (delisted, or turned off by the partner that owns it): an open, an `adjust` deposit or a borrow is refused, while an existing position can still exit. `strategy_expired` means the strategy's Pendle PT has matured. `borrow_market_inactive`, `borrow_cap_exceeded`, `insufficient_vault_liquidity` and `supply_cap_exceeded` are the market's state, not the request's: the lending protocol switched the borrow market off, or the borrow cap, the borrow vault's cash or the deposit vault's supply cap admits less than the build needs. A smaller size may fit, an identical retry will not. `swapper_transfer_rounding` is a swapper-path swap of a token whose transfers land short (stETH): send a different `tokenIn`. Each of these carries `code` and a human-readable `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed. `/build/claim` never answers it."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded — either the BUILD family budget for this partner and client IP, or, when the build is pre-flighted, the host-wide simulation ceiling (30 requests / 60s, keyed on client IP alone and shared with `/loopr/simulate` across every partner). Honour the `Retry-After` header. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["simulation_unavailable","partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`simulation_unavailable`: only when the build is pre-flighted (`simulate: true`, or a zap-in left to the default). The simulator could not be reached, so the pre-flight could not run. The build is not returned, because handing back unsimulated steps where a simulated build was due would be indistinguishable from a passing one. Retry, or re-send with `simulate: false` to accept the unsimulated build knowingly. `partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Build transactions to repay debt or deleverage","tags":["Loopr"]}},"/positions/by-owner/{eoa}":{"get":{"description":"Positions are held by the smart contract account derived from `eoa`; the resolution happens server-side.\n\nOne of `chainId` or `chainIds` is **required** — omitting both is a 400 `missing_chain_id`. Sending both is allowed: `chainId` is folded into the `chainIds` set and the union is deduped.","operationId":"listPositionsByOwner","parameters":[{"in":"path","name":"eoa","required":true,"schema":{"description":"Owner externally-owned account.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},{"description":"Single chain to query. Required unless `chainIds` is sent; may be combined with it, in which case both are merged into one deduped set.","in":"query","name":"chainId","schema":{"type":"integer"}},{"description":"Comma-separated chain ids. Required unless `chainId` is sent; may be combined with it, in which case both are merged into one deduped set.","in":"query","name":"chainIds","schema":{"type":"string"}},{"description":"Comma-separated collateral token addresses to filter by.","in":"query","name":"assets","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"catalogUnavailable":{"description":"`true` when the strategy enrichment read failed and positions were returned without it: strategy-derived fields fall back, and any `strategies` list is empty for that reason rather than because nothing needed resolving. One flag for the whole response, never an `errors` row, because the catalog is a single all-chains read. Sent with `Cache-Control: no-store` so a retry reaches the server. A failure of the base strategy list is not covered: positions cannot be located without it, so the request fails or reports each chain as `chain_unavailable` in `errors`.","type":"boolean"},"errors":{"description":"Positions that could not be read. Empty when every read succeeded.","items":{"properties":{"error":{"type":"string"},"positionAddress":{"description":"Position contract that failed.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["error","positionAddress"],"type":"object"},"type":"array"},"positions":{"items":{"$ref":"#/components/schemas/Position"},"type":"array"},"strategies":{"description":"The distinct strategies referenced by `positions`, deduped.","items":{"$ref":"#/components/schemas/Strategy"},"type":"array"},"summary":{"properties":{"activeCount":{"description":"Positions not currently at liquidation health.","type":"integer"},"avgApy":{"description":"Mean `loopedApy` across positions reporting one; `0` when none do.","type":"number"},"positionsValueUsd":{"description":"Summed USD value, as a decimal string.","type":"string"}},"required":["activeCount","avgApy","positionsValueUsd"],"type":"object"}},"required":["catalogUnavailable","errors","positions","summary","strategies"],"type":"object"}}},"description":"Open positions owned by this EOA, within the partner's scope. Cached `private, max-age=15`."},"400":{"content":{"application/json":{"schema":{"description":"The address or chain filter is malformed.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_address","invalid_chain_id","missing_chain_id"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The address or chain filter is malformed."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"429":{"content":{"application/json":{"schema":{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"List all positions owned by an EOA","tags":["Loopr"]}},"/positions/{address}":{"get":{"description":"`address` is the end-user EOA, not the position contract — the owning smart contract account is derived from it server-side. An address that owns no positions answers 200 with an empty list, and that includes a position’s own address: it is not looked up as a position.","operationId":"listPositions","parameters":[{"in":"path","name":"address","required":true,"schema":{"description":"End-user externally-owned account.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},{"description":"Restrict to a single chain.","in":"query","name":"chainId","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"catalogUnavailable":{"description":"`true` when the strategy enrichment read failed and positions were returned without it: strategy-derived fields fall back, and any `strategies` list is empty for that reason rather than because nothing needed resolving. One flag for the whole response, never an `errors` row, because the catalog is a single all-chains read. Sent with `Cache-Control: no-store` so a retry reaches the server. A failure of the base strategy list is not covered: positions cannot be located without it, so the request fails or reports each chain as `chain_unavailable` in `errors`.","type":"boolean"},"errors":{"description":"Positions that could not be read. Empty when every read succeeded.","items":{"properties":{"error":{"type":"string"},"positionAddress":{"description":"Position contract that failed.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["error","positionAddress"],"type":"object"},"type":"array"},"positions":{"items":{"$ref":"#/components/schemas/Position"},"type":"array"},"summary":{"properties":{"activeCount":{"description":"Positions not currently at liquidation health.","type":"integer"},"avgApy":{"description":"Mean `loopedApy` across positions reporting one; `0` when none do.","type":"number"},"positionsValueUsd":{"description":"Summed USD value, as a decimal string.","type":"string"}},"required":["activeCount","avgApy","positionsValueUsd"],"type":"object"}},"required":["catalogUnavailable","errors","positions","summary"],"type":"object"}}},"description":"Open positions. Cached `private, max-age=15`."},"400":{"content":{"application/json":{"schema":{"description":"`address` is not a valid EVM address, or the `chainId` filter failed validation.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_address","invalid_parameters"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`address` is not a valid EVM address, or the `chainId` filter failed validation."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"429":{"content":{"application/json":{"schema":{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"List positions for an EOA","tags":["Loopr"]}},"/quote/adjust":{"post":{"description":"JSON has no signed bigint, so the signed collateral delta is sent as an absolute `amount` plus a `direction` discriminator. `leverage` is required on `push` and ignored on `pull`. The same `amount` serves both directions here, unlike `/build/adjust`: a push build takes `amountIn`, and a pull build takes `withdrawAmount` plus `token` and `tokenOut`. Prices collateral only: `tokenIn` and `tokenInSwapper` are rejected with 400 `invalid_parameters` rather than silently ignored. To zap in on a push, quote in collateral units, then send those fields to `/build/adjust`.","operationId":"quoteAdjust","requestBody":{"content":{"application/json":{"schema":{"discriminator":{"propertyName":"direction"},"oneOf":[{"properties":{"amount":{"description":"Collateral to add, in base units.","pattern":"^\\d+$","type":"string"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"direction":{"const":"push","type":"string"},"leverage":{"description":"Target leverage in 1e18 fixed point. `2000000000000000000` is 2x. Must be between `1000000000000000000` (1x) and 1000x; anything outside is refused with 400 `invalid_parameters`, so a human `\"5\"` is rejected rather than read as 5 wei of leverage. The strategy’s own ceiling is enforced separately.","pattern":"^\\d+$","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["amount","chainId","direction","leverage","positionAddress","slippage","strategyId"],"type":"object"},{"properties":{"amount":{"description":"Collateral to withdraw, in base units.","pattern":"^\\d+$","type":"string"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"direction":{"const":"pull","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["amount","chainId","direction","positionAddress","slippage","strategyId"],"type":"object"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustQuote"}}},"description":"Quote envelope. Expires at `expiresAt` (unix ms)."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"No strategy matches the supplied `strategyId`/`chainId`.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"No strategy matches the supplied `strategyId`/`chainId`."},"422":{"content":{"application/json":{"schema":{"description":"The quote cannot be computed for this request against current state. The `swap-*` codes come from the swap leg and carry a structured `detail`. `strategy_disabled` means the strategy no longer takes new exposure, so the build of the same request would be refused: a borrow or an `adjust` push is not quoted, while an `adjust` pull still is. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","strategy_disabled"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The quote cannot be computed for this request against current state. The `swap-*` codes come from the swap leg and carry a structured `detail`. `strategy_disabled` means the strategy no longer takes new exposure, so the build of the same request would be refused: a borrow or an `adjust` push is not quoted, while an `adjust` pull still is. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"oneOf":[{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"},{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure.","type":"string"},"error":{"const":"compute_adjust_quote_failed","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}]}}},"description":"Either the quote could not be computed (`compute_adjust_quote_failed`), or the request failed before reaching the compute step (`internal_error`). Branch on `error`; both are server-side and neither is fixed by changing the request."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Quote adding or removing collateral","tags":["Loopr"]}},"/quote/borrow":{"post":{"operationId":"quoteBorrow","requestBody":{"content":{"application/json":{"schema":{"properties":{"borrowAmount":{"description":"Amount to borrow, in base units.","pattern":"^\\d+$","type":"string"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"marketId":{"pattern":"^0x[0-9a-fA-F]{64}$","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["borrowAmount","chainId","positionAddress","strategyId"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BorrowQuote"}}},"description":"Quote envelope. Expires at `expiresAt` (unix ms)."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"No strategy matches the supplied `strategyId`/`chainId`.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"No strategy matches the supplied `strategyId`/`chainId`."},"422":{"content":{"application/json":{"schema":{"description":"The quote cannot be computed for this request against current state. `strategy_disabled` means the strategy no longer takes new exposure, so the build of the same request would be refused: a borrow or an `adjust` push is not quoted, while an `adjust` pull still is. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["ambiguous_strategy","strategy_disabled"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The quote cannot be computed for this request against current state. `strategy_disabled` means the strategy no longer takes new exposure, so the build of the same request would be refused: a borrow or an `adjust` push is not quoted, while an `adjust` pull still is. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed."},"429":{"content":{"application/json":{"schema":{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"oneOf":[{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"},{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure.","type":"string"},"error":{"const":"compute_borrow_quote_failed","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}]}}},"description":"Either the quote could not be computed (`compute_borrow_quote_failed`), or the request failed before reaching the compute step (`internal_error`). Branch on `error`; both are server-side and neither is fixed by changing the request."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Quote borrowing against an open position","tags":["Loopr"]}},"/quote/claim":{"post":{"description":"`slippage` is required when `mode` is `compound`.","operationId":"quoteClaim","requestBody":{"content":{"application/json":{"schema":{"properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"mode":{"enum":["send","compound"],"type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["chainId","mode","positionAddress","strategyId"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimQuote"}}},"description":"Quote envelope. Expires at `expiresAt` (unix ms)."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing","no_rewards"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope).","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope)."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"oneOf":[{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"},{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure.","type":"string"},"error":{"const":"compute_claim_quote_failed","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}]}}},"description":"Either the quote could not be computed (`compute_claim_quote_failed`), or the request failed before reaching the compute step (`internal_error`). Branch on `error`; both are server-side and neither is fixed by changing the request."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Quote claiming or compounding rewards","tags":["Loopr"]}},"/quote/close":{"post":{"operationId":"quoteClose","requestBody":{"content":{"application/json":{"schema":{"properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["chainId","positionAddress","slippage","strategyId"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQuote"}}},"description":"Quote envelope. Expires at `expiresAt` (unix ms)."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope).","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The position’s strategy is not in this integration’s catalog (hidden, or outside its scope)."},"422":{"content":{"application/json":{"schema":{"description":"The quote cannot be computed for this request against current state. The `swap-*` codes come from the swap leg and carry a structured `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","multi_hop_quote_unsupported"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The quote cannot be computed for this request against current state. The `swap-*` codes come from the swap leg and carry a structured `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"oneOf":[{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"},{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure.","type":"string"},"error":{"const":"compute_close_quote_failed","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}]}}},"description":"Either the quote could not be computed (`compute_close_quote_failed`), or the request failed before reaching the compute step (`internal_error`). Branch on `error`; both are server-side and neither is fixed by changing the request."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Quote closing a position in full","tags":["Loopr"]}},"/quote/open":{"post":{"description":"Prices opening a leveraged position without building transactions. Quotes expire 180 seconds after issue. Prices a direct deposit only: `amountIn` is always read in `token` units, and this route models no swap leg, so `tokenIn` and `tokenInSwapper` are rejected with 400 `invalid_parameters` rather than silently ignored. To zap in, quote in `token` units, then send those fields to `/build/open`. The borrow token is named `borrowAsset` here and `borrowToken` on `/build/open`: `borrowToken` sent to this route is refused with 400 `invalid_parameters`, not ignored.","operationId":"quoteOpen","requestBody":{"content":{"application/json":{"schema":{"properties":{"amountIn":{"description":"Collateral to deposit, in base units of `token`.","pattern":"^\\d+$","type":"string"},"borrowAsset":{"description":"Debt token of the strategy to price. Send it always: several strategies share a `(strategyId, token)` pair and differ only in debt token, and without this the route prices the first one that matches, which need not be the one `/build/open` will target.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"leverage":{"description":"Target leverage in 1e18 fixed point. `2000000000000000000` is 2x. An open must borrow, so this starts at `1010000000000000000` (1.01x) and runs to 1000x; anything outside is refused with 400 `invalid_parameters`, so a human `\"5\"` is rejected rather than read as 5 wei of leverage, and so is exactly 1x. The strategy’s own ceiling is enforced separately.","pattern":"^\\d+$","type":"string"},"maxPriceImpact":{"description":"The `maxPriceImpact` you will send to `/build/open`. On a strategy that opens through the routing engine it decides which route the borrow is sized against, so send the same value to both. `/build/open` can still fall back to the swapper by itself when the engine batch fails its pre-flight.","maximum":1,"minimum":0,"type":"number"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"},"strategyKey":{"description":"Names one market when several strategies share `strategyId`, chain and tokens, written `{chainId}:{strategyId}:{protocol}:{identity}`. Optional: send it only after a request answered `ambiguous_strategy` (pick one of that response’s `strategyKeys`, or the `strategyKey` of a `/strategies/{id}` candidate). A strategy keyed to another market never matches it.","type":"string"},"token":{"description":"Collateral token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["amountIn","chainId","leverage","slippage","strategyId","token"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenQuote"}}},"description":"Quote envelope. Expires at `expiresAt` (unix ms)."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"No strategy matches the supplied `strategyId`/`chainId`.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"No strategy matches the supplied `strategyId`/`chainId`."},"422":{"content":{"application/json":{"schema":{"description":"The quote cannot be computed for this request against current state. The `swap-*` codes come from the swap leg and carry a structured `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","multi_hop_quote_unsupported"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The quote cannot be computed for this request against current state. The `swap-*` codes come from the swap leg and carry a structured `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"oneOf":[{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"},{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure.","type":"string"},"error":{"const":"compute_open_quote_failed","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}]}}},"description":"Either the quote could not be computed (`compute_open_quote_failed`), or the request failed before reaching the compute step (`internal_error`). Branch on `error`; both are server-side and neither is fixed by changing the request."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Quote opening a leveraged position","tags":["Loopr"]}},"/quote/repay":{"post":{"description":"`auto` deleverages by withdrawing collateral to cover the repay and requires `slippage`; `manual` repays from the user's balance.","operationId":"quoteRepay","requestBody":{"content":{"application/json":{"schema":{"discriminator":{"propertyName":"mode"},"oneOf":[{"properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"mode":{"const":"auto","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"repayAmount":{"description":"Debt to repay, in base units.","pattern":"^\\d+$","type":"string"},"slippage":{"description":"Slippage tolerance in 1e18 fixed point, as a decimal string. `10000000000000000` is 1%. Capped at `999800000000000000` (99.98%). A non-zero value below `100000000000000` (0.01%) is refused with 400 `invalid_parameters`: it can only be a unit mistake, such as a human `0.005` or `5` sent where the 1e18 string belongs.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"},"withdrawAmount":{"description":"Collateral to withdraw.","pattern":"^\\d+$","type":"string"}},"required":["chainId","mode","positionAddress","repayAmount","slippage","strategyId"],"type":"object"},{"properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"mode":{"const":"manual","type":"string"},"positionAddress":{"description":"Address of the Loopr position contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"repayAmount":{"description":"Debt to repay, in base units.","pattern":"^\\d+$","type":"string"},"strategyId":{"description":"Protocol-level strategy id. Not unique: the same id is reused across chains, and one chain hosts several strategies under it. A strategy is identified by the tuple `(chainId, strategyId, deposit token, borrow token)`; key on that, never on `strategyId` alone. The string `id` on a strategy object is an internal admin identifier that no route accepts.","minimum":0,"type":"integer"}},"required":["chainId","mode","positionAddress","repayAmount","strategyId"],"type":"object"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepayQuote"}}},"description":"Quote envelope. Expires at `expiresAt` (unix ms)."},"400":{"content":{"application/json":{"schema":{"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","unsupported_chain","position_contract_missing","over_repay"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request failed validation, names a chain this operation does not support, or names a `positionAddress` that is not a deployed position."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"No strategy matches the supplied `strategyId`/`chainId`.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["strategy_not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"No strategy matches the supplied `strategyId`/`chainId`."},"422":{"content":{"application/json":{"schema":{"description":"The quote cannot be computed for this request against current state. The `swap-*` codes come from the swap leg and carry a structured `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["swap-no-route","swap-price-impact-too-high","swap-amount-too-low","ambiguous_strategy","deleverage_exceeds_collateral","multi_hop_quote_unsupported"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The quote cannot be computed for this request against current state. The `swap-*` codes come from the swap leg and carry a structured `detail`. `ambiguous_strategy` means the request’s tokens match strategies on several markets and nothing in it chose one, so the route refuses rather than guess. An identical retry answers the same. On an open (`/quote/open`, `/build/open`) the body carries `strategyKeys`: resend with one of them as `strategyKey`. On a route that manages an existing position the market comes from the position, so this answers only when it could not be read, and no keys are listed."},"429":{"content":{"application/json":{"schema":{"oneOf":[{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"},{"properties":{"detail":{"description":"The serialized swap failure. `kind` is `rate-limited`; `backend` names the aggregator.","type":"object"},"error":{"const":"swap-rate-limited","type":"string"}},"required":["detail","error"],"type":"object"}]}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again. An upstream swap aggregator is rate-limiting us. Transient and not a fault: wait the `Retry-After` seconds (10) and send the same request again. A 500 is the status that means stop and report.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"oneOf":[{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"},{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure.","type":"string"},"error":{"const":"compute_repay_quote_failed","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}]}}},"description":"Either the quote could not be computed (`compute_repay_quote_failed`), or the request failed before reaching the compute step (`internal_error`). Branch on `error`; both are server-side and neither is fixed by changing the request."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Quote repaying debt or deleveraging","tags":["Loopr"]}},"/simulate":{"post":{"description":"Dry-runs the steps from a `/build/*` response against current chain state so a client can surface a revert before asking the user to sign. All steps must share one `chainId`.","operationId":"simulateSteps","requestBody":{"content":{"application/json":{"schema":{"properties":{"expiresAt":{"description":"Optional. The server keeps its own record of when each build expires, keyed by the steps themselves, and enforces that whether or not this is sent: steps from an expired build answer 410 `build_expired`, and a later value here cannot extend them. This field is consulted only for steps the server has no record of (assembled by hand, or edited after the build), where a past value still answers 410 — sparing an agent from reading a stale-balance or stale-gas failure where the real cause is an expired build.","type":"integer"},"overrides":{"additionalProperties":false,"properties":{"from":{"description":"Account the simulation runs as, normally the EOA.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"share":{"description":"Which Tenderly frames get published as public share links. `failure-only` keeps a passing simulation private; `none` publishes nothing and returns no `simulationId`; omitted shares every frame the response returns.","enum":["returned","failure-only","none"],"type":"string"}},"required":["from"],"type":"object"},"steps":{"items":{"description":"One unsigned transaction. Send in array order; each step must confirm before the next is sent.","properties":{"chainId":{"description":"EVM chain id. Must be a chain the partner is scoped to.","exclusiveMinimum":0,"type":"integer"},"data":{"description":"Calldata, 0x-prefixed hex.","pattern":"^0x[0-9a-fA-F]*$","type":"string"},"kind":{"description":"`sca-deploy` deploys or installs a module on the smart account, `approve` grants an ERC-20 allowance (two in a row when a stale non-zero allowance is first reset to zero, which tokens such as USDT require), `execute` performs the Loopr operation.","enum":["sca-deploy","approve","execute"],"type":"string"},"label":{"description":"Human-readable step description, safe to show in a UI.","type":"string"},"to":{"description":"Destination contract.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"value":{"description":"Native value to send with the call, in wei.","pattern":"^\\d+$","type":"string"}},"required":["chainId","data","kind","label","to","value"],"type":"object"},"minItems":1,"type":"array"}},"required":["overrides","steps"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Per-step simulation outcome, including the decoded revert reason where one occurred. Carries `buildId` when the steps are those of a `/build/*` response, the same id that build returned."},"400":{"content":{"application/json":{"schema":{"description":"The steps failed validation, or span more than one chain.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters","mixed_chain_ids_unsupported"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The steps failed validation, or span more than one chain."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"410":{"content":{"application/json":{"schema":{"description":"These steps came from a build that has expired, by the server’s own record of it or, for steps it has no record of, by the `expiresAt` in the request body. The body carries the `expiresAt` that was enforced, and the build’s `buildId` when the server has a record of it. Build fresh steps rather than simulating stale ones.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["build_expired"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"These steps came from a build that has expired, by the server’s own record of it or, for steps it has no record of, by the `expiresAt` in the request body. The body carries the `expiresAt` that was enforced, and the build’s `buildId` when the server has a record of it. Build fresh steps rather than simulating stale ones."},"429":{"content":{"application/json":{"schema":{"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded. Either this partner's SIMULATE budget for the client IP (30 requests / 60s), or the host-wide simulation ceiling — the same figures, keyed on client IP alone and shared across every partner and every build that is pre-flighted. Callers behind shared egress can hit the second while inside the first. Honour the `Retry-After` header.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`upstream_rate_limited`: a node provider is throttling us; wait and resend. `rate_limited`: request budget exceeded. Either this partner's SIMULATE budget for the client IP (30 requests / 60s), or the host-wide simulation ceiling — the same figures, keyed on client IP alone and shared across every partner and every build that is pre-flighted. Callers behind shared egress can hit the second while inside the first. Honour the `Retry-After` header."},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"502":{"content":{"application/json":{"schema":{"description":"The upstream simulation provider could not be reached or returned an error.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["simulation_failed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The upstream simulation provider could not be reached or returned an error."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Simulate built transaction steps","tags":["Loopr"]}},"/strategies":{"get":{"description":"Returns the strategies this partner is scoped to, narrowed further by any query filters. Comma-separated parameters must not contain empty entries — omit the key instead.","operationId":"listStrategies","parameters":[{"description":"Comma-separated collateral token addresses.","in":"query","name":"assets","schema":{"type":"string"}},{"description":"Single chain to query.","in":"query","name":"chainId","schema":{"type":"integer"}},{"description":"Comma-separated chain ids.","in":"query","name":"chainIds","schema":{"type":"string"}},{"description":"Include delisted strategies. Needed to resolve positions on strategies that are no longer offered. Defaults to enabled-only.","in":"query","name":"includeDisabled","schema":{"enum":["true","false"],"type":"string"}},{"description":"When supplied, each strategy's `collaterals.asset.balance` carries this address's balance of the collateral token. Omitted per-strategy if the read fails.","in":"query","name":"owner","schema":{"description":"Address to read collateral balances for.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},{"description":"Comma-separated protocol slugs.","in":"query","name":"protocols","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Strategy"},"type":"array"}}},"description":"Matching strategies. An empty array means the filters matched nothing — a scope that denies everything answers 403 instead."},"400":{"content":{"application/json":{"schema":{"description":"Request body or query parameters failed validation. `detail` lists the offending fields.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_parameters"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"Request body or query parameters failed validation. `detail` lists the offending fields."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"429":{"content":{"application/json":{"schema":{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"List available Loopr strategies","tags":["Loopr"]}},"/strategies/{id}":{"get":{"description":"`id` is not unique on its own. Where one chain hosts several strategies under the same id (strategy 10 on chain 1 borrows USDT and USDC against the same collateral), pass `borrowAsset` (or `borrowToken`) and, if that is not enough, `depositToken` to pick one; where strategies on different markets share all three, pass `strategyKey`. An ambiguous match answers 409 with the `candidates` to choose from rather than guessing.","operationId":"getStrategy","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"in":"query","name":"chainId","required":true,"schema":{"type":"integer"}},{"description":"Collateral token, to disambiguate.","in":"query","name":"depositToken","schema":{"description":"Collateral token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},{"description":"Debt token, to disambiguate. The same as `borrowToken`, under the name `/quote/open` and the strategy object use; sending both with different tokens answers 400 `invalid_borrow_token`.","in":"query","name":"borrowAsset","schema":{"description":"Debt token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},{"description":"Debt token, to disambiguate. Alias of `borrowAsset`.","in":"query","name":"borrowToken","schema":{"description":"Debt token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},{"description":"Market, to disambiguate when the tokens match too: the `strategyKey` of a 409 candidate. A malformed key answers 400 `invalid_strategy_key`.","in":"query","name":"strategyKey","schema":{"description":"Names one market when several strategies share `strategyId`, chain and tokens, written `{chainId}:{strategyId}:{protocol}:{identity}`. Optional: send it only after a request answered `ambiguous_strategy` (pick one of that response’s `strategyKeys`, or the `strategyKey` of a `/strategies/{id}` candidate). A strategy keyed to another market never matches it.","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Strategy"}}},"description":"The matching strategy."},"400":{"content":{"application/json":{"schema":{"description":"A path or query parameter is missing or malformed.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["invalid_id","missing_chain_id","invalid_chain_id","invalid_deposit_token","invalid_borrow_token","invalid_strategy_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"A path or query parameter is missing or malformed."},"401":{"content":{"application/json":{"schema":{"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["missing_partner_id","unknown_partner","invalid_api_key"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The `X-Partner-Id` header is absent, or names a partner that does not exist or is disabled; or an `X-Api-Key` was sent that does not match an active server secret for that key. `invalid_api_key` carries a `detail` saying how to fix it, and reads the same whether the key has no secrets or the value is wrong."},"403":{"content":{"application/json":{"schema":{"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["origin_not_allowed","chain_not_allowed","asset_not_allowed"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"The request `Origin` is not in the partner's registered allowlist and no `X-Api-Key` server secret was sent, or the requested chain or asset is outside the scope registered for this partner. Scope is `(chainId, collateral token)` pairs, never a strategy id: `asset_not_allowed` means the strategy's collateral is not granted to this key, and granting it opens every strategy on that collateral. A partner scoped to an explicit list with zero entries is denied everything."},"404":{"content":{"application/json":{"schema":{"description":"No strategy in this partner's scope matches. A strategy that exists but whose collateral is not granted to this key answers this 404 too, as the list omits it; the quote and build routes answer 403 `asset_not_allowed` for the same row.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["not_found"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"No strategy in this partner's scope matches. A strategy that exists but whose collateral is not granted to this key answers this 404 too, as the list omits it; the quote and build routes answer 403 `asset_not_allowed` for the same row."},"409":{"content":{"application/json":{"schema":{"properties":{"candidates":{"description":"One entry per matching strategy, naming what selects it. Retry with its `borrowAsset`, its `depositToken` if the borrow asset alone is shared, and its `strategyKey` if the tokens are shared too.","items":{"properties":{"borrowAsset":{"description":"Debt token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"depositToken":{"description":"Collateral token.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"strategyKey":{"description":"Names one market when several strategies share `strategyId`, chain and tokens, written `{chainId}:{strategyId}:{protocol}:{identity}`. Optional: send it only after a request answered `ambiguous_strategy` (pick one of that response’s `strategyKeys`, or the `strategyKey` of a `/strategies/{id}` candidate). A strategy keyed to another market never matches it. `null` for a candidate with no market of its own (an unkeyed protocol, or a row missing its market): its tokens or `borrowAsset` already select it.","type":["string","null"]}},"type":"object"},"type":"array"},"count":{"description":"Number of strategies that matched.","type":"integer"},"detail":{"type":"string"},"error":{"const":"ambiguous_strategy","type":"string"}},"required":["error"],"type":"object"}}},"description":"Several strategies match. Add `borrowAsset`, `depositToken` and, where the tokens are shared, `strategyKey` from one of the `candidates` to select one."},"429":{"content":{"application/json":{"schema":{"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["rate_limited","upstream_rate_limited"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`rate_limited`: request budget exceeded for this partner. Budgets are per partner and client IP and depend on the route family — between 30 and 300 requests per 60s. `upstream_rate_limited`: not your budget — a node provider is throttling us, and the same request will succeed shortly (`Retry-After` is 10). Either way, honour the `Retry-After` header rather than assuming a fixed figure, then send the same request again.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"properties":{"code":{"description":"Kebab-cased class name of the underlying failure. `error` is the constant `internal_error` on this shape, so `code` is the field to branch on.","type":"string"},"error":{"const":"internal_error","type":"string"},"requestId":{"description":"Correlates with the server-side log entry. Quote it in support requests.","type":"string"}},"required":["code","error","requestId"],"type":"object"}}},"description":"Unhandled server error."},"503":{"content":{"application/json":{"schema":{"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry.","properties":{"detail":{"description":"Human-readable detail. Present on `invalid_parameters` and on the 422 build-failure codes.","type":"string"},"error":{"enum":["partner_strategies_unavailable"],"type":"string"}},"required":["error"],"type":"object"}}},"description":"`partner_strategies_unavailable`: this integration serves its own strategies, and they could not be read. Nothing is served from Odyssey’s catalog alone in their place. Retry."}},"summary":"Fetch one strategy by id and chain","tags":["Loopr"]}}},"security":[{"partnerId":[]},{"partnerId":[],"partnerSecret":[]}],"servers":[{"description":"Odyssey Loopr Partner API","url":"https://app.odyssey.finance/api/partner/v1/loopr"}],"tags":[{"description":"Leveraged yield farming: strategy discovery, quoting, transaction building, and position reads.","name":"Loopr"}]}