Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed May 17, 2024
1 parent 8e311d5 commit eca14f9
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions src/bin/sys-lend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,47 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.help("Token to withdraw"),
),
)
.subcommand(
SubCommand::with_name("rebalance")
.about("Rebalance tokens between lending pools")
.arg(
Arg::with_name("pool")
.long("with")
.value_name("POOLS")
.takes_value(true)
.multiple(true)
.possible_values(&pools)
.help("Lending pool to rebalance with. \
Tokens from the pool with the lowest APY will be moved \
to the pool with the highest APY \
[default: all supported pools for the specified token]")
)
.arg(
Arg::with_name("signer")
.value_name("KEYPAIR")
.takes_value(true)
.required(true)
.validator(is_valid_signer)
.help("Wallet"),
)
.arg(
Arg::with_name("amount")
.value_name("AMOUNT")
.takes_value(true)
.validator(is_amount_or_all)
.required(true)
.help("The amount to rebalance; accepts keyword ALL"),
)
.arg(
Arg::with_name("token")
.value_name("TOKEN")
.takes_value(true)
.required(true)
.validator(is_valid_token)
.default_value("USDC")
.help("Token to rebalance"),
),
)
.subcommand(
SubCommand::with_name("supply-balance")
.about("Display the current supplied balance for one or more lending pools")
Expand All @@ -252,7 +293,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.takes_value(true)
.multiple(true)
.possible_values(&pools)
.help("Lending pool [default: all support pools for the specified token]"),
.help("Lending pool [default: all supported pools for the specified token]"),
)
.arg(
Arg::with_name("address")
Expand Down Expand Up @@ -282,7 +323,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.takes_value(true)
.multiple(true)
.possible_values(&pools)
.help("Lending pool [default: all support pools for the specified token]"),
.help("Lending pool [default: all supported pools for the specified token]"),
)
.arg(
Arg::with_name("token")
Expand Down

0 comments on commit eca14f9

Please sign in to comment.