Skip to main content

OptiView DeFi CLI — swap, portfolio, yield scouting, and EVM wallet management in one command.

Project description

optiview-cli

Plug-and-play DeFi agent skills for OptiView — letting any LLM agent swap tokens, manage portfolios, scout stablecoin yields, and control EVM wallets through a single optiview CLI, no API wiring required.

PyPI Python License: MIT

Skills

Skill Description Auth Required
optiview-swap Token swap via 0x Protocol: price quotes, full quotes with calldata, supported chains and token lists No
optiview-assets Portfolio management via DeBank: total balance, per-chain balance, tokens, DeFi positions, NFTs, transaction history, net worth curves No
optiview-yields Stablecoin yield scouting via DeFiLlama: filter and rank pools by APY, TVL, and chain No
optiview-wallet EVM wallet management: create wallets, query balances, send ETH/ERC-20, sign messages, track transactions No

Requirements

Install the optiview CLI:

pip install optiview-cli

For wallet operations (send/sign transactions), install with the wallet extra:

pip install "optiview-cli[wallet]"

Quick Start

# List supported swap chains
optiview swap chains

# Get swap price: 1 WETH -> USDC on Ethereum
optiview swap price \
  --sell-token 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
  --buy-token  0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
  --sell-amount 1000000000000000000 \
  --chain-id 1

# Check wallet total portfolio value
optiview assets total-balance --address 0xYourAddress

# Scout top stablecoin yields on Ethereum
optiview yields scout --chain Ethereum --top 5 --apy 5.0

# Create a new EVM wallet
optiview wallet new

# Check native balance on BSC
optiview wallet balance \
  --rpc https://bsc-dataseed.binance.org \
  --address 0xYourAddress

Usage

optiview <module> <command> [options]

swap

Command Description
swap chains List all supported chains
swap tokens --chain-id <ID> List available tokens on a chain
swap price --sell-token <ADDR> --buy-token <ADDR> --sell-amount <WEI> --chain-id <ID> Get indicative price (no tx data)
swap quote --sell-token <ADDR> --buy-token <ADDR> --sell-amount <WEI> --taker <ADDR> --chain-id <ID> Get full quote with transaction calldata

assets

Command Description
assets total-balance --address <ADDR> Total USD balance across all chains
assets chain-balance --address <ADDR> --chain-id <CHAIN> Balance on a specific chain
assets used-chains --address <ADDR> Chains the address has interacted with
assets tokens --address <ADDR> --chain-id <CHAIN> Token list on a chain
assets all-tokens --address <ADDR> All tokens across all chains
assets protocols --address <ADDR> --chain-id <CHAIN> DeFi protocol positions
assets all-protocols --address <ADDR> All DeFi positions across all chains
assets nfts --address <ADDR> --chain-id <CHAIN> NFT list on a chain
assets history --address <ADDR> --chain-id <CHAIN> Transaction history
assets net-curve --address <ADDR> --chain-id <CHAIN> Net worth curve on a chain
assets total-net-curve --address <ADDR> Total net worth curve

Chain IDs for assets use DeBank format: eth, bsc, arb, matic, op, avax, ftm, etc.

yields

Command Description
yields scout Find and rank top stablecoin yield pools

Options for yields scout:

Option Default Description
--chain all Filter by chain name (e.g. Ethereum, BSC) or all
--apy 4.0 Minimum APY %
--tvl 30000000 Minimum TVL in USD
--top 10 Top N pools per chain
--output table Output format: table, markdown, or json

wallet

Command Description
wallet new Generate a new EVM wallet
wallet address --key <PRIVATE_KEY> Derive address from private key
wallet balance --rpc <URL> --address <ADDR> Query native token balance
wallet balance-erc20 --rpc <URL> --address <ADDR> --token <ADDR> Query ERC-20 balance
wallet send-eth --rpc <URL> --key <KEY> --to <ADDR> --amount <ETHER> Send native ETH/BNB/MATIC
wallet send-erc20 --rpc <URL> --key <KEY> --token <ADDR> --to <ADDR> --amount <AMT> Send ERC-20 tokens
wallet sign --key <KEY> --message <TEXT> Sign a message (EIP-191)
wallet receipt --rpc <URL> --hash <TX_HASH> Wait for transaction receipt
wallet tx-info --rpc <URL> --hash <TX_HASH> Get transaction details

Configuration

By default, the CLI connects to the OptiView backend at https://optiview.app. To point to a custom backend, set the environment variable:

export OPTIVIEW_API_URL=https://your-custom-backend.example.com

Python API

The package also exposes a Python API for programmatic use:

from optiview import swap_get_supported_chains, yields_scout, assets_total_balance

# List supported chains
chains = swap_get_supported_chains()

# Scout yields
results = yields_scout(chain="Ethereum", min_apy=5.0, top_n=3)

# Portfolio balance
balance = assets_total_balance("0xYourAddress")

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optiview_cli-1.0.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optiview_cli-1.0.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file optiview_cli-1.0.0.tar.gz.

File metadata

  • Download URL: optiview_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for optiview_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ec762c5941107153e5c2f618f5330b0ebb97ae66eaf2052d993cd598cfea57d6
MD5 dd01e4e9e2fb5d9b63c0500e6fdfdfb9
BLAKE2b-256 89a01d78bb52000da458c03eb942e2575afb322f8a0d671b4c11ec22c06e9227

See more details on using hashes here.

File details

Details for the file optiview_cli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: optiview_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for optiview_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 336be9e7e7e3b34fab58a265577bc8fdc613725b5d4caee97291d4ee0eba3335
MD5 cdacf4af8ac54ac7cf4041b98e101e64
BLAKE2b-256 e4f4843a6ac46d3d46bc856ad938a263a289b8b08118478ea08232c00b40503a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page