Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ valence-clearing-queue = { path = "contracts/libraries/clearing-queue", features
valence-maxbtc-issuer = { path = "contracts/libraries/max-btc-issuer", features = ["library"] }
valence-duality-lper = { path = "contracts/libraries/duality-lper", features = ["library"] }
valence-duality-withdrawer = { path = "contracts/libraries/duality-withdrawer", features = ["library"] }
valence-vortex-lper = { path = "contracts/libraries/vortex-lper", features = ["library"] }

# middleware
valence-middleware-osmosis = { path = "contracts/middleware/type-registries/osmosis/osmo-26-0-0", features = [
Expand Down Expand Up @@ -131,6 +132,7 @@ valence-lending-utils = { path = "packages/lending-utils" }
valence-supervaults-utils = { path = "packages/supervaults-utils" }
valence-magma-utils = { path = "packages/magma-utils" }
valence-duality-utils = { path = "packages/duality-utils" }
valence-vortex-utils = { path = "packages/vortex-utils" }


# dev-dependencies
Expand Down
3 changes: 3 additions & 0 deletions contracts/libraries/vortex-lper/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown"
schema = "run --bin schema"
31 changes: 31 additions & 0 deletions contracts/libraries/vortex-lper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[package]
name = "valence-vortex-lper"
authors.workspace = true
edition.workspace = true
license.workspace = true
version.workspace = true
repository.workspace = true

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# use library feature to disable all instantiate/execute/query exports
library = []

[dependencies]
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-ownable = { workspace = true }
cosmos-sdk-proto = { workspace = true }
cw-utils = { workspace = true }
cw-storage-plus = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
valence-macros = { workspace = true }
valence-library-utils = { workspace = true }
valence-library-base = { workspace = true }
valence-account-utils = { workspace = true }
valence-vortex-utils = { workspace = true }
valence-osmosis-utils = { workspace = true }
38 changes: 38 additions & 0 deletions contracts/libraries/vortex-lper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Vortex LPer library

The **Valence Vortex LPer library** allows users to **deposit** into a Osmosis pool via Vortex contract from an **input account**. Also, the library allows **withdrawing from position** via vortex contract and receiving the withdrawn tokens into an **output account** and **output account_2** (principal and counterparty tokens).
Comment thread
markoj2207 marked this conversation as resolved.
Outdated

## Configuration

The library is configured on instantiation via the `LibraryConfig` type.

```rust
pub struct LibraryConfig {
/// Address of the input account
pub input_addr: LibraryAccountType,
/// Address of the output account
pub output_addr: LibraryAccountType,
/// Address of the second output account
pub output_addr_2: LibraryAccountType,
/// Configuration for the liquidity provider
/// This includes the pool address and asset data
pub lp_config: LiquidityProviderConfig,
}

pub struct LiquidityProviderConfig {
// Code of the vortex contract we are going to instantiate
pub vortex_code: u64,
// Label for the contract instantiation
pub label: String,
// Id of the pool we are going to provide liquidity for
pub pool_id: u64,
// Duration of the round in seconds
pub round_duration: u64,
// Duration of the auction in seconds
pub auction_duration: u64,
// Denoms of both assets we are going to provide liquidity for
pub asset_data: AssetData,
// Whether the principal token is first in the pool
pub principal_first: bool,
Comment thread
markoj2207 marked this conversation as resolved.
Outdated
}
```
Loading