{"openapi":"3.1.0","info":{"title":"MultiHopper Self-Service API","version":"1.0.0","description":"Public REST API for quotes, transfers, webhooks, and usage reporting.\n\nFlow: estimate → create → prepare (unsigned txs) → sign + broadcast with the source wallet → confirm-broadcast. The server holds no user keys.\n\nPricing: fees come from the program's on-chain fee schedule — a percent fee plus a per-hop charge that ramps with the transfer's USD value. The tier is chosen exactly as the program chooses it: from the Raydium CLMM pool price the program reads, applied to the post-fee hop amount. The percent fee is split 50/50 with the integrator atomically on chain; the per-hop charge goes entirely to MultiHopper.\n\nMulti-destination: pass `destinations` instead of `recipientWallet` to pay several wallets from one route. No destination appears in the route's hop list; each is paid from an on-chain commitment after the last hop."},"servers":[{"url":"/","description":"Current local or deployed origin"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"mh_live_* or mh_test_*"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message","requestId"]}},"required":["error"]},"Pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["total","limit","offset"]},"EstimateFeeRequest":{"type":"object","properties":{"tokenMint":{"type":"string","description":"Solana mint address. Use native SOL mint for SOL transfers.","example":"So11111111111111111111111111111111111111112"},"amountRaw":{"type":"string","description":"Integer string in base units.","example":"1000000"},"tokenDecimals":{"type":"integer","minimum":0,"maximum":18,"default":9,"example":9},"tokenPriceUsd":{"type":"number","description":"Fallback USD price, used ONLY when the on-chain pool price cannot be read (see `priceSource` in the response). The chain never uses it.","example":1},"hops":{"type":"integer","minimum":3,"maximum":10,"example":3},"destinationCount":{"type":"integer","minimum":1,"maximum":20,"description":"Price a multi-destination transfer to this many destinations (adds the payout accounts' rent and transactions to `sol`)."},"arrivalSeconds":{"type":"integer","minimum":60,"maximum":2592000,"description":"The transfer's arrivalSeconds. Prices the TRM re-screens of payouts that run after the screener's reuse window (about 6 hours); omitted means within it."},"route":{"$ref":"#/components/schemas/CustomRoute"},"routeTemplateId":{"type":"integer","description":"Price a saved route template (POST /api/v1/route-templates) as if its hops were sent as `route`. Not with `route`.","example":5}},"required":["tokenMint","amountRaw"]},"FeeEstimate":{"type":"object","properties":{"tier":{"type":"string","example":"tier_2"},"tierIndex":{"type":"integer","example":2,"description":"Index into the on-chain fee schedule — the `tier_index` the program will record."},"percentFeeBps":{"type":"integer","example":50},"percentFeeRaw":{"type":"string","example":"4969527","description":"floor(hopAmountRaw × percentFeeBps / 10000), in token base units (lamports for SOL)."},"flatFeeLamportsPerHop":{"type":"integer","example":375000,"description":"The tier's per-hop charge. Ramps with the transfer's USD value."},"flatFeeLamportsPerRoute":{"type":"integer","example":0,"description":"The tier's once-per-route charge."},"totalFlatFeeLamports":{"type":"integer","example":1125000,"description":"flatFeeLamportsPerRoute + flatFeeLamportsPerHop × hops, in lamports."},"integratorPercentShare":{"type":"string","example":"2484763","description":"Your half of the percent fee, paid atomically on chain."},"integratorFlatShare":{"type":"integer","example":0,"description":"Always 0: the flat/per-hop charge is not shared with integrators."},"usdEquivalent":{"type":"number","example":120,"description":"USD value of `amountRaw`, for display. Settlement remains in native token units."},"usdValueMicros":{"type":"string","example":"119268656","description":"The program's `usd_value_micros` for `hopAmountRaw` (USD × 1e6) — the value that selects the tier."},"priceSource":{"type":"string","enum":["onchain_pool","override","oracle"],"description":"`onchain_pool`: priced from the pool the program reads, so the quote is what the chain will charge. Otherwise an estimate from `tokenPriceUsd` or the price oracle; /prepare re-checks it on chain."},"hopAmountRaw":{"type":"string","example":"993905472","description":"The on-chain hop amount: what the recipient (or all destinations together) receives."},"cappedAtTierBoundary":{"type":"boolean","description":"True when `amountRaw` sits just above a tier boundary where no exact fee inversion exists; the hop is capped at the top of the lower tier and the wallet spends slightly less than `amountRaw`."},"destinationCount":{"type":["integer","null"]},"route":{"type":"object","description":"Present when the request priced a custom route: its hops on chain (your wallets, plus the recipient) and its duration.","properties":{"hopCount":{"type":"integer","example":4},"arrivalSeconds":{"type":"integer","example":900}}},"isTestMode":{"type":"boolean","example":true},"tokens":{"type":"object","properties":{"amountRaw":{"type":"string","example":"1000000"},"feeRaw":{"type":"string","example":"500"},"netDeliveredRaw":{"type":"string","example":"999500"},"decimals":{"type":"integer","example":9}},"required":["amountRaw","feeRaw","netDeliveredRaw","decimals"]},"sol":{"type":"object","properties":{"requiredSolUpFrontLamports":{"type":"integer","example":8500000},"minTransferAmountLamports":{"type":"integer","example":2039280,"description":"Minimum principal for a native-SOL route (the first hop must wrap at least the wSOL rent-exempt floor). 0 for SPL routes."},"breakdown":{"type":"object","properties":{"routeInitRentLamports":{"type":"integer"},"orchestratorRentLamports":{"type":"integer"},"ataRentLamports":{"type":"integer"},"transactionFeesLamports":{"type":"integer"},"priorityFeesLamports":{"type":"integer"},"protocolFlatFeeLamports":{"type":"integer"},"screeningFeeLamports":{"type":"integer","description":"TRM screening fee charged at deploy (in /prepare's orchestrator-init transaction) when compliance is enabled, 0 otherwise. Per screened wallet: the hops, the sender, the route's creator and each destination, plus a re-screen for payouts that run after about 6 hours. Not refunded: it pays for the screen."},"dispersionRentLamports":{"type":"integer","description":"Multi-destination only (0 otherwise): the payout orchestrator + one step account per destination. Refundable when the steps close."}},"required":["routeInitRentLamports","orchestratorRentLamports","ataRentLamports","transactionFeesLamports","priorityFeesLamports","protocolFlatFeeLamports","screeningFeeLamports"]},"refundableLamports":{"type":"integer","example":4000000},"netCostLamports":{"type":"integer","example":4500000}},"required":["requiredSolUpFrontLamports","minTransferAmountLamports","breakdown","refundableLamports","netCostLamports"]}},"required":["tier","percentFeeBps","percentFeeRaw","flatFeeLamportsPerHop","totalFlatFeeLamports","integratorPercentShare","integratorFlatShare","usdEquivalent","isTestMode","tokens","sol"]},"CreateTransferRequest":{"type":"object","properties":{"tokenMint":{"type":"string","example":"So11111111111111111111111111111111111111112"},"tokenSymbol":{"type":"string","example":"SOL"},"tokenDecimals":{"type":"integer","minimum":0,"maximum":18,"example":9},"amountRaw":{"type":"string","example":"1000000"},"amountTokens":{"type":"string","example":"0.001"},"sourceOwner":{"type":"string","description":"Pubkey of the wallet that signs the route-init bundle and pays for it (also the on-chain creator).","example":"D9VA5Yz6Y5e6zxdWLJ8pSc4SGrPMgsV1sU6DB1DGWKwa"},"recipientWallet":{"type":"string","description":"Single recipient. Provide exactly one of `recipientWallet` or `destinations`.","example":"7wqP9wt5yWQ7Mzf1J8Q4J7gY9E1eP8x5NsQmY1rN2d3G"},"destinations":{"type":"array","minItems":1,"maxItems":20,"description":"Pay several wallets from one route. `amountRaw` values are each destination's SHARE of the transfer's `amountRaw` and must sum to it exactly; each destination receives its share of the post-fee hop amount (see `destinations[].amountRaw` on the Transfer). Wallets must be distinct. On SOL transfers each share must stay above the rent-exempt minimum after fees (MH_017). No destination appears in the route's hop list.","items":{"type":"object","properties":{"wallet":{"type":"string","example":"7pBqizvE8vQZ29F49NWSu9cho3s7M9SqJyNN1UoQyQ2u"},"amountRaw":{"type":"string","example":"600000000"}},"required":["wallet","amountRaw"]}},"hops":{"type":"integer","minimum":3,"maximum":10,"example":3},"arrivalSeconds":{"type":"integer","minimum":60,"maximum":2592000,"example":60,"description":"Seconds from now until delivery; at most 30 days. Not with `route`, which sets its own timing."},"route":{"$ref":"#/components/schemas/CustomRoute"},"routeTemplateId":{"type":"integer","description":"Create the transfer on a saved route template (POST /api/v1/route-templates): its hops are used as `route` and copied onto the transfer, so later edits to the template do not change it. Not with `route`, `hops` or `arrivalSeconds`. MH_021 if the integration has no such template.","example":5},"externalId":{"type":"string","example":"order-123"},"tokenPriceUsd":{"type":"number","description":"Optional pricing context used for tier selection when required by the selected asset.","example":1}},"required":["tokenMint","amountRaw","amountTokens","sourceOwner"]},"PreparedTxBundle":{"type":"object","description":"Resumable deployment bundle. /prepare probes on-chain state and only emits txs whose effects have NOT yet landed. Re-call /prepare after a partial broadcast to resume; null/empty fields are pieces already on-chain. Broadcast order: keeperFundingTx → routeInitTxs → orchestratorInitTx → sessionInitTxs → dispersionInitTxs (skip any null/empty), each confirmed before the next.","properties":{"routeInitTxs":{"type":"array","description":"Pending route-init transactions. Empty when route already deployed (and all hops added + ALT cached). Each tx is partially signed by required ephemeral signers; the user wallet only needs to add its own signature.","items":{"type":"object","properties":{"base64":{"type":"string","description":"base64-encoded VersionedTransaction."}},"required":["base64"]}},"orchestratorInitTx":{"type":["string","null"],"description":"base64-encoded unsigned orchestrator-init transaction. Null when the orchestrator config PDA is already on-chain."},"sessionInitTxs":{"type":"array","items":{"type":"string"},"description":"Pending session-init transactions (init_step × N + ATA pre-init). Drops entries whose step_state PDAs already exist on-chain."},"keeperFundingTx":{"type":["string","null"],"description":"Standalone keeper-funding tx. Null when the keeper already holds enough lamports for this route's execution."},"dispersionInitTxs":{"type":"array","items":{"type":"string"},"description":"Multi-destination transfers only (always [] otherwise): the payout orchestrator, one committed step per destination, and the route's exit binding. Sign with the source wallet and broadcast in order, AFTER routeInitTxs. confirm-broadcast refuses to start the transfer (MH_041) until all of it is on chain."},"recentBlockhash":{"type":"string"},"lastValidBlockHeight":{"type":"integer"},"resume":{"type":"object","description":"On-chain progress snapshot used to decide which pieces above were skipped. Lets clients render a precise resume-from-here UI.","properties":{"routeAlreadyDeployed":{"type":"boolean"},"existingHopCount":{"type":"integer"},"totalHops":{"type":"integer"},"orchestratorAlreadyInitialized":{"type":"boolean"},"completedStepIndices":{"type":"array","items":{"type":"integer"}},"totalSteps":{"type":"integer"},"keeperAlreadyFunded":{"type":"boolean"},"dispersion":{"type":["object","null"],"description":"Multi-destination transfers: how much of the payout binding is on chain. null otherwise.","properties":{"totalDestinations":{"type":"integer"},"orchestratorInitialized":{"type":"boolean"},"stepsInitialized":{"type":"integer"},"routeExitBound":{"type":"boolean"}}},"nothingToDo":{"type":"boolean","description":"True when every bundle is empty — deployment is fully on-chain."}},"required":["routeAlreadyDeployed","existingHopCount","totalHops","orchestratorAlreadyInitialized","completedStepIndices","totalSteps","keeperAlreadyFunded","nothingToDo"]}},"required":["routeInitTxs","orchestratorInitTx","sessionInitTxs","keeperFundingTx","dispersionInitTxs","recentBlockhash","lastValidBlockHeight","resume"]},"Transfer":{"type":"object","properties":{"route":{"type":["object","null"],"description":"The route's hops on chain, in order, once the transfer has a route (create and GET of one transfer). Library wallets carry their label and category.","properties":{"hops":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","example":0},"address":{"type":"string","example":"64CuV85HHCydAwxQMoXwZ9HXoyw5qE65NkiJxCtuFErF"},"label":{"type":["string","null"],"example":"OKX Hot Wallet 10"},"category":{"type":["string","null"],"example":"cex"},"scheduledAt":{"type":"string","format":"date-time"},"executedAt":{"type":["string","null"],"format":"date-time"},"txSignature":{"type":["string","null"]}},"required":["index","address","scheduledAt"]}}}},"id":{"type":"integer","example":42},"externalId":{"type":["string","null"],"example":"order-123"},"supportBundleId":{"type":["string","null"],"example":"sb_7g8h9i"},"tokenMint":{"type":"string","example":"So11111111111111111111111111111111111111112"},"tokenSymbol":{"type":["string","null"],"example":"SOL"},"amountRaw":{"type":"string","example":"1000000"},"amountTokens":{"type":"string","example":"0.001"},"sourceOwner":{"type":"string","example":"D9VA5Yz6Y5e6zxdWLJ8pSc4SGrPMgsV1sU6DB1DGWKwa"},"recipientWallet":{"type":["string","null"],"description":"null for a multi-destination transfer.","example":"7wqP9wt5yWQ7Mzf1J8Q4J7gY9E1eP8x5NsQmY1rN2d3G"},"destinationCount":{"type":["integer","null"],"example":2},"destinations":{"type":["array","null"],"description":"Multi-destination transfers: what each destination receives and whether it has been paid.","items":{"type":"object","properties":{"wallet":{"type":"string"},"amountRaw":{"type":"string","description":"This destination's share of the on-chain hop amount."},"status":{"type":"string","enum":["pending","paid"]},"payoutSignature":{"type":["string","null"]},"paidAt":{"type":["string","null"],"format":"date-time"}},"required":["wallet","amountRaw","status","payoutSignature","paidAt"]}},"fundingStrategy":{"type":["string","null"],"example":"direct_orchestration"},"hops":{"type":"integer","example":3},"arrivalSeconds":{"type":"integer","example":60},"pricingTier":{"type":["string","null"],"example":"tier_2"},"percentFeeBps":{"type":["integer","null"],"example":50},"percentFeeRaw":{"type":"string","example":"4969527"},"flatFeeLamportsPerHop":{"type":"integer","example":375000},"totalFlatFeeLamports":{"type":["integer","null"],"example":1125000},"recipientReceivesRaw":{"type":"string","example":"993905472","description":"What the recipient — or all destinations together — receives: the on-chain hop amount."},"status":{"type":"string","description":"A multi-destination transfer stays `active` after its last hop until every destination has been paid; `completed` means everyone was paid.","enum":["quote","awaiting_signature","processing","active","completed","failed","expired","refunded"],"example":"awaiting_signature"},"isTest":{"type":"boolean","example":true},"quotedAt":{"type":["string","null"],"format":"date-time"},"depositReceivedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"phase":{"type":"string","enum":["quoted","funding","deploying","executing","settled","failed","recoverable","expired","rescued","reclaimed"],"example":"executing"},"progress":{"type":"object","properties":{"hopsCompleted":{"type":"integer","example":2},"hopsTotal":{"type":"integer","example":5}},"required":["hopsCompleted","hopsTotal"]},"lastError":{"type":["object","null"],"properties":{"code":{"type":"string","example":"MH_042"},"message":{"type":"string"},"at":{"type":"string","format":"date-time"}},"required":["code","message","at"]},"recovery":{"type":["object","null"],"description":"Populated when phase is in {failed, recoverable, settled, rescued}; null otherwise.","properties":{"canRescue":{"type":"boolean"},"rescuableLamports":{"type":"integer"},"rescuableAccounts":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["route_pda","step_state","orchestrator_config","keeper","ata"]},"lamports":{"type":"integer"}},"required":["kind","lamports"]}},"canReclaimRent":{"type":"boolean"},"reclaimableLamports":{"type":"integer"}},"required":["canRescue","rescuableLamports","rescuableAccounts","canReclaimRent","reclaimableLamports"]},"signatures":{"type":"object","properties":{"routeInit":{"type":"array","items":{"type":"string"}},"sessionInit":{"type":"array","items":{"type":"string"}},"hops":{"type":"array","items":{"type":"string"}}},"required":["routeInit","sessionInit","hops"]}},"required":["id","tokenMint","amountRaw","amountTokens","sourceOwner","hops","arrivalSeconds","status","isTest","createdAt"]},"RescueBundle":{"type":"object","properties":{"rescueTxs":{"type":"array","items":{"type":"object","properties":{"base64":{"type":"string"},"partialSigners":{"type":"array","items":{"type":"string"}}},"required":["base64","partialSigners"]}},"recentBlockhash":{"type":"string"},"lastValidBlockHeight":{"type":"integer"},"rescuable":{"type":"object","properties":{"totalLamports":{"type":"integer"},"accounts":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"lamports":{"type":"integer"}},"required":["kind","lamports"]}}},"required":["totalLamports","accounts"]}},"required":["rescueTxs","recentBlockhash","lastValidBlockHeight","rescuable"]},"ReclaimBundle":{"type":"object","properties":{"reclaimTxs":{"type":"array","items":{"type":"object","properties":{"base64":{"type":"string"},"partialSigners":{"type":"array","items":{"type":"string"}}},"required":["base64","partialSigners"]}},"recentBlockhash":{"type":"string"},"lastValidBlockHeight":{"type":"integer"},"reclaimable":{"type":"object","properties":{"totalLamports":{"type":"integer"},"stepCount":{"type":"integer"}},"required":["totalLamports","stepCount"]}},"required":["reclaimTxs","recentBlockhash","lastValidBlockHeight","reclaimable"]},"TransferList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Transfer"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["items","pagination"]},"WebhookCreateRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","example":"https://example.com/multihopper/webhooks"},"events":{"type":"array","items":{"type":"string","enum":["transfer.quote_created","transfer.deposit_confirmed","transfer.processing","transfer.hop_complete","transfer.completed","transfer.failed","transfer.expired","transfer.refunded","transfer.phase_changed","transfer.recoverable","transfer.rescued","transfer.rent_reclaimed"]},"example":["transfer.completed","transfer.failed"]}},"required":["url"]},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"integer","example":1},"url":{"type":"string","format":"uri","example":"https://example.com/multihopper/webhooks"},"secret":{"type":["string","null"],"example":"whsec_1234567890abcdef"},"events":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]},"isActive":{"type":"boolean","example":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","url","isActive","createdAt"]},"WebhookEndpointList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["items"]},"CustomRoute":{"type":"object","description":"A route whose hops you choose: each one a wallet of your own or a `bundle` drawn from the hop library (GET /api/v1/hop-library) when the transfer is created, with how long the funds wait there. To one `recipientWallet`, the route ends on the recipient, added as the last hop. Paying several `destinations`, it ends on its last hop, which must be a regular wallet (not a program-derived address or a program). Rules: 2 to 9 hops to one recipient, 3 to 10 when paying several; waits from 20 seconds to 30 days and at most 30 days in all; no hop may be the sender, the recipient, a destination, a protocol account or repeated. Every problem with a route comes back at once (MH_018), so POST /api/v1/transfers/estimate with the same `route` is a free dry run. Each hop is TRM-screened when the route starts, and costs about 0.0019 SOL of token-account rent that is not refunded.","properties":{"hops":{"type":"array","minItems":1,"maxItems":10,"items":{"oneOf":[{"type":"object","properties":{"wallet":{"type":"string","description":"A wallet address of your choice.","example":"DQTf1yf1YM4B48PqJyQ53SEWGDM6ib4YBV7P3wm2MCxj"},"waitSeconds":{"type":"integer","minimum":20,"maximum":2592000,"example":120}},"required":["wallet","waitSeconds"],"additionalProperties":false},{"type":"object","properties":{"bundle":{"type":"string","enum":["cex","dex","exchanges","kol","contracts","mix"],"description":"Draw this hop at random from the library: exchanges (cex), DEX accounts (dex), both (exchanges), KOL wallets (kol), smart contracts (contracts) or every category (mix)."},"waitSeconds":{"type":"integer","minimum":20,"maximum":2592000,"example":300}},"required":["bundle","waitSeconds"],"additionalProperties":false}]}}},"required":["hops"],"example":{"hops":[{"bundle":"cex","waitSeconds":120},{"wallet":"DQTf1yf1YM4B48PqJyQ53SEWGDM6ib4YBV7P3wm2MCxj","waitSeconds":300},{"bundle":"kol","waitSeconds":600}]}},"RouteTemplate":{"type":"object","description":"A saved custom route: a named `route.hops` list, private to your integration. Use it with `routeTemplateId` on POST /api/v1/transfers or /estimate. Bundle hops are drawn again for each transfer. It is checked both ways it can be used, on every read: `usableFor` says whether it works with `recipientWallet` and with `destinations`, and `problems` says why not.","properties":{"id":{"type":"integer","example":5},"name":{"type":"string","example":"exchange-hop"},"description":{"type":["string","null"],"example":"Through one exchange and one KOL wallet"},"route":{"$ref":"#/components/schemas/CustomRoute"},"arrivalSeconds":{"type":"integer","description":"The sum of the waits.","example":1020},"usableFor":{"type":"object","properties":{"recipientWallet":{"type":"boolean","example":true},"destinations":{"type":"boolean","example":true}},"required":["recipientWallet","destinations"]},"problems":{"type":"object","description":"For each way it cannot be used, why (the MH_018 messages it would get). Empty when both work.","properties":{"recipientWallet":{"type":"array","items":{"type":"string"}},"destinations":{"type":"array","items":{"type":"string"}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","route","arrivalSeconds","usableFor","problems","createdAt","updatedAt"]},"RouteTemplateRequest":{"type":"object","description":"Save a route template. Refused (MH_018) only when its hops make a route neither way; up to 100 per integration (MH_023); names are unique per integration (MH_022).","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9 ._-]*$","example":"exchange-hop"},"description":{"type":["string","null"],"maxLength":500},"route":{"$ref":"#/components/schemas/CustomRoute"}},"required":["name","route"],"additionalProperties":false},"HopLibrary":{"type":"object","description":"The vetted wallets a custom route can draw hops from: the same library Easy Routes use. Each hop receives the route's wrapped token for its wait, then the program moves it on; the wallet never signs anything.","properties":{"wallets":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string","example":"64CuV85HHCydAwxQMoXwZ9HXoyw5qE65NkiJxCtuFErF"},"label":{"type":"string","example":"OKX Hot Wallet 10"},"category":{"type":"string","enum":["cex","dex","famous","kol","contracts","other"]},"canEndRoute":{"type":"boolean","description":"A regular (on-curve) wallet: it can be the LAST hop of a route paying several destinations. Program-derived addresses and programs work as middle hops only."}},"required":["address","label","category","canEndRoute"]}},"bundles":{"type":"array","description":"What a `{ \"bundle\": ... }` hop draws from, and how many wallets it has.","items":{"type":"object","properties":{"id":{"type":"string","enum":["cex","dex","exchanges","kol","contracts","mix"]},"categories":{"type":"array","items":{"type":"string"}},"available":{"type":"integer","example":74}},"required":["id","categories","available"]}},"categories":{"type":"array","items":{"type":"string"}}},"required":["wallets","bundles","categories"]},"UsageSummary":{"type":"object","description":"Integration usage and revenue-share summary. Your share is paid atomically on chain inside every route creation, so every payout counted here is already settled — there is nothing to claim.","properties":{"totalTransfers":{"type":"integer","example":3},"completedTransfers":{"type":"integer","example":2},"failedTransfers":{"type":"integer","example":1},"totalVolumeRaw":{"type":"string","example":"3000000000"},"totalFlatFeeEarned":{"type":"integer","example":3300000,"description":"Your share of the SOL-denominated fees, in lamports: on SOL transfers the whole fee (percent + per-hop), on SPL transfers the flat/per-hop part."},"totalPayouts":{"type":"integer","example":3,"description":"On-chain fee events that credited your rewards wallet."},"tokenFeesEarned":{"type":"array","description":"Your share of the PERCENT fee on SPL transfers, per mint, in that token's base units.","items":{"type":"object","properties":{"tokenMint":{"type":["string","null"]},"tokenDecimals":{"type":["integer","null"]},"amountRaw":{"type":"string"}}}},"isTestMode":{"type":"boolean"}},"additionalProperties":true}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"paths":{"/api/v1/transfers/estimate":{"post":{"summary":"Estimate transfer fees","description":"Quotes exactly what the program will charge: the tier is selected from the Raydium CLMM pool price the program reads, applied to the post-fee hop amount, against the on-chain fee schedule. `priceSource` says whether that pool was readable. Pass `destinationCount` to price a multi-destination transfer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateFeeRequest"}}}},"responses":{"200":{"description":"Fee estimate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeeEstimate"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/transfers":{"post":{"summary":"Create a transfer (quote)","description":"Locks the quote (tier, fees, and the on-chain hop amount) and creates the internal route. Pass `recipientWallet` for one recipient, or `destinations` to pay several wallets from one route. Then call /prepare for the unsigned transactions. Errors: MH_011 (`recipientWallet` is a program-derived address (PDA): a plain transfer ends on its recipient, which must be a regular wallet; a Revolver or `destinations` may pay a PDA), MH_017 (destinations cannot be paid on this cluster/token, or a share is too small after fees).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransferRequest"}}}},"responses":{"200":{"description":"Transfer created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transfer"}}}}}},"get":{"summary":"List transfers","parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"fromDate","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"toDate","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"externalId","in":"query","schema":{"type":"string"}},{"name":"supportBundleId","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Transfer list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferList"}}}}}}},"/api/v1/transfers/{transferId}":{"get":{"summary":"Get a transfer by id","parameters":[{"name":"transferId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Transfer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transfer"}}}},"404":{"description":"Transfer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/transfers/{transferId}/prepare":{"post":{"summary":"Build the unsigned transactions for a transfer","description":"Returns every transaction the source wallet must sign, omitting pieces already on chain (resumable). Re-checks the quoted tier against the on-chain price first: MH_040 means the price crossed a tier boundary since the quote — create a new transfer.","parameters":[{"name":"transferId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Unsigned transactions","content":{"application/json":{"schema":{"type":"object","properties":{"transfer":{"$ref":"#/components/schemas/Transfer"},"preparedTxs":{"$ref":"#/components/schemas/PreparedTxBundle"}},"required":["transfer","preparedTxs"]}}}},"409":{"description":"MH_040 — tier shifted since quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/transfers/{transferId}/confirm-broadcast":{"post":{"summary":"Confirm the broadcast transactions","description":"Verifies the signatures on chain and hands the transfer to the keeper. For a multi-destination transfer the payout binding (dispersionInitTxs) must be on chain first, or this returns MH_041 and nothing starts — broadcast the missing transactions and call again.","parameters":[{"name":"transferId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keeperFundingSignature":{"type":"string"},"routeInitSignatures":{"type":"array","items":{"type":"string"}},"orchestratorInitSignature":{"type":"string"},"sessionInitSignatures":{"type":"array","items":{"type":"string"}},"dispersionInitSignatures":{"type":"array","items":{"type":"string"},"description":"Multi-destination transfers: signatures of preparedTxs.dispersionInitTxs, in order."}},"required":["routeInitSignatures"]}}}},"responses":{"200":{"description":"Transfer handed to the keeper","content":{"application/json":{"schema":{"type":"object","properties":{"transfer":{"$ref":"#/components/schemas/Transfer"}}}}}},"409":{"description":"MH_041 — destinations not yet bound on chain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/transfers/by-external/{externalId}":{"get":{"summary":"Get a transfer by external id","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Transfer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transfer"}}}}}}},"/api/v1/webhooks":{"post":{"summary":"Register a webhook endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}}},"responses":{"200":{"description":"Webhook created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}},"get":{"summary":"List webhook endpoints","responses":{"200":{"description":"Webhook list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}}}}},"/api/v1/webhooks/{endpointId}":{"delete":{"summary":"Delete a webhook endpoint","parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Webhook deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","example":true}},"required":["deleted"]}}}}}}},"/api/v1/transfers/{transferId}/rescue/prepare":{"post":{"summary":"Prepare rescue txs (catastrophic recovery)","description":"Builds unsigned rescue transactions when a transfer has failed and funds are locked in PDAs. Allowed only when phase is 'failed' or 'recoverable'.","parameters":[{"name":"transferId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Rescue bundle","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RescueBundle"}}}},"409":{"description":"MH_080 / MH_081"}}}},"/api/v1/transfers/{transferId}/rescue/confirm":{"post":{"summary":"Confirm rescue txs","parameters":[{"name":"transferId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rescueSignatures":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["rescueSignatures"]}}}},"responses":{"200":{"description":"Updated transfer","content":{"application/json":{"schema":{"type":"object","properties":{"transfer":{"$ref":"#/components/schemas/Transfer"}},"required":["transfer"]}}}}}}},"/api/v1/transfers/{transferId}/reclaim-rent/prepare":{"post":{"summary":"Prepare reclaim-rent txs (post-completion cleanup)","parameters":[{"name":"transferId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Reclaim bundle","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReclaimBundle"}}}},"409":{"description":"MH_080 / MH_082"}}}},"/api/v1/transfers/{transferId}/reclaim-rent/confirm":{"post":{"summary":"Confirm reclaim-rent txs","parameters":[{"name":"transferId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reclaimSignatures":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["reclaimSignatures"]}}}},"responses":{"200":{"description":"Per-signature confirmation result","content":{"application/json":{"schema":{"type":"object","properties":{"confirmed":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"object","properties":{"signature":{"type":"string"},"error":{"type":"string"}},"required":["signature","error"]}}},"required":["confirmed","failed"]}}}}}}},"/api/v1/hop-library":{"get":{"summary":"List the hop library","description":"The vetted wallets (exchanges, DEX accounts, KOLs, smart contracts and active traders) a custom route can use as hops, either by address or as a `bundle` drawn at random when the transfer is created. Not available on devnet: build routes from your own wallets there (MH_019).","parameters":[{"name":"category","in":"query","schema":{"type":"string","enum":["cex","dex","famous","kol","contracts","other"]}},{"name":"bundle","in":"query","schema":{"type":"string","enum":["cex","dex","exchanges","kol","contracts","mix"]}},{"name":"canEndRoute","in":"query","description":"Only wallets that can (true) or cannot (false) be the last hop.","schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"The library","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HopLibrary"}}}},"400":{"description":"MH_019: the hop library is not available in this environment"}}}},"/api/v1/route-templates":{"post":{"summary":"Save a route template","description":"Saves a custom route under a name, to reuse with `routeTemplateId`. Requires an Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteTemplateRequest"}}}},"responses":{"200":{"description":"The saved template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteTemplate"}}}},"400":{"description":"MH_018 (no valid route either way), MH_019, MH_023 (limit reached), or a malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"MH_022: the name is taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List route templates","parameters":[{"name":"name","in":"query","description":"Only the template with this exact name.","schema":{"type":"string"}}],"responses":{"200":{"description":"Your integration's templates, by name","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RouteTemplate"}}},"required":["items"]}}}}}}},"/api/v1/route-templates/{templateId}":{"get":{"summary":"Get a route template","parameters":[{"name":"templateId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteTemplate"}}}},"404":{"description":"MH_021: no such template in your integration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Change a route template","description":"Changes its name, description or route; send at least one. Transfers already created from it keep their hops. Requires an Idempotency-Key.","parameters":[{"name":"templateId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9 ._-]*$"},"description":{"type":["string","null"],"maxLength":500},"route":{"$ref":"#/components/schemas/CustomRoute"}},"additionalProperties":false}}}},"responses":{"200":{"description":"The changed template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteTemplate"}}}},"404":{"description":"MH_021","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"MH_022: the new name is taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a route template","description":"Transfers already created from it keep their hops. Requires an Idempotency-Key.","parameters":[{"name":"templateId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","example":true}},"required":["deleted"]}}}},"404":{"description":"MH_021","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/usage":{"get":{"summary":"Get usage summary","parameters":[{"name":"fromDate","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"toDate","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Usage summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummary"}}}}}}}}}