Skip to main content

A Python SDK for interacting with the Vaults.fyi API

Project description

Vaults.fyi Python SDK

A Python SDK for interacting with the Vaults.fyi API. This package provides feature-equivalent functionality to the JavaScript SDK with Pythonic naming conventions.

Installation

pip install vaultsfyi

Quick Start

from vaultsfyi import VaultsSdk

# Initialize the SDK
client = VaultsSdk(api_key="your_api_key_here")

# Get user's idle assets
idle_assets = client.get_idle_assets("0x742d35Cc6543C001")

# Get best deposit options (filtered for USDC/USDS)
deposit_options = client.get_deposit_options(
    "0x742d35Cc6543C001",
    allowed_assets=["USDC", "USDS"]
)

# Get user positions
positions = client.get_positions("0x742d35Cc6543C001")

# Generate deposit transaction
transaction = client.get_actions(
    action="deposit",
    user_address="0x742d35Cc6543C001",
    network="mainnet",
    vault_address="0x...",
    amount="1000000",
    asset_address="0x...",
    simulate=False
)

API Methods

Portfolio Methods

  • get_positions(user_address, **kwargs) - Get all user positions
  • get_deposit_options(user_address, allowed_assets=None, **kwargs) - Get best deposit options
  • get_idle_assets(user_address, **kwargs) - Get user's idle/available balances
  • get_vault_holder_events(user_address, network, vault_address, **kwargs) - Get vault events
  • get_vault_total_returns(user_address, network, vault_address, **kwargs) - Get total returns

Vault Methods

  • get_all_vaults(**kwargs) - Get all available vaults
  • get_vault(network, vault_address, **kwargs) - Get specific vault details
  • get_vault_historical_data(network, vault_address, **kwargs) - Get historical data

Transaction Methods

  • get_actions(action, user_address, network, vault_address, **kwargs) - Generate transactions
  • get_transactions_context(user_address, network, vault_address, **kwargs) - Get transaction context

Other Methods

  • get_benchmarks() - Get benchmark data

Error Handling

The SDK provides specific exception types:

from vaultsfyi import VaultsSdk, HttpResponseError, AuthenticationError

try:
    client = VaultsSdk(api_key="invalid_key")
    result = client.get_benchmarks()
except AuthenticationError:
    print("Invalid API key")
except HttpResponseError as e:
    print(f"API error: {e}")

Requirements

  • Python 3.8+
  • requests

License

MIT License

Author

Kaimi Seeker (kaimi@wallfacer.io)

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

vaultsfyi-1.0.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

vaultsfyi-1.0.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vaultsfyi-1.0.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for vaultsfyi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 acbaefdd782e6b2a35457e8a33b51cbfb599d33b8771a3a6a4e27216ebd1d780
MD5 f248128c9a48bb69c7759274d101b1ff
BLAKE2b-256 a05f1fa0429691977fb78ae9137f5402f8e00fa639036a81a5bb62d81283f58b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vaultsfyi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for vaultsfyi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e067475fdb54fc971858211bb65fb49c815fbc208a2053b6c561560fb255353
MD5 b959b39b1c6f4336ab54605459c97288
BLAKE2b-256 bafca984f99380a73abb725850a9138f45f816367ae3d0ed2f3a9c2213a1c51b

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