Skip to main content

SetLiquidityParams

SetLiquidityParams sets a new set of parameters for the daemon's liquidity manager. Note that the full set of parameters must be provided, because this call fully overwrites our existing parameters. [EXPERIMENTAL]: endpoint is subject to change.

Source: looprpc/client.proto

gRPC

rpc SetLiquidityParams (SetLiquidityParamsRequest) returns (SetLiquidityParamsResponse);

REST

HTTP MethodPath
POST /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 = {
parameters: <LiquidityParameters>,
};
client.setLiquidityParams(request, function(err, response) {
console.log(response);
});
// Console output:
// {
// }

Messages

looprpc.SetLiquidityParamsRequest

Source: looprpc/client.proto

FieldgRPC TypeREST TypeREST Placement
parameters
LiquidityParametersobjectbody

looprpc.SetLiquidityParamsResponse

Source: looprpc/client.proto

note

This response has no parameters.

Nested Messages

looprpc.LiquidityParameters

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

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