Lease API
The Lease API exposes Hydra App's LiquidityService — a service-backed surface for provisioning channel liquidity, releasing channels (withdraw or cooperative close), and extending existing asset leases: what the service offers, the leases it holds for your node, and the requests your node makes of it.
(2026-10-14) A request is submitted, then followed. A Submit* call answers once your node has settled its part of the fee — or failed to — with the request as it then stands; Get Liquidity Request and Subscribe Liquidity Requests follow it until it is final. Name each request with a client_request_id and a call that was cut off can be read back or safely sent again. See Submitting and following a request.
JSON-RPC namespace: liquidity
Endpoints
- Submit Channel Liquidity Request
- Submit Channel Release Request
- Submit Liquidity Batch
- Submit Channel Lease Extension Request
- Get Liquidity Request
- Get Liquidity Requests (2026-11-25)
- Subscribe Liquidity Requests
- Request Channel Liquidity (deprecated)
- Estimate Request Channel Liquidity Fee
- Request Channel Release (deprecated)
- Estimate Request Channel Release Fee
- Estimate Liquidity Batch Fee
- Request Channel Lease Extension (deprecated)
- Estimate Request Channel Lease Extension Fee
Read-only discovery
- Get Liquidity Service Info
- Get Leaseable Asset Info
- Get Leases
- Get Lease Expiries
- Subscribe Lease Events (2026-11-25)
- Get Fee Payments
Common types
ChannelLiquidityRequestOperation (one of)
Used by SubmitChannelLiquidityRequest, the deprecated RequestChannelLiquidity, and their estimator. Exactly one variant must be set.
| Variant | Fields | Purpose |
|---|---|---|
open | target_node_pubkey?, asset_liquidity, min_dispute_period_secs | Open a new channel and provision liquidity |
deposit | channel_id, asset_liquidity | Deposit into an existing channel |
deposit_any | target_node_pubkey?, asset_liquidity, min_dispute_period_secs | Deposit into any suitable channel; otherwise open a new one |
open_or_deposit | target_node_pubkey?, asset_liquidity, min_dispute_period_secs | Same as deposit_any but biases toward opening |
asset_liquidity is map<string, AssetLiquidity> keyed by asset_id.
(2026-11-17) deposit_any and open_or_deposit deposit into your channel wherever one payment over it can then carry all the deposit adds. A channel whose receive_ceiling, fixed below its total, would cut what the deposit adds is passed over, and a new one opened.
min_dispute_period_secs (2026-09-25) is the least dispute period the funded channel must carry — see dispute_period on Get Node Policy. An existing channel that falls short on any requested asset is not topped up, and a channel opened to serve the request is opened to carry it. Zero requires nothing; a period past the longest the hub's node accepts on a channel is refused at the quote (INVALID_ARGUMENT). A deposit names its channel, window included, so it carries no requirement.
On an EVM or Tron network your node raises min_dispute_period_secs of open, deposit_any and open_or_deposit to its own proposal (dispute_period.proposed on Get Node Policy) before sending the request, so the provider's liquidity only lands in a channel held to the terms your node opens on today. An older, shorter channel is passed over and a new one opened.
A channel a cooperative close drained is still topped up: on EVM and Tron it only withdrew everything, its asset channels read Closed with force_closed: false yet stay updatable, and a deposit reopens them in place. A channel with nothing left open — every asset channel sealed by a settlement, or closed for good — is never topped up, even for an asset it does not carry yet.
AssetLiquidity:
| Field | Type | Description |
|---|---|---|
server_amount | DecimalString | Required. Provider-side contribution; zero when the provider puts none in |
client_amount | DecimalString | Required. Local/client-side contribution (used for service-broadcasted outbound funding or dual-funded requests); zero when your node puts none in |
Both sides are required. One left out is refused with FAILURE_REASON_MALFORMED_REQUEST, naming the asset and the side: “invalid operation: the liquidity of {asset_id} names no client_amount” — in a batch “invalid opens{index}: …” or “invalid operation on {channel_id}: …”.
ChannelReleaseOperation (one of)
Used by SubmitChannelReleaseRequest, the deprecated RequestChannelRelease, and their estimator. Exactly one variant must be set.
| Variant | Fields | Purpose |
|---|---|---|
withdraw | channel_id, asset_amounts{} | Cooperatively withdraw funds from the channel. The service broadcasts one withdrawal paying each asset's requested side(s) out, and pays the gas. |
cooperative_close | channel_id, asset_ids[] | Cooperatively close asset channels. Empty asset_ids closes every asset channel; otherwise only the listed ones. |
withdraw.asset_amounts — per-asset, per-side split
Changed 2026-07-23 — breaking: this replaced the old asset_ids[] list.
asset_amounts is a map of asset_id → AssetWithdrawAmounts:
| Field | Type | Description |
|---|---|---|
server_amount | Amount (optional) | Releases the service's own balance to the service wallet |
client_amount | Amount (optional) | Pays the client's balance out to the client's wallet |
An absent side withdraws nothing; at least one side must be present. channel_id may be absent on fee estimates only (EstimateRequestChannelReleaseFee) — a swap quotes its exit before the channel exists — and every requested side must then be an exact amount.
On EVM and Tron an exact client_amount past what your node's side can take out while the channel stays open is refused before the service is asked, at the estimate and at the request, with FAILURE_REASON_INSUFFICIENT_CHANNEL_BALANCE: “The withdrawal from {channel_id} takes {amount} of {asset_id} out of this node's side, which can take out {available} while the channel stays open”. The reserve is not part of it: only a close pays it out. all takes what there is.
⚠️ Absent means absent, not""(2026-09-13)
channel_idisoptional, and an empty string is not the sentinel. The service checks that you own the channel you named, and no empty string satisfies that check — so a quote built with""comes back priced for somebody else's channel, and the operation silently falls to a rail you did not ask for.Omit the field.
optionalis the same bytes on the wire as an unsetstring, so a client either side of this change reads the other correctly; what changed is that the generated types now carry the case, so it is harder to forget.
Migrating from
asset_ids[]: a list entry"0xTOKEN"becomes a map entry"0xTOKEN": { client_amount: { exact: { amount: "..." } } }— you must now say how much and whose balance moves, not just which asset.
On Bitcoin
A withdraw of the service's side (server_amount) is a splice-out: the channel stays open, your side is untouched, and the service's reserve stays in the channel. Only a cooperative_close pays the reserves out.
A withdraw that names client_amount is refused with INVALID_ARGUMENT: a splice pays out only the side that broadcasts it, and the service broadcasts this one. Withdraw your own side with WithdrawChannel on your node, or settle both sides with cooperative_close.
A channel the hub opened on demand stays open until keep_open_until
(2026-10-14) The hub sells a channel it opens on demand with a lifetime, and until the lifetime ends it neither takes anything out of one of its asset channels nor closes it of its own accord. Your node shows that lifetime as AssetChannel.peer_keep_open_until, the hub's node as its own keep_open_until. Counted in blocks, it can only be estimated in time: your node reports it a margin before its last block is expected, so you never count on more than you bought, and the hub holds itself to a margin after, so it never closes early — the hub's time is the later. (2026-10-29) The lifetime does not hold back what you ask for: a withdraw or cooperative_close of such an asset channel, a withdrawal of part of the hub's side included, is estimated and carried out as for any other channel. You may also close the channel from your own node, whenever you choose.
(2026-10-14) The lifetime is a lease. Once the payment the channel was opened for has settled in it, the asset channel carries a lease until the hub's keep_open_until, which its opening fee paid for: the lease's expiry in Get Leases and Get Lease Expiries shows it, on a boundary of the provider's lease clock, and moves later with the hub's time. The lease rents what the hub lent into the asset channel — its side of it once that payment had settled, the capital that gives you inbound liquidity. Keep the channel past the lifetime by extending the lease, or with a deposit that carries a lease_duration, as with any lease: the extension rents that capital for the time it adds past lease_expiry, never for time the lifetime already covers.
LiquidityBatch
(2026-10-29) Several operations on one network, carried out under one fee: one operation on each of your node's channels it names, and channels opened, at most one to each node. Used by Submit Liquidity Batch and Estimate Liquidity Batch Fee. A batch carries at least one operation.
| Field | Type | Description |
|---|---|---|
channels | map<string, ChannelBatchOperation> | Channel id → the one operation on that channel |
opens | ChannelBatchOpen[] | Channels to open, at most one to each node, in the order asked |
ChannelBatchOperation (one of)
| Variant | Fields | Purpose |
|---|---|---|
deposit | asset_liquidity, lease_duration_seconds? | Add liquidity to the channel. asset_liquidity is map<string, AssetLiquidity>, as for a deposit of a single request: at least one asset, each with a side above zero |
withdraw | asset_amounts | Withdraw from the channel, which stays open. Asset id → what each side withdraws, as withdraw.asset_amounts of a single release. At least one asset |
close | asset_ids | Cooperatively close the named asset channels of the channel. At least one: a batch names every asset it settles |
lease_extension | lease_extension_seconds | Extend the leases of asset channels of the channel: map<string, uint64>, asset id → the seconds to add to its lease (AssetChannelLease.expiry), rounded up to whole slots of the service's lease clock, as LeaseExtensionTerms reports them. At least one asset, each above zero |
lease_duration_seconds is how long the service's contribution is leased for: required when an asset asks the service for liquidity (server_amount above zero), refused when none does. The lease runs that long from when the service funds it, and ends on the next boundary of its lease clock (GetLiquidityServiceInfo's lease_slot_secs).
ChannelBatchOpen
| Field | Type | Description |
|---|---|---|
asset_liquidity | map<string, AssetLiquidity> | What each side puts in. At least one asset, each with a side above zero |
lease_duration_seconds | uint64 (optional) | As for a deposit |
min_dispute_period_secs | uint64 | The least dispute period the channel must carry, as for an open of a single request. Zero requires nothing |
target_node_pubkey | string (optional) | The node the channel is opened to. Absent, or naming your own node, opens it to your node, and the request records it as absent |
An open for another node opens with the batch when that node is connected to the service, and otherwise once it connects, until the lease it buys would have ended. One that never opens is refunded as an operation not carried out is — see When it stops part way — which is why such an open is paid for on onchain or offchain only.
LiquidityBatchFeePayment
How the service is paid for a batch.
| Field | Type | Description |
|---|---|---|
payment_network | Network | The network the fee is paid on |
payment_asset_id | string | The asset the fee is paid in |
method | one of | onchain (OnchainFeePayment) · offchain · dual_fund · sponsored_deposit · sponsored_withdrawal. Which of them a batch can be paid on depends on what it holds — see Which rail a batch is paid on |
Fee payment (one of)
All RPCs that take a fee require exactly one fee_payment variant.
(2026-10-14) Which variants a provider accepts, and in which assets, is published in GetLiquidityServiceInfo's fee_payment_assets, with what each one charges. A fee in an asset or on a rail missing there is refused with FAILED_PRECONDITION before it is priced.
| Variant | Fields | When to use |
|---|---|---|
onchain_fee_payment | OnchainFeePayment (UTXO or Account flow) | Pay the service fee on chain |
offchain_fee_payment | OffchainFeePayment (empty) | Pay via invoice / offchain payment |
dual_fund_fee_payment | DualFundFeePayment (empty) | Settle the fee inside the dual-fund flow (provisioning RPCs only) |
sponsored_deposit_fee_payment | SponsoredDepositFeePayment (empty) | (2026-09-11) The wallet holds the token but none of the native asset. The service funds the channel from your tokens on its own transaction and takes its fee out of the deposit (provisioning RPCs only) |
sponsored_withdrawal_fee_payment | SponsoredWithdrawalFeePayment (empty) | (2026-09-11) The wallet holds a channel balance but none of the native asset. The service broadcasts the withdrawal and takes its fee out of what is released (release RPCs only) |
OnchainFeePayment (one of):
| Variant | Fields |
|---|---|
utxo | refund_address |
account | sender_address, refund_address? |
Fee methods are not interchangeable across the three operations:
Operation Accepts SubmitChannelLiquidityRequestonchain·offchain·dual_fund·sponsored_depositSubmitChannelReleaseRequestonchain·offchain·sponsored_withdrawalSubmitChannelLeaseExtensionRequestonchain·offchainSubmitLiquidityBatch(2026-10-29)By what the batch holds — see Which rail a batch is paid on The deprecated
Request*RPC of each operation, and its estimate, accept the same.
SponsoredDepositFeePayment — a deposit for a wallet with no gas
Added 2026-09-11.
The service funds the channel from this wallet's tokens, on its own transaction, and takes its fee out of the deposit. Hydra App signs the token permit that authorises the pull internally — you do not build or sign one yourself.
This exists for the wallet that holds a token and nothing else: no native asset, so no way to pay for a funding transaction of its own. Every other fee method assumes you can broadcast.
The fee is the quote the request references, or the service's price at execution when it references none — see Quotes. Because the fee comes out of the deposit, the channel ends up holding less than client_amount; estimate first so the user sees which figure is which.
The same rail inside a simple swap is
DEPOSIT_RAIL_LIQUIDITY_SERVICE, and its post-swap counterpart isEXIT_RAIL_LIQUIDITY_SERVICE.
SponsoredWithdrawalFeePayment — an exit for a wallet with no gas
Added 2026-09-11. Release requests only (SubmitChannelReleaseRequest, the deprecated RequestChannelRelease, and (2026-10-29) a batch of withdrawals and closes).
The service broadcasts this wallet's withdrawal on its own transaction and takes its fee out of what is released — credited to the service in the state co-signed alongside it. Hydra App arms the funding allowance that authorises the credit internally; you do not call SetFundingAllowance yourself.
The gap this closesRelease used to offer two ways to pay, and a wallet with a channel balance and none of the native asset could use neither:
- On-chain needs a funded wallet — which is exactly what is missing.
- Off-chain needs a channel balance to pay the invoice from — but
withdraw allis about to take that balance away.So the channel was stranded: funds in it, no way to get them out. This is the only fee method that works from that state, and it is why it exists.
What your node actually does: arm the allowance authorising the credit, then confirm. It never pays a fee of its own, so it takes the funding-allowance confirmation path a dual-funded open takes rather than the settlement path. A request you never confirm takes its allowance back rather than leaving standing consent for the service to draw on.
The fee is the quote the request references, or the service's price at execution when it references none — the same rule as every other method; see Quotes.
The whole fee rides the first release that pays the fee's asset out on your side, which has to be able to pay it: a withdrawal of an exact amount needs that amount and the fee out of what your side can take out while the channel stays open; a withdrawal of everything needs more than the fee there; a close takes the fee out of the whole side, reserve included. One that cannot is refused, at the estimate and at the request, with FAILURE_REASON_FEES_EXCEED_AMOUNT, and nothing is billed:
- “The withdrawal from {channel_id} cannot carry the {fee} fee: with the {amount} it takes out that is {total} of {asset_id}, and this node's side can take out {available} while the channel stays open”
- “The withdrawal from {channel_id} cannot carry the {fee} fee: this node's side can take out {available} of {asset_id} while the channel stays open, which leaves nothing past the fee”
- “The close of {channel_id} cannot carry the {fee} fee: this node's side holds {held} of {asset_id}”
Because the fee comes out of the released amount, what lands in your wallet is less than the balance you withdrew. Estimate first so the user sees both figures.
The mechanism underneath is the generic
UpdateChannelBalanceCredit— a withdrawal that hands part of itself to the peer. The swap-flow equivalent isEXIT_RAIL_LIQUIDITY_SERVICE; the entry-side counterpart isSponsoredDepositFeePayment.
Quotes: pinning an estimated price
Added 2026-09-11.
Every Estimate*Fee call returns a quote alongside the fee:
| Field | Type | Description |
|---|---|---|
fee | DecimalString | The estimated fee, in the asset named by payment_asset_id |
quote_id | string (optional) | Names the quote this fee was read from |
valid_until | Timestamp (optional) | (2026-10-14) When the quote stops being honoured |
valid_until_timestamp_seconds | uint64 (optional) | Deprecated (2026-10-14): read valid_until. The same instant, in Unix seconds |
Pass quote_id back on the matching request and the service bills at that quote's price for as long as the quote is valid. Omit it and the service prices the request when it executes — which is a different number if the market moved in between.
A quote_id that has expired, or no longer fits the request, causes the request to be refused rather than silently re-priced. That is the point: the user agreed to a figure, and a request that can no longer honour it should come back for a fresh estimate, not quietly cost more.
Estimate*Fee ──▶ { fee, quote_id, valid_until }
│
show `fee` to the user, they accept
│
▼
Submit* ──▶ same request + quote_id ──▶ billed at `fee`
└─▶ refused if expired / changed
GetLiquidityServiceInfo.quote_validity_secsis how long every quote the service issues stays valid, so you can size the confirmation window before you ask for one.
A quote does not reserve liquidity. It fixes the price, not the capacity — a lease that no longer fits the provider's available liquidity is refused even inside its validity window.
Submitting and following a request
(2026-10-14) A request to the liquidity service runs in two phases, and the API splits along them.
- Submit.
SubmitChannelLiquidityRequest,SubmitChannelReleaseRequest,SubmitLiquidityBatchorSubmitChannelLeaseExtensionRequesthas the service commit to the request, settles your node's part of the fee, and answers with the request as it then stands:fee_settled, orfee_settlement_failedwith why. That normally takes seconds — on the on-chain rail, settled means your node broadcast the fee transfer, not that it confirmed. - Follow. The service carries the request out once it holds the fee: on the on-chain rail once the transfer has the confirmations its network requires, which can take minutes on Ethereum; on every other rail at once. Read the request with
GetLiquidityRequest, or watch it onSubscribeLiquidityRequests, until it is final:completed,failed,unresolvedorexpired.
An error from a Submit* call means the service made no request — the request was invalid, its quote expired or no longer fits, the provider refused it. There is nothing to follow: fix the request and submit it again.
Submit* ── error ──▶ no request was made: fix it and submit again
│
▼
awaiting_fee the service committed; your node pays its part of the fee
│
├──▶ fee_settled ┐
└──▶ fee_settlement_failed ┘ Submit* answers with one of these
│
│ the service carries the request out once it holds the fee:
│ on-chain rail — once the transfer has its confirmations
│ every other rail — at once
▼
completed · failed · unresolved final
expired final: fee_deadline passed before the service
received the fee, and nothing was billed
Every request your node makes is recorded, and GetLiquidityRequest, (2026-11-25) GetLiquidityRequests and SubscribeLiquidityRequests show it whichever way it was made: through a Submit* RPC, through one of the deprecated Request* RPCs, or by your node's own simple swaps when they provision liquidity.
fee_settledis not done. On the on-chain rail theSubmit*call answers as soon as the fee transfer is broadcast, and the service acts only once that transfer has the confirmations its network requires. Wait forcompletedbefore you rely on the channel, and read what the service did from itsresult.
client_request_id — naming a request
client_request_id is your own name for a request: a string of 1 to 64 characters, unique per node and network. It is optional, the Submit* RPCs take it, and it survives restarts of your node.
| Submitted under an id that… | Answer |
|---|---|
| names no request yet | The request is submitted under it |
| names this same request — every field the same | The request already made, as it stands now. Nothing is submitted again, and nothing is paid again |
| names a different request | ALREADY_EXISTS (JSON-RPC -32005) with client_request_id_taken: payment_uuid=<uuid>, naming the request the id already names. Nothing is submitted |
| another call is still submitting under | One request: the second call waits for the first and answers with its request |
- A request refused before the service committed to it — an error from
Submit*— leaves the id free, so the corrected request can go out under the same id. - Read a request back by its id with
GetLiquidityRequest. - An id outside 1 to 64 characters is refused with
INVALID_ARGUMENT:client_request_id must be 1 to 64 characters, got N. - The
Estimate*FeeRPCs ignore it. The deprecatedRequest*RPCs refuse a request that carries it, withINVALID_ARGUMENT.
Give every request an id, and recover by it. A
Submit*call that was cut off —DEADLINE_EXCEEDED, a dropped connection — may already have made the request: the submission runs on in your node whether or not its caller is still there. Submit again under the same id. That answers with the request the first call made, waiting for the first call if it is still running, and makes the request only if none was made.GetLiquidityRequestby the id reads it without submitting, but aNOT_FOUNDright after a cut-off call does not prove that nothing was made: the first call may not have reached the service yet. Without an id, nothing names the request but thepayment_uuidin the answer you lost.Resend the request exactly as you first sent it — the same
quote_idtoo. A retry that re-estimates first carries a newquote_id, which makes it a different request, and the id refuses it withclient_request_id_taken.
LiquidityRequest
A request your node submitted to the liquidity service, and where it stands: what every Submit* call, GetLiquidityRequest, (2026-11-25) GetLiquidityRequests and SubscribeLiquidityRequests return.
| Field | Type | Description |
|---|---|---|
payment_uuid | string | The service's id for the request: the payment_uuid of its fee payment in GetFeePayments |
client_request_id | string (optional) | Your name for the request, when it was submitted under one |
network | Network | The network of the channels the request operates on |
operation / batch | one of | What the request asks of the service, as it was committed. operation, a FeePaymentOperation, for a request made by a one-operation call — the shape GetFeePayments reports; (2026-10-29) batch, a LiquidityBatch, for one made by Submit Liquidity Batch |
rail | FeePaymentRail | How the fee is paid: ONCHAIN / OFFCHAIN / DUAL_FUND / SPONSORED_DEPOSIT / SPONSORED_WITHDRAWAL |
payment_network | Network | The network the fee is billed on — may differ from network |
payment_asset_id | string | The asset the fee is billed in |
fee | DecimalString | What the service bills, in whole units of payment_asset_id. (2026-11-17) On chain on Bitcoin, never below the smallest output the network relays to the service's deposit address: a smaller fee comes to that amount, above its estimate |
fee_deadline | Timestamp | Until when the service waits for your node's part of the fee. A request whose fee it has not received by then expires, and nothing is billed. Absent on DUAL_FUND, whose commitment states none |
fee_settlement | LiquidityFeeTransfer (one of) | How your node settled its part of the fee: onchain { txid }, the transfer it broadcast, or offchain { payment_id }, the payment's id as watchOnlyNode.GetPayments reports it. Absent until settled, and always absent on DUAL_FUND, SPONSORED_DEPOSIT and SPONSORED_WITHDRAWAL: the service broadcasts those rounds, and their fee never leaves a wallet. (2026-11-17) Absent too on ONCHAIN for a fee of zero, which is not sent |
created_at | Timestamp | When the service committed to the request, by your node's clock |
updated_at | Timestamp | When the request last changed |
state | one of | Where the request stands — see Request states |
carried_out | LiquidityBatchResult (optional) | (2026-10-29) For a batch: what the service has carried out of it so far, each operation that took effect, by kind. A batch whose open waits for its node shows the rest done, and one that stopped shows what stays done. Absent on a request of one operation |
Request states
Exactly one state is set. completed, failed, unresolved and expired are final.
| State | Final | Fields | Meaning |
|---|---|---|---|
awaiting_fee | no | — | The service committed to the request and waits for your node's part of the fee until fee_deadline. Normally lasts seconds, while your node pays |
fee_settled | no | — | Your node settled its part of the fee. The service carries the request out once it holds the fee — see what that takes on each rail |
fee_settlement_failed | no | reason | Your node could not settle its part of the fee, and does not try again. The service carries the request out only if the fee reached it all the same; otherwise it lets the request expire at fee_deadline |
completed | yes | result (optional) | The service carried the request out. result is what it reports it did — below |
failed | yes | reason, refund (both optional) | The service could not carry the request out. reason is in the service's words. refund, a LiquidityFeeRefund, appears once the service gives the fee back. (2026-10-29) A fee paid on chain is given back once the network has made the transaction that paid it final |
unresolved | yes | reason (optional) | The service stopped at an operation whose outcome it does not know, and says where in its own words. The operation may still take effect on chain, and no later change of the request reports whether it did. (2026-11-03) If it does not, the service may still give the fee back later, over your channel; the request keeps reading unresolved |
expired | yes | — | fee_deadline passed before the service received the fee. Nothing was billed |
completed.result is one of, in the shape of the request's operation or batch:
| Variant | Fields | Reports |
|---|---|---|
channel_liquidity | channel_id, txid | A provision: the channel the liquidity landed in — the one the request named, or the one the service opened or chose — and the transaction that put it there |
channel_release | channel_id, txid | A release: the channel and its withdrawal or cooperative close transaction |
channel_lease_extension | channel_id, asset_id, lease_expiry | A lease_extension: when the extended lease ends (AssetChannelLease.expiry, a Timestamp) |
liquidity_batch | LiquidityBatchResult | (2026-10-29) A batch: what the service did, operation by operation |
A batch that failed or stayed unresolved reports what it carried out before it stopped in the request's carried_out: those operations took effect, and stay done.
LiquidityBatchResult
(2026-10-29) What the service did for a batch, operation by operation: the result of a completed batch, and the carried_out of one still in progress or stopped.
| Field | Type | Description |
|---|---|---|
channels | map<string, ChannelBatchResult> | Channel id → what the service did with that channel, in the shape of the batch's operation on it — one of deposited { txid }, withdrawn { txid }, closed { txid }, lease_extended { lease_expiries } (asset id → when the extended lease ends, a Timestamp) |
opened | ChannelBatchOpenResult[] | The channels the batch opened, one per open carried out: target_node_pubkey (absent for your node), channel_id, and txid, the transaction that opened it |
Each on-chain operation names the transaction that carried it out, so the batch went out in one transaction when they all name the same one.
LiquidityFeeRefund
What the service gave back of a fee, and how it reached your node. A refund goes back the way the fee came: a fee paid on chain by a transaction to the payment's refund address, a fee paid off chain by a payment back over your node's channel. Fees on DUAL_FUND, SPONSORED_DEPOSIT and SPONSORED_WITHDRAWAL never leave a wallet and are never refunded.
| Field | Type | Description |
|---|---|---|
amount | DecimalString | What the service gave back of the fee, in whole units of payment_asset_id. An on-chain refund's transaction carries this less what the service estimated sending it would cost; an off-chain refund carries all of it |
transfer | LiquidityFeeTransfer (one of) | How the refund reached your node |
LiquidityFeeTransfer
How a fee, or its refund, moved between your node and the service. Exactly one variant is set:
| Variant | Fields | Description |
|---|---|---|
onchain | txid | A transaction on chain |
offchain | payment_id | A payment over your node's channel: its id, as watchOnlyNode.GetPayments reports it |
A final request changes only to take what it lacks: a completion's missing result, or the refund given after a failure.
completedwithout aresult,failedorunresolvedwithout areasonThese come from a reconnect. When your node reconnects to the liquidity service, it reads the service's fee-payment history for the requests still in progress and moves each to where the service has it. A request that completed while your node was not following the service takes the
resultits fee payment recorded (FeePayment.results), and iscompletedwithout one only when the service recorded none. A request that failed, or stopped at an operation whose outcome is unknown, meanwhile has noreason: the service's words never reached your node. Read the channel (watchOnlyNode.GetChannel) for what changed.
fee_settlement_failedis not final. The fee may still reach the service, and the request is then carried out as usual. Follow it to a final state before you submit the same request again — submitted twice, it can be carried out twice.
unresolvedmeans unknown, not failed. Its operation may still land on chain, and the request will never say whether it did. Read the channel before you submit the same operation again: a second deposit or withdrawal on top of one that landed is a second operation.
Submit Channel Liquidity Request
(2026-10-14) Ask the liquidity service to provision channel liquidity on your node's behalf. Answers once your node has settled its part of the fee, or failed to; the service then carries the request out on its own, and you follow it.
Method: SubmitChannelLiquidityRequest
Parameters: the RequestChannelLiquidityRequest that Request Channel Liquidity documents — every field, rule and refusal there applies here, What this RPC cannot provision included — plus:
| Name | Type | Required | Description |
|---|---|---|---|
client_request_id | string | no | (2026-10-14) Your own name for the request on this network, 1 to 64 characters — see client_request_id |
Response: SubmitLiquidityRequestResponse
| Field | Type | Description |
|---|---|---|
request | LiquidityRequest | The request as it stands when the call answers: fee_settled, or fee_settlement_failed with why. Under a client_request_id that already names this same request, that request in whatever state it has reached |
An error means the service made no request: every refusal Request Channel Liquidity documents, a quote_id that expired or no longer fits, the provider's refusal. There is nothing to follow. Fix the request and submit it again — under the same client_request_id if you like, since a refused request leaves it free.
What fee settled means on each rail
fee_payment | fee_settled means | Then the service |
|---|---|---|
onchain_fee_payment | Your node broadcast the fee transfer — seconds, not its confirmations | Carries the request out once the transfer has the confirmations its network requires: minutes on Ethereum |
offchain_fee_payment | Your node sent the invoice payment | Carries the request out at once |
dual_fund_fee_payment | Your node confirmed the funding allowance | Broadcasts the round at once. Its fee is carved out of the round: nothing leaves a wallet as a fee |
sponsored_deposit_fee_payment | Your node handed over the token permits | The same |
sponsored_withdrawal_fee_payment (release only) | Your node confirmed the funding allowance | The same: the fee comes out of what is released |
Deadline
A Submit* call runs under the 30 s request deadline — it is not exempt, as the deprecated Request* RPCs are — and normally answers in seconds. The submission runs on a task of its own in your node, so a caller that disconnects or is cut off does not stop it. A call cut off with DEADLINE_EXCEEDED (JSON-RPC -32002) may therefore have made the request: submit again under the same client_request_id, or read the request back by it with GetLiquidityRequest — see client_request_id. Without an id, look for the request on SubscribeLiquidityRequests or in GetFeePayments before you submit it again.
Example Request (open channel, offchain fee):
// `request` is the RequestChannelLiquidityRequest of the Request Channel Liquidity example.
request.setClientRequestId('lease-btc-0001') // your name for it: 1 to 64 characters
// An error here means the service made no request.
const submitted = (await client.submitChannelLiquidityRequest(request, {})).getRequest()!
if (submitted.hasFeeSettlementFailed()) {
// Not final: the fee may still reach the service. Follow the request.
console.warn('Fee not settled:', submitted.getFeeSettlementFailed()!.getReason())
}
console.log('Request:', submitted.getPaymentUuid(), 'fee:', submitted.getFee()?.getValue())
To wait for the request to finish, open Subscribe Liquidity Requests before you submit; Common Workflows puts the whole flow together.
Example Response:
{
"request": {
"paymentUuid": "5b0d3c1e-8f7a-4c52-9e1b-2a6f0d4c7e91",
"clientRequestId": "lease-btc-0001",
"network": { "protocol": "PROTOCOL_BITCOIN", "id": "0a03cf40" },
"operation": {
"provision": {
"operation": {
"open": {
"assetLiquidity": {
"0x0000000000000000000000000000000000000000000000000000000000000000": {
"serverAmount": { "value": "0.1" },
"clientAmount": { "value": "0" }
}
}
}
},
"leaseDurationSeconds": "2592000"
}
},
"rail": "FEE_PAYMENT_RAIL_OFFCHAIN",
"paymentNetwork": { "protocol": "PROTOCOL_BITCOIN", "id": "0a03cf40" },
"paymentAssetId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"fee": { "value": "0.0001" },
"feeDeadline": "2026-10-04T10:20:00Z",
"feeSettlement": { "offchain": { "paymentId": "9c1f0e7d..." } },
"createdAt": "2026-10-04T10:05:00Z",
"updatedAt": "2026-10-04T10:05:02Z",
"feeSettled": {}
}
}
Over JSON-RPC — submit under a clientRequestId, then read the request back by it. Keys are camelCase, uint64 values are strings, and each oneof is the key of its set arm, per the wire encoding:
curl -s -X POST http://127.0.0.1:5003 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "liquidity_submitChannelLiquidityRequest",
"params": [{
"network": { "protocol": "PROTOCOL_BITCOIN", "id": "0a03cf40" },
"operation": {
"open": {
"assetLiquidity": {
"0x0000000000000000000000000000000000000000000000000000000000000000": {
"serverAmount": { "value": "0.1" },
"clientAmount": { "value": "0" }
}
}
}
},
"leaseDurationSeconds": "2592000",
"paymentNetwork": { "protocol": "PROTOCOL_BITCOIN", "id": "0a03cf40" },
"paymentAssetId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"offchainFeePayment": {},
"clientRequestId": "lease-btc-0001"
}]
}'
# → {"jsonrpc":"2.0","id":1,"result":{"request":{"paymentUuid":"5b0d3c1e-...","clientRequestId":"lease-btc-0001",...,"feeSettled":{}}}}
curl -s -X POST http://127.0.0.1:5003 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "liquidity_getLiquidityRequest",
"params": [{
"network": { "protocol": "PROTOCOL_BITCOIN", "id": "0a03cf40" },
"clientRequestId": "lease-btc-0001"
}]
}'
# → {"jsonrpc":"2.0","id":2,"result":{"request":{...,"completed":{"channelLiquidity":{"channelId":"...","txid":"..."}}}}}
A call cut off by the deadline answers
{"code":-32002,…}in an ordinary HTTP 200 response. Send the first call again unchanged: under the sameclientRequestIdit answers with the request already made.
Submit Channel Release Request
(2026-10-14) Ask the liquidity service to withdraw from a channel or cooperatively close it on your node's behalf. Answers as Submit Channel Liquidity Request does: the same response, the same client_request_id rules, the same deadline, and an error the same way means no request was made.
Method: SubmitChannelReleaseRequest
Parameters: the RequestChannelReleaseRequest that Request Channel Release documents, plus client_request_id (string, optional).
Response: SubmitLiquidityRequestResponse — request, a LiquidityRequest. Completed, its result is channel_release { channel_id, txid }. On sponsored_withdrawal_fee_payment, fee_settled means your node confirmed the funding allowance, and the fee comes out of what is released.
A release submitted and followed to its end is in Common Workflows.
Submit Liquidity Batch
(2026-10-29) Ask the liquidity service to carry out several operations on one network under one fee: a deposit, withdrawal, close or lease extension on each of your node's channels the batch names, and channels opened, at most one to each node. Answers as Submit Channel Liquidity Request does: the same response, the same client_request_id rules, the same deadline, and an error the same way means no request was made.
Method: SubmitLiquidityBatch
Parameters:
| Field | Type | Description |
|---|---|---|
network | Network | The network of the channels |
batch | LiquidityBatch | The operations |
fee_payment | LiquidityBatchFeePayment | How the service is paid |
quote_id | string (optional) | The quote an earlier Estimate Liquidity Batch Fee of this same batch returned — see Quotes |
client_request_id | string (optional) | Your name for the request |
Response: SubmitLiquidityRequestResponse — request, a LiquidityRequest whose subject is batch. Completed, its result is liquidity_batch, a LiquidityBatchResult. Until then, and after a stop, its carried_out shows what took effect.
In what order, and in how many transactions
The service carries the operations out in this order, and stops at the first it cannot carry out:
- the lease extensions, one asset at a time — off chain;
- the withdrawals and closes, in channel id order;
- the deposits, in channel id order;
- the open to your node;
- the opens to other nodes, in the order asked.
The operations it carried out before it stopped stay done, and carried_out names each with its transaction.
| Network | Transactions |
|---|---|
| EVM, Tron | Every on-chain operation the batch runs goes out in one transaction. When that transaction cannot be broadcast, each operation co-signed for it goes out on its own |
| Bitcoin | The opens go out in one funding transaction, and every other operation in one of its own |
A lease extension needs no transaction. An open for another node whose node is not connected to the service is set apart: the rest of the batch goes ahead, carried_out shows it done, and the open goes out in a transaction of its own once its node connects. The request completes when it has.
Which rail a batch is paid on
fee_payment | Takes |
|---|---|
onchain, offchain | Any batch. A batch that opens or deposits on these rails must ask the service for liquidity (server_amount above zero) in at least one of its opens or deposits |
dual_fund | The open to your node, and deposits your node funds part of. The fee is carved out of your funding. The channel contract pulls your part from your wallet, so your wallet's token allowance to it must cover your part of every asset you fund; one that does not fails the request, and nothing is billed |
sponsored_deposit | The open to your node, and deposits your wallet funds alone, in tokens. The fee comes out of the deposit — see SponsoredDepositFeePayment |
sponsored_withdrawal | Withdrawals and closes, one of which pays the fee's asset out on your side. The fee comes out of what is released — see SponsoredWithdrawalFeePayment |
dual_fund, sponsored_deposit and sponsored_withdrawal serve EVM and Tron networks only, with the fee paid on the channel's network. An open for another node is paid for on onchain or offchain only.
When it stops part way
On onchain and offchain the operations not carried out are refunded, as the failed request's refund: what each of them was billed for itself — its setup and its lease. (2026-10-29) The setup of an operation the provider lends into is what the provider's node charges for that liquidity, the channel's close included the first time the provider funds the channel, so an operation not carried out gives that close back too. What the least setup fee (min_fee_usd) added on top of the operations' own setups is kept. An operation whose outcome is unknown, and the ones its transaction carries after it, count as carried out: those may still take effect. On the other three rails the fee is taken out of the operations that carry it, and nothing is refunded.
Example. (2026-10-29) An open to another node, which never connects, billed 2.17 USDC on Sepolia: 1.36 for its setup — the provider's node's charge for the liquidity, its funding (0.29) and the new channel's close (1.07) — and 0.81 for its lease. It is the whole batch, so all 2.17 USDC is refunded. Had the batch also deposited on one of your channels, which went through, the deposit would keep what it was billed for itself, and the open's 2.17 would come back.
A batch is not all or nothing. Read
carried_outon a request that failed or stayed unresolved before you submit any of its operations again: each one it names took effect.
Refusals
Your node refuses a malformed batch before anything is billed, with FAILURE_REASON_MALFORMED_REQUEST unless the table says otherwise. reads “The operation on {channel_id}”, “The open to {node}” or “The open to this node”.
| Message | Reason |
|---|---|
| A batch carries at least one operation | |
| The batch opens more than one channel to {node} — or “to this node” | |
| names no asset | |
| puts a negative amount of {asset_id} in | FAILURE_REASON_INVALID_AMOUNT |
| puts none of {asset_id} in on either side | FAILURE_REASON_INVALID_AMOUNT |
| asks the service for liquidity without a lease duration | FAILURE_REASON_LEASE_DURATION_REQUIRED |
| carries a lease duration but asks the service for no liquidity | |
| The withdrawal from {channel_id} names no side of {asset_id} | |
| The withdrawal from {channel_id} takes a negative amount of {asset_id} | FAILURE_REASON_INVALID_AMOUNT |
| The lease extension of {asset_id} in {channel_id} adds no time | FAILURE_REASON_INVALID_AMOUNT |
| The open to {node} is paid for on chain or off chain only | |
| The withdrawal from {channel_id} takes {amount} of {asset_id} out of this node's side, which can take out {available} while the channel stays open | FAILURE_REASON_INSUFFICIENT_CHANNEL_BALANCE |
The withdrawal from {channel_id} — or the close of {channel_id} — cannot carry the {fee} fee: … (sponsored_withdrawal only; see SponsoredWithdrawalFeePayment) | FAILURE_REASON_FEES_EXCEED_AMOUNT |
The service then holds the batch to the refusals each of its operations carries in a single request, and to its rails' rules.
curl -s -X POST http://127.0.0.1:5003 -H 'Content-Type: application/json' -d '{
"jsonrpc": "2.0", "id": 1, "method": "liquidity_submitLiquidityBatch",
"params": [{
"network": { "protocol": "PROTOCOL_EVM", "id": "42161" },
"batch": {
"channels": {
"0x5a0c…8f20": { "withdraw": { "assetAmounts": {
"erc20:0xaf88…5831": { "clientAmount": { "exact": { "amount": { "value": "20" } } } } } } },
"0xc31f…b153": { "leaseExtension": { "leaseExtensionSeconds": { "erc20:0xaf88…5831": "604800" } } }
},
"opens": [ {
"assetLiquidity": { "erc20:0xaf88…5831": { "serverAmount": { "value": "100" }, "clientAmount": { "value": "0" } } },
"leaseDurationSeconds": "604800",
"minDisputePeriodSecs": "0"
} ]
},
"feePayment": { "paymentNetwork": { "protocol": "PROTOCOL_EVM", "id": "42161" },
"paymentAssetId": "erc20:0xaf88…5831", "offchain": {} },
"quoteId": "…",
"clientRequestId": "batch-usdc-0001"
}]
}'
# → {"jsonrpc":"2.0","id":1,"result":{"request":{"paymentUuid":"…","batch":{…},…,"feeSettled":{}}}}
# … then on liquidity_subscribeLiquidityRequests, once it is carried out:
# → {"paymentUuid":"…","batch":{…},"completed":{"liquidityBatch":{
# "channels":{"0x5a0c…8f20":{"withdrawn":{"txid":"0x7c1e…"}},
# "0xc31f…b153":{"leaseExtended":{"leaseExpiries":{"erc20:0xaf88…5831":"2026-12-01T00:00:00Z"}}}},
# "opened":[{"channelId":"0x91d4…","txid":"0x7c1e…"}]}},
# "carriedOut":{…}}
The withdrawal and the open name the same transaction: the batch went out in one.
Submit Channel Lease Extension Request
(2026-10-14) Extend the lease of one asset on a channel. Answers as Submit Channel Liquidity Request does.
Method: SubmitChannelLeaseExtensionRequest
Parameters: the RequestChannelLeaseExtensionRequest that Request Channel Lease Extension documents — read what an extension rents there — plus client_request_id (string, optional).
Response: SubmitLiquidityRequestResponse — request, a LiquidityRequest. Completed, its result is channel_lease_extension { channel_id, asset_id, lease_expiry }: when the extended lease ends.
Get Liquidity Request
(2026-10-14) One request your node submitted, as it stands now, by the service's id or by your client_request_id. Read-only and local: your node answers from its own record, with no round trip to the liquidity service.
Method: GetLiquidityRequest
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | The network the request was submitted on |
id | one of | YES | payment_uuid (string), the service's id for the request, or client_request_id (string), your name for it |
Response:
| Field | Type | Description |
|---|---|---|
request | LiquidityRequest | The request as it stands now |
NOT_FOUND (JSON-RPC -32004, no such liquidity request) when your node holds no such request on that network. Right after a Submit* call was cut off, that can mean the submission has not reached the service yet — see client_request_id.
Example Request:
import { GetLiquidityRequestRequest } from './proto/liquidity_pb'
const get = new GetLiquidityRequestRequest()
get.setNetwork({ protocol: 1, id: '0a03cf40' })
get.setClientRequestId('lease-btc-0001') // or setPaymentUuid(...)
const request = (await client.getLiquidityRequest(get, {})).getRequest()!
if (request.hasCompleted()) {
const result = request.getCompleted()!.getChannelLiquidity() // absent if the report was missed
console.log('Channel:', result?.getChannelId(), 'TX:', result?.getTxid())
}
Example Response:
{
"request": {
"paymentUuid": "5b0d3c1e-8f7a-4c52-9e1b-2a6f0d4c7e91",
"clientRequestId": "lease-btc-0001",
"network": { "protocol": "PROTOCOL_BITCOIN", "id": "0a03cf40" },
"operation": {
"provision": {
"operation": {
"open": {
"assetLiquidity": {
"0x0000000000000000000000000000000000000000000000000000000000000000": {
"serverAmount": { "value": "0.1" },
"clientAmount": { "value": "0" }
}
}
}
},
"leaseDurationSeconds": "2592000"
}
},
"rail": "FEE_PAYMENT_RAIL_OFFCHAIN",
"paymentNetwork": { "protocol": "PROTOCOL_BITCOIN", "id": "0a03cf40" },
"paymentAssetId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"fee": { "value": "0.0001" },
"feeDeadline": "2026-10-04T10:20:00Z",
"feeSettlement": { "offchain": { "paymentId": "9c1f0e7d..." } },
"createdAt": "2026-10-04T10:05:00Z",
"updatedAt": "2026-10-04T10:05:41Z",
"completed": {
"channelLiquidity": { "channelId": "ch_def456", "txid": "abc123..." }
}
}
}
Get Liquidity Requests
(2026-11-25) Every request your node holds on a network, in every state, each as it stands now: newest first by created_at, the payment_uuid breaking a tie. Read-only and local, as Get Liquidity Request is. It is the one record of how your node settled a fee (fee_settlement) and of the client_request_id a request went out under; GetFeePayments is the service's record, which also names the payments of requests your node does not hold.
Method: GetLiquidityRequests — over JSON-RPC, liquidity_getLiquidityRequests.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | The network the requests were submitted on |
pagination | PaginationRequest | no | limit (clamped to 1..1000, default 100) + cursor. Omit cursor for the first page |
Response:
| Field | Type | Description |
|---|---|---|
requests | LiquidityRequest[] | Newest first by created_at |
pagination | PaginationResponse | next_cursor (absent/empty at the end) + has_more |
This call is paginated. Without a
paginationblock you get the newest 100 requests. Page by feedingnext_cursorback as the next request'spagination.cursoruntilhas_moreis false.
curl -s -X POST http://127.0.0.1:5003 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "liquidity_getLiquidityRequests",
"params": [{
"network": { "protocol": "PROTOCOL_BITCOIN", "id": "0a03cf40" },
"pagination": { "limit": 50 }
}]
}'
# → {"jsonrpc":"2.0","id":1,"result":{"requests":[{"paymentUuid":"5b0d3c1e-...","clientRequestId":"lease-btc-0001",...}],"pagination":{"nextCursor":"...","hasMore":true}}}
A simple swap's steps name the requests it made by client_request_id: see SimpleSwapStep.
Subscribe Liquidity Requests
(2026-10-14) The requests your node submits on a network. Server-streaming. The stream opens with every request still in progress — not final — as it stands now, then sends each request again whenever it changes, in the order the changes happened. Each item is the whole LiquidityRequest, not a delta.
Method: SubscribeLiquidityRequests — over JSON-RPC, the WebSocket subscription liquidity_subscribeLiquidityRequests (unsubscribe: liquidity_unsubscribeLiquidityRequests), whose items are LiquidityRequest.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | The network whose requests to follow |
Stream item: LiquidityRequest
Waiting for one request
The race-free way to wait for a request you submit:
- Open the subscription first, and wait until it is in place: the stream's response headers over gRPC, the subscription id over JSON-RPC.
- Submit the request.
- Wait on the stream for the submitted
payment_uuidto reach a final state. Keep the events that arrive before theSubmit*call answers: the request'sawaiting_feeandfee_settledusually do.
When the Submit* answer is already final — it answered an earlier submission under the same client_request_id — there is nothing to wait for.
Subscribed after submitting? Read the request once more. The opening snapshot holds only the requests still in progress, so a request that became final before your subscription was in place is not in it, and no later change brings it. Call
GetLiquidityRequestonce after the subscription is in place: that read and the stream together miss nothing. The same holds when the stream drops — reopen it, then read each request you are still waiting for once.
Example (helpers the Common Workflows use):
import {
LiquidityRequest,
SubscribeLiquidityRequestsRequest,
} from './proto/liquidity_pb'
/** completed, failed, unresolved and expired are final. */
function isFinal(r: LiquidityRequest): boolean {
return r.hasCompleted() || r.hasFailed() || r.hasUnresolved() || r.hasExpired()
}
/**
* Opens SubscribeLiquidityRequests and resolves once the node has it in place
* (the response headers). It keeps the latest state of every request it sees,
* so the events that arrive before a Submit call answers are not lost.
*/
async function openRequests(
client: LiquidityServiceClient,
network: { protocol: number; id: string },
) {
const subscribe = new SubscribeLiquidityRequestsRequest()
subscribe.setNetwork(network)
const stream = client.subscribeLiquidityRequests(subscribe, {})
const latest = new Map<string, LiquidityRequest>() // payment_uuid → latest state
let failure: unknown
let wake: () => void = () => {}
stream.on('data', (r: LiquidityRequest) => { latest.set(r.getPaymentUuid(), r); wake() })
stream.on('error', (e: unknown) => { failure = e; wake() })
stream.on('end', () => { if (!failure) failure = new Error('stream ended'); wake() })
await new Promise<void>(resolve => {
wake = () => resolve()
stream.on('metadata', () => resolve())
})
if (failure) throw failure
return {
/** Resolves with the submitted request once it is final. */
async waitFinal(submitted: LiquidityRequest): Promise<LiquidityRequest> {
if (isFinal(submitted)) return submitted // answered an earlier submission
for (;;) {
const r = latest.get(submitted.getPaymentUuid())
if (r && isFinal(r)) return r
if (failure) throw failure // reopen, then GetLiquidityRequest once
await new Promise<void>(resolve => { wake = () => resolve() })
}
},
close: () => stream.cancel(),
}
}
Keep one stream per network open for the life of your client rather than one per request, as with every other stream: the helpers above open one per call only to stay self-contained.
Request Channel Liquidity
(2026-10-14) Deprecated: use Submit Channel Liquidity Request. This RPC still works, unchanged: it submits the request and waits until the service has carried it out, which on the on-chain fee rail means waiting through the fee transfer's confirmations — minutes on Ethereum. That is why it is exempt from the 30 s request deadline, over gRPC and JSON-RPC alike. It refuses a request that carries a client_request_id (INVALID_ARGUMENT), so a call that is lost leaves nothing to look its request up by; the request is recorded all the same, and SubscribeLiquidityRequests shows it while it is in progress.
Ask the liquidity service to provision channel liquidity on the client's behalf. Hydra App completes fee settlement and the required local confirmations before returning.
Method: RequestChannelLiquidity
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | Channel network |
operation | ChannelLiquidityRequestOperation | YES | Provisioning action (open / deposit / deposit_any / open_or_deposit) |
lease_duration_seconds | uint64 | Conditional | Required when any requested asset has server_amount > 0; otherwise omit. Billed as asked: the lease runs this long from when the service funds it and ends on the next lease_slot_secs boundary, the time up to that boundary unbilled |
payment_network | Network | YES | Network used to pay the service fee |
payment_asset_id | string | YES | Asset used to pay the service fee |
fee_payment | one of OnchainFeePayment / OffchainFeePayment / DualFundFeePayment / SponsoredDepositFeePayment | YES | Exactly one |
quote_id | string | no | (2026-09-11) The quote an earlier estimate of this same request returned — see Quotes. Absent prices the request at execution |
Response:
| Field | Type | Description |
|---|---|---|
txid | string | Funding transaction ID |
channel_id | string | Channel ID of the (new or updated) channel |
fee | DecimalString | (2026-09-15) What the service billed, in whole units of payment_asset_id. Settled, not quoted |
fee is the figure to reconcile against. It is what the service took, not what an estimate predicted, so accounting needs no diff of channel balances before and after the request. On DualFundFeePayment and SponsoredDepositFeePayment it is carved out of the round and never leaves a wallet — the deposit that lands is smaller by exactly this much.
What this RPC cannot provision
Two rules, and together they close one case off entirely.
A round the client funds alone is served only by the rails the service broadcasts — DualFundFeePayment and SponsoredDepositFeePayment. On OnchainFeePayment and OffchainFeePayment the service funds its own side and broadcasts nothing of the client's, so a request whose every server_amount is zero is refused:
A round funded by the client alone is served by the DualFund and SponsoredDeposit rails only
The native asset cannot be deposited on the client's behalf at all. A native contribution can only ride the transaction's own value, and on both broadcasting rails that transaction is the service's — so a leg asking the client to fund native is refused there too:
the native asset … cannot be deposited on the client's behalf: a native deposit is
settled from the broadcaster's own transaction value, and the hub broadcasts a
sponsored round
A client-funded native deposit therefore has no rail here. Use NodeService.OpenChannel / DepositChannel / UpdateChannel instead: the client broadcasts its own funding transaction, so the value it attaches is its own deposit. That path needs the wallet to hold the network's native asset — which is exactly the constraint SponsoredDepositFeePayment exists to remove for tokens.
On DualFundFeePayment, a successful estimate does not prove the round is accepted.OnchainFeePayment and SponsoredDepositFeePayment refuse a client-funded native leg at
estimate time. DualFundFeePayment currently does not: EstimateRequestChannelLiquidityFee
returns a real quote, and the same request pinned to that quote is then refused later, when the
funding allowance is confirmed, with the message above.
Treat a quote as a price, never as an admission check. Neither call moves funds, so the failure costs only the round trip — but budget for it landing one call later than you would expect.
Example Request (open channel, offchain fee):
import { LiquidityServiceClient } from './proto/LiquidityServiceClientPb'
import {
RequestChannelLiquidityRequest,
ChannelLiquidityRequestOperation,
AssetLiquidity,
OffchainFeePayment
} from './proto/liquidity_pb'
const client = new LiquidityServiceClient('http://localhost:5003')
const request = new RequestChannelLiquidityRequest()
request.setNetwork({ protocol: 1, id: '0a03cf40' }) // Bitcoin Signet
// Open new channel with 0.1 BTC on the server side
const open = new ChannelLiquidityRequestOperation.Open()
const liq = new AssetLiquidity()
liq.setServerAmount({ value: '0.1' })
liq.setClientAmount({ value: '0' })
open.getAssetLiquidityMap().set('0x0000000000000000000000000000000000000000000000000000000000000000', liq)
const op = new ChannelLiquidityRequestOperation()
op.setOpen(open)
request.setOperation(op)
request.setLeaseDurationSeconds(2592000) // 30 days
request.setPaymentNetwork({ protocol: 1, id: '0a03cf40' })
request.setPaymentAssetId('0x0000000000000000000000000000000000000000000000000000000000000000')
request.setOffchainFeePayment(new OffchainFeePayment())
const response = await client.requestChannelLiquidity(request, {})
console.log('Channel:', response.getChannelId(), 'TX:', response.getTxid())
Example Response:
{
"txid": "abc123...",
"channel_id": "ch_def456"
}
Estimate Request Channel Liquidity Fee
Estimate the service fee for a channel liquidity request before executing it. Takes the same RequestChannelLiquidityRequest and returns just the fee.
Topping up a leased channel renews what is already in it. A lease covers the provider's whole side of an asset channel, so a deposit into a channel the provider already leases also leases the capital already there for the new window, for every hour past where its current lease ends. The fee includes that rent, which is why the same window can cost more on one channel than on another. Ask for an
opento lease only the new amount, in a channel of its own.
Method: EstimateRequestChannelLiquidityFee
Parameters: Same as Request Channel Liquidity.
Response:
| Field | Type | Description |
|---|---|---|
fee | DecimalString | Estimated service fee, denominated in the asset identified by payment_asset_id |
quote_id | string (optional) | (2026-09-11) Pass this back on the matching request to be billed at fee — see Quotes |
valid_until | Timestamp (optional) | (2026-10-14) When the quote stops being honoured |
valid_until_timestamp_seconds | uint64 (optional) | (2026-09-11) Deprecated (2026-10-14): read valid_until. The same instant, in Unix seconds |
lease_duration_seconds | uint64 (optional) | The lease window fee pays for, as billed. The lease runs that long from when the service funds it, to the slot boundary it lands in. Absent when the request carries no lease window |
Example Request:
// Build the same RequestChannelLiquidityRequest as you would for the actual call
const response = await client.estimateRequestChannelLiquidityFee(request, {})
console.log('Estimated fee:', response.getFee()?.getValue())
Example Response:
{
"fee": { "value": "0.0001" },
"quoteId": "q_8f3c1a...",
"validUntil": "2026-09-10T03:52:25+00:00"
}
Request Channel Release
(2026-10-14) Deprecated: use Submit Channel Release Request. This RPC still works, unchanged: it submits the request and waits until the service has carried it out — on the on-chain fee rail, through the fee transfer's confirmations. That is why it is exempt from the 30 s request deadline, over gRPC and JSON-RPC alike. It refuses a request that carries a client_request_id (INVALID_ARGUMENT).
Ask the liquidity service to withdraw assets from a channel or cooperatively close it. The service charges a fee and Hydra App settles it before observing the release update.
Method: RequestChannelRelease
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | Channel network |
operation | ChannelReleaseOperation | YES | withdraw or cooperative_close |
payment_network | Network | YES | Network used to pay the service fee |
payment_asset_id | string | YES | Asset used to pay the service fee |
fee_payment | one of OnchainFeePayment / OffchainFeePayment / SponsoredWithdrawalFeePayment | YES | Exactly one. SponsoredWithdrawalFeePayment is release-only — see above |
quote_id | string | no | (2026-09-11) The quote an earlier estimate of this same request returned — see Quotes |
Response:
| Field | Type | Description |
|---|---|---|
txid | string | Release transaction ID |
fee | DecimalString | (2026-09-15) What the service billed, in whole units of payment_asset_id. SponsoredWithdrawalFeePayment carves it out of what is released |
Example Request (cooperative close, offchain fee):
import {
RequestChannelReleaseRequest,
ChannelReleaseOperation,
OffchainFeePayment
} from './proto/liquidity_pb'
const request = new RequestChannelReleaseRequest()
request.setNetwork({ protocol: 1, id: '0a03cf40' })
const close = new ChannelReleaseOperation.CooperativeClose()
close.setChannelId('ch_def456')
const op = new ChannelReleaseOperation()
op.setCooperativeClose(close)
request.setOperation(op)
request.setPaymentNetwork({ protocol: 1, id: '0a03cf40' })
request.setPaymentAssetId('0x0000000000000000000000000000000000000000000000000000000000000000')
request.setOffchainFeePayment(new OffchainFeePayment())
const response = await client.requestChannelRelease(request, {})
console.log('Release TX:', response.getTxid())
Example Response:
{ "txid": "rel_abc789..." }
Estimate Request Channel Release Fee
Estimate the service fee for a channel release before executing it.
Method: EstimateRequestChannelReleaseFee
Parameters: Same as Request Channel Release.
Response:
| Field | Type | Description |
|---|---|---|
fee | DecimalString | Estimated service fee |
quote_id | string (optional) | (2026-09-11) Pass this back on the matching request to be billed at fee — see Quotes |
valid_until | Timestamp (optional) | (2026-10-14) When the quote stops being honoured |
valid_until_timestamp_seconds | uint64 (optional) | (2026-09-11) Deprecated (2026-10-14): read valid_until. The same instant, in Unix seconds |
Example:
const response = await client.estimateRequestChannelReleaseFee(request, {})
console.log('Estimated fee:', response.getFee()?.getValue())
Example Response:
{ "fee": "0.00005" }
Estimate Liquidity Batch Fee
(2026-10-29) Estimate a batch's fee, with the quote to submit it under. One estimate prices the whole batch: each operation, and the transactions the batch goes out in.
Method: EstimateLiquidityBatchFee
Parameters: network, batch and fee_payment, as Submit Liquidity Batch takes them.
Response: EstimateRequestFeeResponse — fee, quote_id, valid_until and the deprecated valid_until_timestamp_seconds, as Estimate Request Channel Release Fee answers. lease_duration_seconds and lease_extension are absent: a batch states each lease it buys in its operations.
The estimate is refused as Submit Liquidity Batch is, and nothing is billed. Pass quote_id back with the same batch and fee payment: a batch that differs from the one the quote priced is refused rather than re-priced.
Request Channel Lease Extension
(2026-10-14) Deprecated: use Submit Channel Lease Extension Request. This RPC still works, unchanged: it submits the request and waits until the service has carried it out — on the on-chain fee rail, through the fee transfer's confirmations. That is why it is exempt from the 30 s request deadline, over gRPC and JSON-RPC alike. It refuses a request that carries a client_request_id (INVALID_ARGUMENT).
Extend the duration of an existing lease on a specific channel asset — including one the hub opened on demand, whose lifetime is its lease. lease_extension_seconds is an extension delta, not a replacement absolute expiry. It is added to the expiry of the lease you paid for — AssetChannelLease.expiry — and sold in whole slots of the provider's lease clock (lease_slot_secs in Get Liquidity Service Info, one hour): extending by an hour moves lease_expiry by exactly an hour, and half an hour is sold, priced and delivered as a whole one. A lease that has already ended is extended from the next slot boundary. The estimate returns the rounded extension and the expiry it delivers.
Check both expiries before paying to extend. The lease's
expiryis the lease you paid for. Itsliquidity_expiryis until when the provider's liquidity actually stays in the channel: (2026-11-25) the later of that lease and until when your fee credit covers you. The fees your trading earns the provider pay, hour by hour, the rent of the room you use beyond your leases, and while they do your channels stay — see Get Leases. So while you trade,liquidity_expirykeeps running ahead of your leases; once your credit no longer covers you, the provider's liquidity stays only until the lease ends — then the provider takes its side back and may close the channel. Provider liquidity in a channel that carries no lease follows the same rule.GetLeaseExpiriesreturns both for all your channels at once, andSubscribeLeaseEventssays when they change. Extend whenliquidity_expiryis actually running down, or when you need the time guaranteed: only the lease is.
An extension rents exactly the time it adds. It counts from
lease_expiry, or from the next slot boundary once the lease has ended, and rents that time — the estimate'slease_extension.rented_seconds. Time your fee credit holds the liquidity in place past the lease is not paid time and is not counted: a lease paid to 15:00 on a channel whoseliquidity_expiryis 18:00 extends by one hour to 16:00, for one hour of rent, andliquidity_expirythen shows the later of 16:00 and until when your credit covers you.
Method: RequestChannelLeaseExtension
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | Channel network |
channel_id | string | YES | Channel whose lease to extend |
asset_id | string | YES | Specific asset whose lease is being extended |
lease_extension_seconds | uint64 | YES | Time to add to the lease's expiry (AssetChannelLease.expiry), rounded up to whole slots (lease_slot_secs) — see above |
payment_network | Network | YES | Network used to pay the service fee |
payment_asset_id | string | YES | Asset used to pay the service fee |
fee_payment | one of OnchainFeePayment / OffchainFeePayment | YES | Exactly one. The dual-fund and sponsored methods are not valid here |
quote_id | string | no | (2026-09-11) The quote an earlier estimate of this same request returned — see Quotes |
Response:
| Field | Type | Description |
|---|---|---|
channel_id | string | Channel that was extended |
asset_id | string | Asset whose lease was extended |
expiry_timestamp_seconds | int64 | The lease expiry after the extension (Unix seconds). With the estimate's quote_id, the expiry that estimate showed — reached for less rent when another paid operation carried the lease part of the way there meanwhile — later when the lease ended while the fee was being paid and so counted from a later slot boundary, earlier only when lease time the estimate counted from was taken back because its own fee was never collected |
fee | DecimalString | (2026-09-15) What the service billed, in whole units of payment_asset_id |
Example Request:
import {
RequestChannelLeaseExtensionRequest,
OffchainFeePayment
} from './proto/liquidity_pb'
const request = new RequestChannelLeaseExtensionRequest()
request.setNetwork({ protocol: 1, id: '0a03cf40' })
request.setChannelId('ch_def456')
request.setAssetId('0x0000000000000000000000000000000000000000000000000000000000000000')
request.setLeaseExtensionSeconds(2592000) // +30 days
request.setPaymentNetwork({ protocol: 1, id: '0a03cf40' })
request.setPaymentAssetId('0x0000000000000000000000000000000000000000000000000000000000000000')
request.setOffchainFeePayment(new OffchainFeePayment())
const response = await client.requestChannelLeaseExtension(request, {})
console.log('New expiry:', response.getExpiryTimestampSeconds())
Example Response:
{
"channelId": "ch_def456",
"assetId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"expiryTimestampSeconds": "1735689600"
}
Estimate Request Channel Lease Extension Fee
Estimate the service fee for a lease extension before executing it.
The fee is the whole fee the extension is billed: the setup fee, plus the rental of the capital the provider lent into the asset channel — never funds you put in yourself — for lease_extension.rented_seconds, the time the extension adds. Pass its quote_id back on the request and you are billed no more than that figure, even if the channel grows in between — less when another paid operation carries the lease part of the way meanwhile — and the lease runs to the expiry the estimate showed: later when the lease ends while the fee is being paid, since it then counts from a later slot boundary, earlier only when lease time the estimate counted from is taken back because its own fee was never collected. See Quotes.
The estimate refuses an extension the request would refuse: an asset channel that is closed, has an on-chain update in flight, holds no capacity, or holds none of the provider's funds.
Method: EstimateRequestChannelLeaseExtensionFee
Parameters: Same as Request Channel Lease Extension.
Response:
| Field | Type | Description |
|---|---|---|
fee | DecimalString | Estimated service fee |
quote_id | string (optional) | (2026-09-11) Pass this back on the matching request to be billed at fee — see Quotes |
valid_until | Timestamp (optional) | (2026-10-14) When the quote stops being honoured |
valid_until_timestamp_seconds | uint64 (optional) | (2026-09-11) Deprecated (2026-10-14): read valid_until. The same instant, in Unix seconds |
lease_extension | LeaseExtensionTerms (optional) | What the extension buys — below |
LeaseExtensionTerms — every instant is a slot boundary, and every duration a whole number of slots:
| Field | Type | Description |
|---|---|---|
extension_seconds | uint64 | The extension asked for, rounded up to whole slots |
starts_at | Timestamp | (2026-10-14) Where it counts from: the lease's expiry (AssetChannelLease.expiry), or the next slot boundary once it has passed |
expiry | Timestamp | (2026-10-14) The lease expiry after the extension: extension_seconds past starts_at |
rented_seconds | uint64 | The lease time fee pays rent for, from starts_at to expiry: extension_seconds |
from_timestamp_seconds | uint64 | Deprecated (2026-10-14): read starts_at. The same instant, in Unix seconds |
expiry_timestamp_seconds | uint64 | Deprecated (2026-10-14): read expiry. The same instant, in Unix seconds |
Example:
const response = await client.estimateRequestChannelLeaseExtensionFee(request, {})
console.log('Estimated fee:', response.getFee()?.getValue())
Example Response:
{
"fee": "0.00008",
"quoteId": "3f0f6f52-5a3b-4b1e-9b1f-6a0e2c1d9e44",
"validUntil": "2026-09-25T09:57:00+00:00",
"leaseExtension": {
"extensionSeconds": "3600",
"startsAt": "2026-09-25T18:00:00+00:00",
"expiry": "2026-09-25T19:00:00+00:00",
"rentedSeconds": "3600"
}
}
Get Liquidity Service Info
Server-wide bounds, durations, per-asset fee configuration, the assets a fee may be paid in with what each rail charges, and the provider's node public key on each network. Read-only, no side effects. (2026-10-14) Your node keeps the answer until the provider announces a change of its terms, and then reads it again: call it whenever you show fee options, rather than once at start.
Method: GetLiquidityServiceInfo — Parameters: None.
Response:
| Field | Type | Description |
|---|---|---|
min_duration_secs / max_duration_secs | uint64 | The lease-duration window the service accepts |
lease_slot_secs | uint64 | The unit of the lease clock: every lease ends on a slot boundary, which is when the service acts on the channel — a lease runs its window from when the service funds it to the next boundary, the time up to it unbilled — and an extension is rounded up to whole slots. One hour on this service; a provider that runs its clock to the second reports 1, and one that does not say reports 0 |
min_capacity_usd / max_capacity_usd | DecimalString | Capacity bounds, in USD |
asset_configs | LiquidityAssetConfig[] | Per-asset fee configuration — see below |
node_pubkeys | LiquidityNetworkNode[] | { network, node_pubkey } — the provider's node id per network |
quote_validity_secs | uint64 | How long every quote the service issues stays valid — see Quotes |
fee_payment_assets | LiquidityFeePaymentAsset[] | (2026-10-14) The assets a fee may be paid in, each with the rails the service accepts it on and what each of them charges — see below. A fee in an asset or on a rail missing here is refused with FAILED_PRECONDITION |
LiquidityAssetConfig:
| Field | Type | Description |
|---|---|---|
network | Network | (2026-10-14) The network the asset is leased on |
asset_id | string | The asset |
fee_ratio_per_hour | DecimalString | Hourly fee ratio — "0.001" is 0.1% per hour. (2026-10-29) The rate the provider's node lends the asset at, before scarcity |
pricing_ticker | string (optional) | External pricing ticker used for the USD conversion |
protocol | Protocol | Deprecated (2026-10-14): read network |
network_id | string | Deprecated (2026-10-14): read network |
node_pubkeysis where a bot gets the peer id to connect to before requesting liquidity — it is the same value the peer tables publish, read from the live service.
LiquidityFeePaymentAsset (2026-10-14):
| Field | Type | Description |
|---|---|---|
network | Network | The network the fee is paid on |
asset_id | string | The asset the fee is paid in, as the service spells it |
rails | LiquidityFeeRails | The rails a fee in it is accepted on |
LiquidityFeeRails — one field per fee_payment variant, each a LiquidityFeeRailTerms, absent when the service refuses that rail for the asset: onchain, offchain, dual_fund, sponsored_deposit, sponsored_withdrawal. Bitcoin carries only onchain and offchain, and a sponsored deposit is never offered in a network's native asset.
LiquidityFeeRailTerms — what a fee paid on that rail is made of, beyond the hourly rent of the leased assets (fee_ratio_per_hour above):
| Field | Type | Description |
|---|---|---|
on_chain_cost_multiple | DecimalString | Every on-chain cost the service pays to carry the request out — funding, permits, a withdrawal or a close — is billed at this multiple of its estimate. On a sponsored deposit, the largest multiple among the assets it pulls applies. (2026-10-29) The service's own work only — permits, the funding of an operation the provider lends nothing to, a withdrawal or a close: the liquidity the provider lends is billed at what its node charges for it |
force_close_cost_multiple | DecimalString | The force-close cost each funded channel is billed for, at this multiple of its estimate. (2026-10-29) Deprecated: always "0", the close of a channel the provider lends into being part of what its node charges for the liquidity, the first time it funds the channel. It leaves the API in a later release |
min_fee_usd | DecimalString | The least the setup fee of a request comes to, in USD |
The terms say how a fee is built, not what it comes to. Estimate the request (
Estimate*Fee) for the figure: on-chain costs move with the chain's fee rate, and the rent with the amount and duration.
Get Leaseable Asset Info
Liquidity bounds and fee ratio for one (network, asset) pair on the provider. This is the call that answers "can I lease this, and how much".
Method: GetLeaseableAssetInfo
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | Channel network |
asset_id | string | YES | Asset to lease |
Response: info (LeaseableAssetInfo):
| Field | Type | Description |
|---|---|---|
available_liquidity | DecimalString | What the provider can lease of this asset right now. (2026-10-29) What its node can lend: its usable on-chain balance less the fees of the on-chain steps it may be forced to take and its funding under way |
min_capacity / max_capacity | DecimalString | Per-lease size bounds, in the asset's own units |
min_duration_secs / max_duration_secs | uint64 | Duration bounds for this asset |
fee_ratio | DecimalString | The fee ratio applied to this asset. (2026-10-29) Its hourly rate where the provider's holding stands: the node's rate times the scarcity multiplier there. A lease is quoted the multiplier averaged over the use it moves through — see Get Lease Terms |
reserve_policy | ReservePolicy? | (2026-11-17) The provider's own reserve policy for the asset, as its node reports it (GetNodePolicy): what the provider requires of the wallet's side of a channel with it, the rule a channel the wallet opens to it starts with. Absent when the provider could not read it |
Sizing a lease against
available_liquidityis what avoids thelease_too_bigestimate variant — that variant reports the same three numbers after the fact.
Get Leases
The caller's leases on a network, one per asset channel it has with the provider: until when each lease is guaranteed and until when the provider's liquidity stays, (2026-11-25) what of the provider's side the lease covers, what is in use beyond it and what is idle, and your fee credit.
Method: GetLeases
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | Network to list leases for |
Response:
| Field | Type | Description |
|---|---|---|
leases | AssetChannelLease[] | One per asset channel you have with the provider — see below |
fee_credit | FeeCredit (optional) | (2026-11-25) Your fee credit, shared across your nodes and networks. Absent while the provider does not run fee credit, has not yet seen your node settle a swap on this network, or cannot read your credit |
AssetChannelLease
| Field | Type | Description |
|---|---|---|
network | Network | The network |
channel_id | string | The channel |
asset_id | string | The asset |
expiry | Timestamp (optional) | "Guaranteed until": when the lease you paid for ends, on a slot boundary. Absent when the asset channel carries no lease |
liquidity_expiry | Timestamp (optional) | "Stays until": until when the provider's liquidity stays in the asset channel, on a slot boundary. (2026-11-25) The later of the lease's end and until when your fee credit covers you, and never before the end of the lifetime the provider agreed when it opened the channel on demand. After it the provider takes its side back and may close the channel. Absent while the provider has no plan to take it back, not "never" |
leased_amount | DecimalString (optional) | (2026-11-25) What the running lease covers of the provider's side, until expiry, in the asset's own units. 0 when no lease runs |
kept_amount | DecimalString (optional) | (2026-11-25) What is in use beyond the lease: where the provider runs fee credit, your credit pays its rent. It stays until liquidity_expiry |
idle_amount | DecimalString (optional) | (2026-11-25) Neither leased nor in use: the provider may withdraw it whenever it needs it |
planned_reclaim | PlannedReclaim (optional) | (2026-11-25) What the provider has firmly planned to take back of this asset channel: a withdrawal or a close, how much and when. Absent while the provider has announced no plan |
Three things to understand
- A lease guarantees an amount until
expiry.- The fees your trading earns pay, hour by hour, the rent of the room you use beyond your leases. While they do, your channels stay.
liquidity_expirysays until when: the later of the lease's end and the moment your credit runs out. After it, the provider takes its side back and may close the channel.- Idle room — neither leased nor in use — may be withdrawn whenever the provider needs it.
| Show | Read |
|---|---|
| "Guaranteed until" | expiry |
| "Stays until" | liquidity_expiry |
| "The provider will withdraw X" / "The provider will close this channel", at T | planned_reclaim: kind, amount, at |
| Leased / in use / idle | leased_amount, kept_amount, idle_amount |
| "Your trading pays $X/h of rent; $Y left; covered until Z" | fee_credit: rent_usd_per_hour, balance_usd, covered_until |
The amounts are never guessed.
kept_amountandidle_amountneed what the venue holds of the asset channel for your orders and swaps, which the provider reads once per slot of its lease clock, at each boundary and when it starts. Until that read lands — after the provider restarts, for instance — both are absent. Any amount the provider could not read is absent, never zero.
FeeCredit
(2026-11-25) Your share of the fees your trading earns the provider is credited here, and the rent of your kept_amounts is drawn from it hour by hour. A lease payment credits nothing.
| Field | Type | Description |
|---|---|---|
state | FeeCreditState | FEE_CREDIT_STATE_COVERING (1): the credit pays the rent of the room you use, and your channels stay until covered_until. FEE_CREDIT_STATE_NOT_COVERING (2): its balance is spent, or no fee reached it for the longest lease the provider sells |
balance_usd | DecimalString | What is left, in USD, drawn to the moment of the response |
rent_usd_per_hour | DecimalString | What it pays an hour, in USD: the rent of your kept_amounts, summed, as of the provider's last billing |
covered_until | Timestamp (optional) | Until when it covers you: while the balance pays the rent, and at most the longest lease the provider sells (max_duration_secs in Get Liquidity Service Info) past your last fee. Absent unless FEE_CREDIT_STATE_COVERING |
PlannedReclaim
(2026-11-25) A withdrawal or close the provider has decided on for an asset channel. It shows here before the provider acts, and only once the plan is firm, so a plan you read is one the provider means to carry out. Show it to your users; show liquidity_expiry alone as information, not as a warning.
| Field | Type | Description |
|---|---|---|
kind | ReclaimKind | RECLAIM_KIND_WITHDRAW (1): the provider withdraws amount of its side, and the channel stays open. RECLAIM_KIND_CLOSE (2): the provider closes the channel cooperatively, and your side goes back to your wallet |
trigger | ReclaimTrigger | RECLAIM_TRIGGER_LAPSE (1): your lease is over and your fee credit no longer covers the room you keep. RECLAIM_TRIGGER_TRIM (2): the provider needs its idle room back |
amount | DecimalString | What the provider takes back, in the asset's own units. For a close, its whole side of the asset channel |
at | Timestamp | When the provider acts |
When a plan appears, and when it goes away
- Nothing is planned while you are covered. While a lease or your fee credit covers the asset channel, the provider plans no lapse. A trim takes idle room only, never room that is leased or in use.
- A plan is firm before it shows. It appears once the provider has reached the same plan (the same kind, and an amount within 10%) at two consecutive boundaries of its lease clock, or once it falls in the last period of that clock before
liquidity_expiry.- A plan stays until it is carried out or cancelled. It is cancelled only when your cover reaches at least two periods of the lease clock past
at, a lease covers the room, or the room comes into use. A cancelled plan appears again only once it is firm again.- A close takes the whole channel. Each asset channel of the channel carries the same plan, with the same
at.
Get Lease Expiries
Your node's copy of what the provider holds for each asset channel on a network, in one call, keyed by channel then asset: when the lease ends, until when the provider's liquidity stays, and what it has planned to take back.
Method: GetLeaseExpiries
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | Network to read expiries for |
Response:
| Field | Type | Description |
|---|---|---|
channels | map<string, ChannelAssetExpiries> | channel_id → { assets, liquidity_expiries, planned_reclaims }, each keyed by asset_id: when the lease you paid for ends (assets; an asset channel with no lease has no entry), until when the provider's liquidity stays (liquidity_expiries; no entry while the provider has no plan to take it back) and, (2026-11-25), each planned withdrawal or close (planned_reclaims; no entry while none is announced) |
This one reads the local cache — no round-trip to the providerThat makes it the right call for "which of my leases are running down".
GetLeasesasks the provider and is the authority when the two disagree. (2026-11-25) Read it again on each lease event rather than on a timer.The fees your trading earns keep the provider's liquidity in place past the lease on their own, so while you trade your liquidity expiries move forward without you paying anything. Watch them rather than counting down from the duration you bought.
Subscribe Lease Events
(2026-11-25) What changes in what the provider holds for your node on a network, as your node follows the provider: each change once, in the order your node learnt of it, from the subscription on. The events that name a channel say what changed; read GetLeaseExpiries or GetLeases for what the provider holds now. Refused on a network your node does not serve, and without a liquidity service. The stream ends once your node begins to stop.
Method: SubscribeLeaseEvents — over JSON-RPC, the WebSocket subscription liquidity_subscribeLeaseEvents (unsubscribe: liquidity_unsubscribeLeaseEvents), whose items are LeaseEvent.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | The network whose lease events to follow |
Stream: LeaseEvent, exactly one arm set:
| Arm | Payload | What changed |
|---|---|---|
syncing (1) | {} | Your node lost its stream from the provider and is connecting again: what it holds of the provider may be behind until synced |
synced (2) | {} | Your node read what the provider holds for it and follows its changes. Read again what you hold |
channel_lease_updated (3) | { channel_id } | The provider's record of an asset channel of the channel changed: when its lease ends, or until when the provider's liquidity stays in it |
channel_lease_expired (4) | { channel_id, asset_ids } | The leases of these asset channels of the channel ended |
payment_expired (5) | { payment_uuid } | A fee payment's deadline passed before the provider received the fee: its request expired, and nothing was billed. payment_uuid is the request's LiquidityRequest payment_uuid |
channel_lease_closed (6) | { channel_id } | The provider closed the channel cooperatively |
channel_lease_withdrawn (7) | { channel_id } | The provider withdrew from the channel; it stays open |
fee_refunded (8) | { payment_uuid, refund } | The provider gave back the fee of a payment, or part of it (refund, a LiquidityFeeRefund) |
reclaim_planned (9) | { channel_id, asset_id, plan } | The provider announced a plan to take back of an asset channel. A close is announced for each asset channel of the channel |
reclaim_cancelled (10) | { channel_id, asset_id } | The provider cancelled the plan it had announced for an asset channel |
Read what an event names, then show it. An event says what changed, not the whole record: on
channel_lease_updated,channel_lease_expired,reclaim_planned,reclaim_cancelledandsynced, readGetLeaseExpiries(orGetLeasesfor the amounts and your fee credit) again. Subscribe before the first read, so that no change falls between the two.
Get Fee Payments
(2026-09-15) What this node has been billed on a network, newest first — one record per payment the service committed to, whatever became of it.
Method: GetFeePayments
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
network | Network | YES | The network the payments were committed on — the channel network, not the one their fee was billed on |
statuses | repeated FeePaymentStatus | no | Restrict to these lifecycle states. Empty returns every state |
created_after | Timestamp | no | (2026-10-14) Only payments committed at or after this instant. Absent reaches back to the first payment |
created_after_timestamp_seconds | uint64 | no | Deprecated (2026-10-14): set created_after. The same bound, in Unix seconds. A request that sets both is refused with INVALID_ARGUMENT |
before | FeePaymentCursor | no | Return only payments strictly older than this cursor. Absent starts at the newest |
limit | uint32 | no | Page size, clamped to 200. 0 asks for the service's default (50) |
Response:
| Field | Type | Description |
|---|---|---|
payments | repeated FeePayment | Newest first |
next | FeePaymentCursor | Pass back as before for the next page. Absent when the history ends |
FeePaymentCursor
| Field | Type | Description |
|---|---|---|
created_at_timestamp_micros | int64 | The last returned payment's creation instant, in microseconds since the Unix epoch |
payment_uuid | string | The last returned payment's id |
Treat it as opaque — pass back the
nextyou were given, unchanged. The two fields are documented so you can persist and reconstruct one across a restart, not so you can synthesise a position.The instant is microseconds rather than seconds on purpose: payments committed inside the same second still have to page deterministically, and the id is the tie-breaker when even that collides.
FeePayment
| Field | Type | Description |
|---|---|---|
payment_uuid | string | Names this payment — the same id the service's updates carry |
network | Network | The network whose channels the operations touched |
operations | repeated FeePaymentOperation | What the payment covered — see below |
status | FeePaymentStatus | PENDING / PROCESSING / COMPLETED / EXPIRED / FAILED / REFUNDED |
rail | FeePaymentRail | ONCHAIN / OFFCHAIN / DUAL_FUND / SPONSORED_DEPOSIT / SPONSORED_WITHDRAWAL |
payment_network | Network | The network the fee was billed on — may differ from network |
payment_asset_id | string | The asset the fee was billed in |
fee | DecimalString | What was billed, in whole units of payment_asset_id |
refund | LiquidityFeeRefund | (2026-10-14) What the service gave back of the fee, and how it reached this wallet. Present only on a refunded payment |
created_at | Timestamp | (2026-10-14) When the service committed to this payment |
fee_deadline | Timestamp | (2026-10-14) Until when the service waited for this wallet's part of the fee |
outcome_unknown | bool | (2026-10-14) Whether the operations stopped at one whose outcome is unknown, which may have taken effect: it may still land, or landed after the round ended, as the channel then shows. Only a FAILED payment's can be — the payment of a request that reads unresolved. Cleared once the service sees the operation can no longer land |
results | repeated LiquidityOperationResult | (2026-10-14) What the operations the service carried out did, in the order it carried them out — one of channel_liquidity { channel_id, txid }, channel_release { channel_id, txid }, channel_lease_extension { channel_id, asset_id, lease_expiry } each, the shapes completed.result takes. An operation that did not take effect has none; one whose outcome was unknown and that landed later has its own |
refund_amount | DecimalString | Deprecated (2026-10-14): read refund. What was given back |
refund_tx_hash | string | Deprecated (2026-10-14): read refund. The refund's transaction or off-chain payment, without saying which |
created_at_timestamp_seconds | uint64 | Deprecated (2026-10-14): read created_at. The same instant, in Unix seconds |
expires_at_timestamp_seconds | uint64 | Deprecated (2026-10-14): read fee_deadline. The same instant, in Unix seconds |
FeePaymentOperation
The same operation shapes a request carries, read back. Exactly one variant is set:
| Variant | Type | Description |
|---|---|---|
provision | { operation: ChannelLiquidityRequestOperation, lease_duration_seconds } | An open, deposit, deposit_any or open_or_deposit, with the lease window it bought |
release | ChannelReleaseOperation | A withdraw or a cooperative_close. Buys no lease time |
lease_extension | ChannelLeaseExtensionOperation | { channel_id, asset_id, lease_extension_seconds } — an extension delta, not a replacement expiry |
The duration sits inside provision rather than beside the variants because only a provisioning operation has one: a release buys no lease time, and an extension states its own delta.
A record states the amounts it was priced on. The operation comes back in the vocabulary it was requested in — the same AssetLiquidity and AssetWithdrawAmounts the request carried — so a fee can be reconciled against what it bought, not merely against which assets it touched.
Only COMPLETED means you got what you paid for. EXPIRED billed nothing — the deadline elapsed before this wallet completed its half. REFUNDED billed and gave it back; refund says how much, and how it reached this wallet. FAILED is the one to reconcile by hand: the operations did not complete and no refund was made — unless outcome_unknown is set, when one of them may have taken effect: read the channel, and results, which holds it once the service has seen it land. (2026-10-29) A fee paid on chain reads FAILED until the transaction that paid it is final, and REFUNDED once it is refunded.
Page by cursor, never by offsetPass the response's
nextback asbefore, and stop when it comes back absent. New payments arrive at the newest end of this ordering, which is exactly where an offset would shift a page under you — the same row returned twice, or skipped.The cursor is a position, not an index: a creation instant in microseconds plus the payment id that breaks ties with anything committed in the same instant. Treat it as opaque and hand it back unchanged.
Duration Reference
lease_duration_seconds and lease_extension_seconds are expressed in seconds. Every lease ends on a boundary of the service's lease clock (lease_slot_secs): a lease window runs from when the service funds it to the next boundary, and an extension is rounded up to whole slots — its estimate says what it became.
| Duration | Seconds | Calculation |
|---|---|---|
| 1 hour | 3,600 | 60 × 60 |
| 1 day | 86,400 | 24 × 60 × 60 |
| 1 week | 604,800 | 7 × 24 × 60 × 60 |
| 30 days | 2,592,000 | 30 × 24 × 60 × 60 |
| 90 days | 7,776,000 | 90 × 24 × 60 × 60 |
const days = 30
const leaseSeconds = days * 24 * 60 * 60 // 2,592,000
Choosing a fee payment method
| Variant | Available on | When to use |
|---|---|---|
offchain_fee_payment | Liquidity / Release / Lease Extension | You have offchain (channel) balance to pay the fee — fastest, lowest overhead. The estimate and the request both refuse a fee above what the node can send off-chain on the payment network (max_sendable of the payment asset), before anything is committed: pay it on-chain instead |
onchain_fee_payment (UTXO) | Liquidity / Release / Lease Extension on Bitcoin-style protocols | You're paying the fee from on-chain funds and need a refund address for change |
onchain_fee_payment (Account) | Liquidity / Release / Lease Extension on EVM-style protocols | You're paying the fee from an EVM account; refund_address is optional |
dual_fund_fee_payment | Liquidity only | You're contributing client-side funds (client_amount > 0) and want the fee settled inside the dual-fund flow |
sponsored_deposit_fee_payment | Liquidity only | (2026-09-11) The wallet holds the token but no native asset — the service broadcasts the funding and takes its fee out of the deposit. See SponsoredDepositFeePayment |
sponsored_withdrawal_fee_payment | Release only | (2026-09-11) The wallet holds a channel balance but no native asset — the only method that can exit that channel at all. See SponsoredWithdrawalFeePayment |
Common Workflows
(2026-10-14) Both workflows submit under a client_request_id and follow the request to its end with the helpers from Subscribe Liquidity Requests: the stream is open before the request is submitted, so no change of it is missed.
Open a channel with server-provided liquidity (offchain fee)
async function openChannelWithLiquidity(
client: LiquidityServiceClient,
network: { protocol: number; id: string },
assetId: string,
serverAmount: string,
leaseDays: number,
clientRequestId: string // your name for this request: persist it, and reuse it on a retry
) {
const request = new RequestChannelLiquidityRequest()
request.setNetwork(network)
const open = new ChannelLiquidityRequestOperation.Open()
const liq = new AssetLiquidity()
liq.setServerAmount({ value: serverAmount })
liq.setClientAmount({ value: '0' })
open.getAssetLiquidityMap().set(assetId, liq)
const op = new ChannelLiquidityRequestOperation()
op.setOpen(open)
request.setOperation(op)
request.setLeaseDurationSeconds(leaseDays * 24 * 60 * 60)
request.setPaymentNetwork(network)
request.setPaymentAssetId(assetId)
request.setOffchainFeePayment(new OffchainFeePayment())
request.setClientRequestId(clientRequestId)
// 1. Estimate first
const estimate = await client.estimateRequestChannelLiquidityFee(request, {})
console.log('Estimated fee:', estimate.getFee()?.getValue())
// 2. Subscribe, then submit, then follow the request until it is final
const requests = await openRequests(client, network)
try {
const submitted = (await client.submitChannelLiquidityRequest(request, {})).getRequest()!
const final = await requests.waitFinal(submitted)
if (!final.hasCompleted()) {
throw new Error(`request ${final.getPaymentUuid()} ended without completing`)
}
// Absent when the node missed the service's report: read the channel then.
const result = final.getCompleted()!.getChannelLiquidity()
return {
channelId: result?.getChannelId(),
txid: result?.getTxid()
}
} finally {
requests.close()
}
}
Cooperatively close a channel through the service
async function cooperativeClose(
client: LiquidityServiceClient,
network: { protocol: number; id: string },
channelId: string,
paymentAssetId: string,
clientRequestId: string // your name for this request: persist it, and reuse it on a retry
) {
const request = new RequestChannelReleaseRequest()
request.setNetwork(network)
const close = new ChannelReleaseOperation.CooperativeClose()
close.setChannelId(channelId)
const op = new ChannelReleaseOperation()
op.setCooperativeClose(close)
request.setOperation(op)
request.setPaymentNetwork(network)
request.setPaymentAssetId(paymentAssetId)
request.setOffchainFeePayment(new OffchainFeePayment())
request.setClientRequestId(clientRequestId)
// Subscribe, then submit, then follow the request until it is final
const requests = await openRequests(client, network)
try {
const submitted = (await client.submitChannelReleaseRequest(request, {})).getRequest()!
const final = await requests.waitFinal(submitted)
if (!final.hasCompleted()) {
throw new Error(`release ${final.getPaymentUuid()} ended without completing`)
}
// Absent when the node missed the service's report: read the channel then.
return final.getCompleted()!.getChannelRelease()?.getTxid()
} finally {
requests.close()
}
}
Error Handling
| Error Code | Description | Solution |
|---|---|---|
INVALID_ARGUMENT | Missing lease_duration_seconds while server_amount > 0, or no fee_payment variant set | Provide a duration when leasing; pick exactly one fee payment variant |
INVALID_ARGUMENT | dual_fund_fee_payment or sponsored_deposit_fee_payment used outside of a channel liquidity request (SubmitChannelLiquidityRequest, the deprecated RequestChannelLiquidity) | Switch to onchain_fee_payment or offchain_fee_payment |
INVALID_ARGUMENT | (2026-10-14) client_request_id must be 1 to 64 characters, got N | Send an id of 1 to 64 characters, or none |
INVALID_ARGUMENT | (2026-10-14) client_request_id is answered by SubmitChannelLiquidityRequest, not by this deprecated RPC — a deprecated Request* RPC was sent a client_request_id; the message names the matching Submit* RPC | Call the Submit* RPC it names |
ALREADY_EXISTS | (2026-10-14) client_request_id_taken: payment_uuid=… — the id already names a different request, the one payment_uuid names | On a retry, resend the first request exactly, quote_id included; otherwise submit this one under a new id. See client_request_id |
NOT_FOUND | (2026-10-14) no such liquidity request — GetLiquidityRequest for a request your node does not hold on that network | Check the network and the id. Right after a Submit* call was cut off, submit again under the same id rather than read |
DEADLINE_EXCEEDED | (2026-10-14) A Submit* call outlived the 30 s request deadline. The request may already have been made | Submit again under the same client_request_id, or read it back with GetLiquidityRequest — see Deadline |
FAILED_PRECONDITION | The quote_id has expired, or no longer fits the request | Re-run the matching Estimate*Fee, show the user the new figure, and send the fresh quote_id — see Quotes |
RESOURCE_EXHAUSTED | The request would take this client's leased capital past the per-client limit (Hub capital committed to this client would exceed the per-client limit…), or a sponsored rail has reached its budget for now | Lease less, or let a lease lapse first; for a sponsored rail, try again later or pay the fee another way |
FAILED_PRECONDITION | Channel does not exist, asset not present in channel, or release/extension not permitted | Verify channel_id and asset_id against watchOnlyNode.GetChannel |
FAILED_PRECONDITION | (2026-10-14) A fee is not accepted in … on network … on the … rail — the asset or the rail is not among those the service accepts | Pay in an asset, and on a rail, listed in GetLiquidityServiceInfo's fee_payment_assets |
FAILED_PRECONDITION | (2026-10-14) Operation #N: asset … of channel … has an on-chain operation awaiting confirmation — a deposit, withdrawal or close of an asset channel whose last on-chain operation has not confirmed | Wait until your node shows the asset channel is_updatable again — it does once the operation has confirmed — then ask again. Do not retry on a timer |
FAILED_PRECONDITION | (2026-10-14) Operation #N: asset … of channel … is not updatable: … — a deposit, withdrawal or close of an asset channel the hub's node cannot update now: an update of it is under way, or your node is not connected to the hub | Wait until your node shows the asset channel is_updatable again — reconnect to the hub if your node is not connected — then ask again. Do not retry on a timer |
UNAVAILABLE | Liquidity service temporarily unavailable | Retry with exponential backoff |
Best Practices
- Submit with a
client_request_id, and follow the request. (2026-10-14) Use theSubmit*RPCs, not the deprecatedRequest*ones. Name every request, openSubscribeLiquidityRequestsbefore you submit, and act on the request's final state — not on theSubmit*answer, which on the on-chain rail comes before the fee transfer has confirmed. After a call that was cut off, submit again under the same id. - Always estimate first. Call the matching
Estimate*RPC before the operation. - Provide
lease_duration_secondsonly when needed. Required if any asset hasserver_amount > 0; otherwise omit. - Pick the right fee payment. Offchain is cheapest; dual-fund and sponsored-deposit are only valid on a channel liquidity request.
- Pass the
quote_idfrom your estimate. Without it the service prices the request at execution, and the user is billed a figure they never saw.
- Pass the
- Reuse channels when possible.
deposit/deposit_any/open_or_depositavoid the cost of opening a new channel. - Treat
lease_extension_secondsas a delta, not a target expiry. It counts fromlease_expiryand is sold in whole slots; offer durations in multiples oflease_slot_secs. - Watch the liquidity expiry to know when the provider takes its liquidity back. The lease's
expiryis the lease you paid for and moves only when a lease is paid for; your fee credit keeps the liquidity in place past it for as long as it covers you, andliquidity_expiryshows until when (Get Leases shows the credit). Read both withGetLeaseExpiriesorGetLeases, followSubscribeLeaseEvents, and extend only whenliquidity_expiryis genuinely running down. Once it has passed, the provider takes its liquidity back as soon as your node is online — it does not wait for you to be online at a particular time. - On
withdraw, name the side.asset_amountsneedsserver_amountand/orclient_amountper asset — at least one — since 2026-07-23.