limo-cli
v0.1.0
Published
## CLI localnet workdlow
Downloads
4
Readme
Kamino Liquidity Integration & Matching Orders (LIMO)
CLI localnet workdlow
$ make build CLUSTER=localnet
$ yarn anchor-client-gen:clean
$ yarn anchor-client-gen
$ yarn
$ cd limo-sdk && yarn && cd ..
$ yarn start-validator
- Setup
.env.localnet
, or copy from.env.example
RPC_ENV=localnet
ADMIN=./keys/localnet/owner.json
LIMO_GLOBAL_CONFIG=
BASE_TOKEN=
QUOTE_TOKEN=
Running on localnet
- use
ENV=localnet
before any commandENV=localnet yarn cli create-mint --mint-keypair ./usdcSRyi5wF3AsUx4PjAduxLwbZcGujwfw2yEVDRNyj.json
- make sure to keep .env.localnet populated
Running on mainnet
using the .env.example
, create a .env
file. Here add a mainnet rpc url, and admin, and either use the global config from the example or create a new one
cp .env.example .env
Create mints and mint to owner
solana-keygen grind --starts-with so1:1
solana-keygen grind --starts-with usdc:1
yarn cli create-mint --mint-keypair ./usdcSRyi5wF3AsUx4PjAduxLwbZcGujwfw2yEVDRNyj.json
yarn cli create-mint --mint-keypair ./so1LJhiEeketqSBGK43hyfHSon53SAWe1VEMq3Jtxsw.json
yarn cli mint-token --mint usdcSRyi5wF3AsUx4PjAduxLwbZcGujwfw2yEVDRNyj --amount 1000000
yarn cli mint-token --mint so1LJhiEeketqSBGK43hyfHSon53SAWe1VEMq3Jtxsw --amount 1000000
Init global config and vaults
yarn cli init-global-config --tip-mint So11111111111111111111111111111111111111112
yarn cli init-vault --mint So11111111111111111111111111111111111111112 --mode execute
yarn cli init-vault --mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --mode execute
yarn cli init-tip-vault --mint So11111111111111111111111111111111111111112 --mode execute
Update global config
The different update modes can be found in UpdateGlobalConfigMode
enum at programs/limo/src/state.rs
or in the sdk at rpc_client/types/UpdateGlobalConfigMode.ts
yarn cli update-global-config --update-mode UpdateTakerAuthority --value 5zY3XWg7hX5tSwGq1az5CVGRDfvHRK66xoZ6vvMrJ2y8 --mode execute
Place orders
yarn cli place-bid --quote so1LJhiEeketqSBGK43hyfHSon53SAWe1VEMq3Jtxsw --base usdcSRyi5wF3AsUx4PjAduxLwbZcGujwfw2yEVDRNyj --price 200.0 --size 2000
yarn cli place-bid --quote so1LJhiEeketqSBGK43hyfHSon53SAWe1VEMq3Jtxsw --base usdcSRyi5wF3AsUx4PjAduxLwbZcGujwfw2yEVDRNyj --price 200.0 --base-amount 2000
yarn cli place-bid --price 200.0 --base-amount 10
yarn cli place-ask --price 210.0 --quote-amount 2
List
yarn cli list-orders
ASK Price 210.00000 | Sell 10.00000 so1L | For 2100.00000 usdc | OrderId 2RuoYKdskt
ASK Price 210.00000 | Sell 2.00000 so1L | For 420.00000 usdc | OrderId Gp154YHdCm
ASK Price 203.00000 | Sell 3.00000 so1L | For 609.00000 usdc | OrderId BjKLgjJ5hB
ASK Price 202.00000 | Sell 2.00000 so1L | For 404.00000 usdc | OrderId 5RTDLAuQKd
BID Price 201.00002 | Buy 2.48756 so1L | For 500.00000 usdc | OrderId EfCKZjAKsM
BID Price 200.00000 | Buy 10.00000 so1L | For 2000.00000 usdc | OrderId 2SpkXKDMfV
BID Price 200.00000 | Buy 0.05000 so1L | For 10.00000 usdc | OrderId BgG7dxUeb5
BID Price 200.00000 | Buy 2.50000 so1L | For 500.00000 usdc | OrderId HoENg1r7um
BID Price 199.00001 | Buy 10.05025 so1L | For 2000.00000 usdc | OrderId 6xWxkLaf86
BID Price 198.00000 | Buy 5.05051 so1L | For 1000.00000 usdc | OrderId 6YUTZ9gbqm