https://github.com/primitivefinance/portfolio-rs
SDK for the Portfolio protocol written in rust.
https://github.com/primitivefinance/portfolio-rs
Last synced: 11 months ago
JSON representation
SDK for the Portfolio protocol written in rust.
- Host: GitHub
- URL: https://github.com/primitivefinance/portfolio-rs
- Owner: primitivefinance
- Created: 2023-08-07T16:35:34.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-10T21:50:43.000Z (almost 3 years ago)
- Last Synced: 2025-04-05T14:02:40.723Z (about 1 year ago)
- Language: Rust
- Size: 49.8 KB
- Stars: 9
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# portfolio-rs
Minimalist toolkit for building rust applications on top of the [portfolio](https://github.com/primitivefinance/portfolio) protocol.
## Installation
#### [Required] Foundry. [Source](https://github.com/foundry-rs/foundry).
If not installed, run the following:
```bash
# First install foundryup
curl -L https://foundry.paradigm.xyz | bash
# Restart terminal or reload `PATH`, then run foundryup
foundryup
```
### Setup
```bash
# Install submodule dependencies and generate rust bindings.
./setup.sh
# Update .env with RPC url and private key
cp .env.example .env
```
### Usage
```bash
# Run the app
cargo run -- --help
# [Optional] Install locally (breaks terminal output)
cargo install --path . --force
```
### Recompile
If you choose a different portfolio version, or install new dependencies, make sure to recompile and bind the contracts.
```bash
# Recompile rust bindings
./compile.sh
```
### Commands
*List*
Lists the available portfolio pools, including their pool id and TVL.
```bash
cargo run -- list
```
- `list` - Lists all the pools, including pool id, tokens, and estimated TVL if available.
- `info` - Prints a pool's state and configuration, if any.
- `action` - Performs an action on a pool, such as swap, add liquidity, remove liquidity, etc. [Required] Settings in portfolio.toml.