Crates.io | tensor-eigen |
lib.rs | tensor-eigen |
version | |
source | src |
created_at | 2024-10-19 00:55:11.830209 |
updated_at | 2024-12-03 20:44:39.543861 |
description | Utility CLI for the Tensor Foundation Solana programs. |
homepage | |
repository | https://github.com/tensor-foundation/eigen |
max_upload_size | |
id | 1415002 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A CLI for interacting with Tensor Foundation Solana programs.
One-liner script to download the binary:
bash <(curl -sSf https://raw.githubusercontent.com/tensor-foundation/eigen/main/scripts/install.sh)
From crates.io:
cargo install tensor-eigen
From source:
git clone https://github.com/tensor-foundation/eigen
cd eigen
cargo install --path .
Self update (versions >= 0.0.13):
eigen self update
See available commands with:
eigen -h
Eigen picks up RPC url and keypair from the Solana config file (~/.config/solana/cli/config.yml
) by default.
These values can be overridden with the --rpc-url
and --keypair-path
flags, where the former is the url string and the latter is the path to the keypair file.
Eigen supports decoding most types of Tensor Foundation accounts and automatically determines the type of account based on the data.
eigen decode <address>
Example, decoding an AMM Pool account:
% eigen decode C9TAnmPKKjskgrYep4obJYYyiytMFmW5bRgNuEYB5w3U
Pool---------------------
discriminator : f19a6d0411b16dbc
version : 1
bump : 255
pool_id : �J�L�W�e\���F
~g��y��0[�
�:u
created_at : 2024-11-22T11:17:26+00:00
updated_at : 2024-11-22T11:17:26+00:00
expiry : 2025-11-22T11:17:26+00:00
owner : 9LgJfhhBgATPQEDDQLeZCXNvooXK5jHmD8pbJssTykL7
whitelist : 9nzCneMrkJ91FM8b5y3j93dw5WQVvqwUAMXaLGfCDfLE
rent_payer : 5EDuQNiCKKQX2miovFD8KZsH83qaiLgoy4wBLzX8Bsah
currency : SOL
amount : 0
price_offset : 0
nfts_held : 0
--PoolStats-------------
taker_sell_count : 0
taker_buy_count : 0
accumulated_mm_profit : 0
-------------------------
shared_escrow : None
cosigner : None
maker_broker : None
max_taker_sell_count : 0
--PoolConfig--------------
pool_type : Trade
curve_type : Exponential
starting_price : 10000000
delta : 500
mm_compound_fees : false
mm_fee_bps : None
-------------------------
reserved : [all zeros]
This account turns out to be a wallet:
% eigen decode 5EDuQNiCKKQX2miovFD8KZsH83qaiLgoy4wBLzX8Bsah
Wallet---------
lamports : 268646234563
SOL : 268.646234563
pda : false
Same as decode but saves them to JSON files:
Usage: eigen download [OPTIONS] <ADDRESS> [OUTPUT_DIR]
Arguments:
<ADDRESS> Address to download
[OUTPUT_DIR] Output directory
Options:
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Eigen supports looking up Anchor and Tensor Foundation program errors by their code:
eigen error <error-code>
% eigen error 0xbbc
Anchor ErrorCode:
Error Code: 3004
Error Type: AccountDidNotSerialize
% eigen error 0x1770
TensorWhitelistError:
Error Code: 6000
Error Type: BadCosigner
% eigen error 0x2ee0
TensorAmmError:
Error Code: 12000
Error Type: WrongWhitelist
Create and edit pools:
Usage: eigen pool create [OPTIONS] <WHITELIST> <POOL_CONFIG_PATH>
Arguments:
<WHITELIST> Whitelist public key
<POOL_CONFIG_PATH> Path to the pool config file
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Usage: eigen pool edit [OPTIONS] <POOL> <EDIT_POOL_CONFIG_PATH>
Arguments:
<POOL> Pool public key
<EDIT_POOL_CONFIG_PATH> Path to the edit pool config file
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Create and update whitelists:
Usage: eigen whitelist create [OPTIONS] <WHITELIST_CONFIG_PATH> [NAMESPACE_PATH]
Arguments:
<WHITELIST_CONFIG_PATH> Whitelist config path
[NAMESPACE_PATH] Namespace path
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Usage: eigen whitelist update [OPTIONS] <WHITELIST_ADDRESS>
Arguments:
<WHITELIST_ADDRESS> Whitelist address
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-c, --new-conditions-path <NEW_CONDITIONS_PATH> New conditions path
-u, --new-update-authority-path <NEW_UPDATE_AUTHORITY_PATH> New update authority json file path
-f, --new-freeze-authority <NEW_FREEZE_AUTHORITY> New freeze authority
-h, --help Print help
Get balances of all the Tensor Foundation fee shards:
eigen fees balances
Save all the shard addresses to fee_shards.json
file:
eigen fees shards
Fund all the shards with minimum rent lamports on the current cluster, shards already funded are skipped:
eigen fees fund