Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage staking #1065

Merged
merged 27 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
175 changes: 175 additions & 0 deletions Cargo.lock

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

17 changes: 15 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ members = [
"pallets/parachain-staking",
"pallets/ve-minting",
"pallets/stable-pool",
"pallets/lend-market",
"pallets/prices",
"pallets/leverage-staking",

"runtime/bifrost-kusama",
"runtime/bifrost-polkadot",
Expand All @@ -46,6 +49,7 @@ bifrost-rpc = { path = "node/rpc" }
bifrost-salp-rpc = { path = "pallets/salp/rpc" }
bifrost-stable-pool-rpc = { path = "pallets/stable-pool/rpc" }
bifrost-ve-minting-rpc = { path = "pallets/ve-minting/rpc" }
lend-market-rpc = { path = "pallets/lend-market/rpc" }

# Bifrost Runtime
bifrost-kusama-runtime = { path = "runtime/bifrost-kusama" }
Expand Down Expand Up @@ -83,6 +87,11 @@ bifrost-vstoken-conversion = { path = "pallets/vstoken-conversion", de
bifrost-vtoken-minting = { path = "pallets/vtoken-minting", default-features = false }
bifrost-vtoken-voting = { path = "pallets/vtoken-voting", default-features = false }
bifrost-xcm-interface = { path = "pallets/xcm-interface", default-features = false }
lend-market = { path = "pallets/lend-market", default-features = false }
lend-market-rpc-runtime-api = { path = "pallets/lend-market/rpc/runtime-api", default-features = false }
pallet-prices = { path = "pallets/prices", default-features = false }
pallet-traits = { path = "pallets/traits", default-features = false }
leverage-staking = { path = "pallets/leverage-staking", default-features = false }

# Zenlink
merkle-distributor = { git = "https://github.com/bifrost-finance/merkle-distributor", branch = "release-polkadot-v1.1.0", default-features = false }
Expand All @@ -102,6 +111,7 @@ orml-utilities = { git = "https://github.com/open-web3-stack/open-runtime-m
orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4", default-features = false }
orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4", default-features = false }
orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4", default-features = false }
orml-oracle = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "b3694e631df7f1ca16b1973122937753fcdee9d4", default-features = false }

# Substrate Client
frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
Expand Down Expand Up @@ -283,18 +293,21 @@ scale-info = { version = "2.10.0", default-features = false }
serde_json = { version = "1.0.105", default-features = false }
serde = { version = "1.0.188", default-features = false }
strum = { version = "0.24.1", default-features = false, features = ["derive"] }
num-traits = { version = "0.2.15", default-features = false }
num-bigint = { version = "0.4.3", default-features = false }
impl-trait-for-tuples = { version = "0.2.2" }

[profile.dev]
split-debuginfo = "unpacked"

[profile.release]
panic = "unwind"
opt-level = 3
panic = "unwind"

[profile.production]
codegen-units = 1
inherits = "release"
lto = true
codegen-units = 1

# The list of dependencies below (which can be both direct and indirect dependencies) are crates
# that are suspected to be CPU-intensive, and that are unlikely to require debugging (as some of
Expand Down
2 changes: 2 additions & 0 deletions node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ bifrost-ve-minting-rpc = { workspace = true }
bifrost-ve-minting-rpc-runtime-api = { workspace = true }
bifrost-stable-pool-rpc = { workspace = true }
bifrost-stable-pool-rpc-runtime-api = { workspace = true }
lend-market-rpc = { workspace = true }
lend-market-rpc-runtime-api = { workspace = true }
zenlink-protocol = { workspace = true }
zenlink-protocol-rpc = { workspace = true }
zenlink-protocol-runtime-api = { workspace = true }
Expand Down
10 changes: 8 additions & 2 deletions node/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ use bifrost_stable_pool_rpc::{StablePoolRpc, StablePoolRpcApiServer};
use bifrost_stable_pool_rpc_runtime_api::StablePoolRuntimeApi;
use bifrost_ve_minting_rpc::{VeMintingRpc, VeMintingRpcApiServer};
use bifrost_ve_minting_rpc_runtime_api::VeMintingRuntimeApi;
use lend_market_rpc::{LendMarket, LendMarketApiServer};
use lend_market_rpc_runtime_api::LendMarketApi;
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use sc_rpc_api::DenyUnsafe;
use sc_transaction_pool_api::TransactionPool;
Expand Down Expand Up @@ -86,6 +88,7 @@ where
C::Api: FeeRuntimeApi<Block, AccountId>,
C::Api: SalpRuntimeApi<Block, ParaId, AccountId>,
C::Api: StablePoolRuntimeApi<Block>,
C::Api: LendMarketApi<Block, AccountId, Balance>,
C::Api: ZenlinkProtocolRuntimeApi<Block, AccountId, AssetId>,
C::Api:
zenlink_stable_amm_runtime_api::StableAmmApi<Block, CurrencyId, Balance, AccountId, PoolId>,
Expand All @@ -103,7 +106,8 @@ where
module.merge(SalpRpc::new(client.clone()).into_rpc())?;
module.merge(ZenlinkProtocol::new(client.clone()).into_rpc())?;
module.merge(StableAmm::new(client.clone()).into_rpc())?;
module.merge(StablePoolRpc::new(client).into_rpc())?;
module.merge(StablePoolRpc::new(client.clone()).into_rpc())?;
module.merge(LendMarket::new(client).into_rpc())?;

Ok(module)
}
Expand All @@ -126,6 +130,7 @@ where
C::Api: FeeRuntimeApi<Block, AccountId>,
C::Api: SalpRuntimeApi<Block, ParaId, AccountId>,
C::Api: VeMintingRuntimeApi<Block, AccountId>,
C::Api: LendMarketApi<Block, AccountId, Balance>,
C::Api: ZenlinkProtocolRuntimeApi<Block, AccountId, AssetId>,
C::Api: StablePoolRuntimeApi<Block>,
C::Api: BlockBuilder<Block>,
Expand All @@ -142,7 +147,8 @@ where
module.merge(SalpRpc::new(client.clone()).into_rpc())?;
module.merge(VeMintingRpc::new(client.clone()).into_rpc())?;
module.merge(ZenlinkProtocol::new(client.clone()).into_rpc())?;
module.merge(StablePoolRpc::new(client).into_rpc())?;
module.merge(StablePoolRpc::new(client.clone()).into_rpc())?;
module.merge(LendMarket::new(client).into_rpc())?;

Ok(module)
}
Loading
Loading