2024-03-14 00:43:49 -07:00
|
|
|
### Set environment variables
|
|
|
|
|
|
|
|
```
|
|
|
|
CLUSTER=devnet
|
|
|
|
CLUSTER_URL=https://mango.devnet.rpcpool.com/<token>
|
|
|
|
PAYER_KEYPAIR=~/.config/solana/mb-liqtest.json
|
|
|
|
# Adjust this to a free group
|
|
|
|
GROUP_NUM=200
|
|
|
|
```
|
|
|
|
|
2024-03-14 01:53:43 -07:00
|
|
|
### Get devnet SOL
|
|
|
|
|
|
|
|
The scripts need a lot of SOL for mint, market, group and account creation.
|
|
|
|
There's ample available, best to ask around.
|
|
|
|
|
2024-03-14 00:43:49 -07:00
|
|
|
### Create tokens and markets
|
|
|
|
|
|
|
|
This is one-time setup:
|
2024-03-14 00:58:04 -07:00
|
|
|
|
2024-03-14 00:43:49 -07:00
|
|
|
```
|
|
|
|
yarn ts-node ts/client/scripts/liqtest/liqtest-create-tokens-and-markets.ts
|
|
|
|
```
|
2024-03-14 00:58:04 -07:00
|
|
|
|
2024-03-14 00:43:49 -07:00
|
|
|
It'll emit some MINTS=... and SERUM_MARKETS=.. env vars, set those, all further
|
|
|
|
commands will use them.
|
|
|
|
|
|
|
|
### Make a group
|
|
|
|
|
|
|
|
```
|
|
|
|
yarn ts-node ts/client/scripts/liqtest/liqtest-create-group.ts
|
|
|
|
```
|
|
|
|
|
|
|
|
Groups can be reused a lot, but sometimes closing them may be necessary
|
2024-03-14 00:58:04 -07:00
|
|
|
|
2024-03-14 00:43:49 -07:00
|
|
|
```
|
|
|
|
yarn ts-node ts/client/scripts/liqtest/liqtest-close-group.ts
|
|
|
|
```
|
|
|
|
|
|
|
|
Preferably close all mango accounts first.
|
|
|
|
|
|
|
|
### Create candidate mango accounts
|
|
|
|
|
|
|
|
```
|
|
|
|
yarn ts-node ts/client/scripts/liqtest/liqtest-make-candidates.ts
|
|
|
|
```
|
|
|
|
|
|
|
|
This creates a bunch of to-be-liquidated accounts as well as a LIQOR account.
|
|
|
|
|
|
|
|
### Liquidate
|
|
|
|
|
|
|
|
Run the liquidator on the group with the liqor account.
|
|
|
|
|
2024-03-14 01:53:43 -07:00
|
|
|
Since devnet doesn't have any jupiter, run with
|
2024-04-15 00:29:53 -07:00
|
|
|
|
2024-03-14 01:53:43 -07:00
|
|
|
```
|
|
|
|
JUPITER_VERSION=mock
|
|
|
|
TCS_MODE=borrow-buy
|
|
|
|
REBALANCE=false
|
|
|
|
```
|
|
|
|
|
2024-03-14 00:43:49 -07:00
|
|
|
### Settle and close all open mango accounts
|
|
|
|
|
|
|
|
At any point, to reset by closing all accounts:
|
2024-03-14 00:58:04 -07:00
|
|
|
|
2024-03-14 00:43:49 -07:00
|
|
|
```
|
|
|
|
yarn ts-node ts/client/scripts/liqtest/liqtest-settle-and-close-all.ts
|
|
|
|
```
|