Skip to main content

OptiView DeFi CLI — swap, portfolio, yield scouting & composite ranking, 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, rank yield pools by composite score, and control EVM wallets through a single optiview CLI, no API wiring required.

PyPI Python License: MIT

Skills

Skill Description Auth Required
swap Token swap via 0x Protocol: price quotes, full quotes with calldata, supported chains and token lists No
assets Portfolio management via DeBank: total balance, per-chain balance, tokens, DeFi positions, NFTs, transaction history, net worth curves No
yields scout Stablecoin yield scouting via DeFiLlama: filter and rank pools by APY, TVL, and chain No
yields rank Multi-dimensional yield pool ranking: composite score across TVL depth, APY sustainability, prediction confidence, and risk No
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 yield ranking (composite scoring), install with the rank extra:

pip install "optiview-cli[rank]"

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

pip install "optiview-cli[wallet]"

For everything:

pip install "optiview-cli[all]"

Quick Start

export OPTIVIEW_API_URL=https://optiview.app

# Swap: get price for 1000 USDC → WETH on Ethereum
optiview swap price \
  --sell-token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
  --buy-token  0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
  --sell-amount 1000000000 \
  --chain-id 1

# Portfolio: total USD balance
optiview assets total-balance --address 0xYOUR_ADDRESS

# Yields: scout stablecoin pools (APY-first, chain-grouped)
optiview yields scout --chain Ethereum --output markdown

# Yields: composite ranking across all chains (score-first)
optiview yields rank --limit 20 --output markdown

# Wallet: create a new EVM wallet
optiview wallet new

Yield Ranking

The yields rank command scores every pool across four dimensions:

Dimension Weight Description
TVL depth 37.5% log10(TVL) with p5–p95 percentile normalisation
APY sustainability 37.5% Exponential saturation curve; penalises short-term incentive spikes
Prediction confidence 25% DefiLlama ML signal (binnedConfidence + predictedClass)
Risk factor −25% max Outlier flag + IL risk level + 7-day APY volatility

Each pool receives a composite score from 0 to 100. Output fields include score, risk_level (Low/Medium/High), and predicted_class (Stable/Up/Down).

# Top 50 across all chains (default)
optiview yields rank

# Top 20 on Ethereum, Markdown
optiview yields rank --chain Ethereum --limit 20 --output markdown

# Custom TVL threshold, JSON
optiview yields rank --tvl 5000000 --limit 100 --output json

Python API

import optiview

# Swap
price = optiview.swap_get_price("0xUSDC", "0xWETH", "1000000000", chain_id="1")

# Assets
total = optiview.assets_total_balance("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")

# Yields: simple scout (APY-first, chain-grouped)
ranked = optiview.yields_scout(min_tvl=30_000_000, min_apy=4.0, top_n=10, chain="Ethereum")

# Yields: composite ranking (score-first, cross-chain)  [requires: pip install optiview-cli[rank]]
top_pools = optiview.yields_rank(limit=50, chain=None, min_tvl=1_000_000)
top_eth   = optiview.yields_rank(limit=20, chain="Ethereum", min_tvl=5_000_000)

# Wallet
w = optiview.wallet_create()
bal = optiview.wallet_native_balance("https://eth.llamarpc.com", w["address"])

Changelog

1.1.0

  • New: yields rank command — multi-dimensional composite scoring across TVL depth, APY sustainability, DefiLlama prediction confidence, and risk factors
  • New: optiview.yields_rank() Python API
  • New: [rank] optional dependency group (numpy, pandas)
  • No breaking changes; all 1.0.x commands remain unchanged

1.0.0

  • Initial release: swap, assets, yields scout, wallet

License

MIT

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.1.0.tar.gz (17.2 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.1.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: optiview_cli-1.1.0.tar.gz
  • Upload date:
  • Size: 17.2 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.1.0.tar.gz
Algorithm Hash digest
SHA256 150a7ecc00dea74f6171d886bbeb150bc9852be37ff7df9f3b3d181a3919aac0
MD5 81cadae97315178643ca003abbe6593e
BLAKE2b-256 44bb20c5fce92fe797933f3cd44e6348e3031036eb3c140d9cd8697415fd7b8b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: optiview_cli-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b11f439bf06171f353bc8c18030332d34793dcc993e213f02f224b88da241a9a
MD5 2b058db90bfb270341e585ea9b9a9a30
BLAKE2b-256 a19f6799dff0303c032ddb13ce37d11f0cdc499a0c4ba225b592d360a043a1a9

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