Skip to main content

GetLiquidityParams

GetLiquidityParams gets the parameters that the daemon's liquidity manager is currently configured with. This may be nil if nothing is configured. [EXPERIMENTAL]: endpoint is subject to change.

Source: looprpc/client.proto

gRPC

rpc GetLiquidityParams (GetLiquidityParamsRequest) returns (LiquidityParameters);

REST

HTTP MethodPath
GET /v1/liquidity/params

Code Samples

const fs = require('fs');
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');

const GRPC_HOST = 'localhost:11010'
const MACAROON_PATH = 'LOOP_DIR/regtest/loop.macaroon'
const TLS_PATH = 'LOOP_DIR/tls.cert'

const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
};
const packageDefinition = protoLoader.loadSync('looprpc/client.proto', loaderOptions);
const looprpc = grpc.loadPackageDefinition(packageDefinition).looprpc;
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA';
const tlsCert = fs.readFileSync(TLS_PATH);
const sslCreds = grpc.credentials.createSsl(tlsCert);
const macaroon = fs.readFileSync(MACAROON_PATH).toString('hex');
const macaroonCreds = grpc.credentials.createFromMetadataGenerator(function(args, callback) {
let metadata = new grpc.Metadata();
metadata.add('macaroon', macaroon);
callback(null, metadata);
});
let creds = grpc.credentials.combineChannelCredentials(sslCreds, macaroonCreds);
let client = new looprpc.SwapClient(GRPC_HOST, creds);
let request = {};
client.getLiquidityParams(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// "rules": <LiquidityRule>,
// "fee_ppm": <uint64>,
// "sweep_fee_rate_sat_per_vbyte": <uint64>,
// "max_swap_fee_ppm": <uint64>,
// "max_routing_fee_ppm": <uint64>,
// "max_prepay_routing_fee_ppm": <uint64>,
// "max_prepay_sat": <uint64>,
// "max_miner_fee_sat": <uint64>,
// "sweep_conf_target": <int32>,
// "failure_backoff_sec": <uint64>,
// "autoloop": <bool>,
// "autoloop_budget_sat": <uint64>,
// "autoloop_budget_start_sec": <uint64>,
// "auto_max_in_flight": <uint64>,
// "min_swap_amount": <uint64>,
// "max_swap_amount": <uint64>,
// "htlc_conf_target": <int32>,
// "autoloop_dest_address": <string>,
// "autoloop_budget_refresh_period_sec": <uint64>,
// "autoloop_budget_last_refresh": <uint64>,
// "easy_autoloop": <bool>,
// "easy_autoloop_local_target_sat": <uint64>,
// "account": <string>,
// "account_addr_type": <AddressType>,
// }

Messages

looprpc.GetLiquidityParamsRequest

Source: looprpc/client.proto

note

This request has no parameters.

looprpc.LiquidityParameters

Source: looprpc/client.proto

FieldgRPC TypeREST Type
rules
LiquidityRule[]array
fee_ppm
uint64string
sweep_fee_rate_sat_per_vbyte
uint64string
max_swap_fee_ppm
uint64string
max_routing_fee_ppm
uint64string
max_prepay_routing_fee_ppm
uint64string
max_prepay_sat
uint64string
max_miner_fee_sat
uint64string
sweep_conf_target
int32integer
failure_backoff_sec
uint64string
autoloop
boolboolean
autoloop_budget_sat
uint64string
autoloop_budget_start_secdeprecated
uint64string
auto_max_in_flight
uint64string
min_swap_amount
uint64string
max_swap_amount
uint64string
htlc_conf_target
int32integer
autoloop_dest_address
stringstring
autoloop_budget_refresh_period_sec
uint64string
autoloop_budget_last_refresh
uint64string
easy_autoloop
boolboolean
easy_autoloop_local_target_sat
uint64string
account
stringstring
account_addr_type
AddressTypestring

Nested Messages

looprpc.LiquidityRule

FieldgRPC TypeREST Type
channel_id
uint64string
swap_type
SwapTypestring
pubkey
bytesstring
type
LiquidityRuleTypestring
incoming_threshold
uint32integer
outgoing_threshold
uint32integer

Enums

looprpc.AddressType

NameNumber
ADDRESS_TYPE_UNKNOWN
0
TAPROOT_PUBKEY
1

looprpc.LiquidityRuleType

NameNumber
UNKNOWN
0
THRESHOLD
1

looprpc.SwapType

NameNumber
LOOP_OUT
0
LOOP_IN
1