尚未检测到更新。GitHub 发布版本后会显示在这里。
StellarLend - Decentralized Lending Protocol on Stellar/Soroban
翻译准备中
正在加载完整 README。
查看完整 README ↗Use this checklist when onboarding a new asset to the protocol. Complete each item and record the reviewer and documentation updates before merging.
set_asset_params| Item | Owner | Status |
|---|---|---|
| Configuration | ||
| Oracle | ||
| Risk Review | ||
| Testing | ||
| Liquidity | ||
| Monitoring | ||
| Documentation | ||
| Review |
The system automatically maintains stablecoin pegs across pools by:
Edit src/config/automation.ts:
const stablecoinConfig = {
targetPegPrice: 1.0, // Target price (e.g., 1.0 for USDT/USDC)
thresholdPercentage: 0.01, // % deviation before action
maxTransferAmount: 1000000, // USD value per transfer
minLiquidityRatio: 0.95, // Minimum liquidity ratio
checkIntervalMinutes: 15, // Monitoring frequency
pools: ['USDT_POOL_1', 'USDC_POOL_2'] // Whitelisted pools
};
src/scheduler.ts)Run comprehensive tests:
npm test automation/balancer.test.ts
<<<<<<< HEAD
The unified contract suite runs the shared test-utils framework and the suites built on it. It records timing, gas benchmarks and coverage:
scripts/testing/run-contract-tests.sh # all suites
scripts/testing/run-contract-tests.sh bench # gas benchmark reports
scripts/testing/run-contract-tests.sh coverage # lcov + summary (cargo-llvm-cov)
See stellar-lend/TESTING.md for fixtures, seeding, scenarios and CI.
To reproduce CI checks locally before pushing:
# From project root
chmod +x local-ci.sh
./local-ci.sh
This script runs:
cargo fmt)cargo clippy)cargo audit)To run the project locally without manually installing Node.js dependencies, you can use Docker:
api/.env and oracle/.env (use .env.example as a template).docker-compose up --build
For a full local Stellar/Soroban environment (local node, Horizon, Friendbot, deployed contracts, seeded accounts and test data):
cd docker/devnet
cp .env.example .env
docker compose up -d # boots the Soroban node, API, oracle, postgres, redis
./healthcheck.sh --wait # wait for init + services
Fund extra devnet accounts with XLM and devnet USDC using the
faucet: npm run devnet:faucet -- <identity|address>.
See docker/devnet/README.md for full setup, seeded data, liquidation scenarios, and reset instructions. The same environment is used by the VS Code Dev Container.
# Build the contract
stellar contract build
# Deploy to testnet (requires testnet account)
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/hello_world.wasm \
--network testnet \
--source <your-testnet-keypair>
# Initialize the contract
stellar contract invoke \
--id <contract-id> \
--network testnet \
--source <admin-keypair> \
-- initialize \
--admin <admin-address>
# Build and optimize
stellar contract build
stellar contract optimize \
--wasm target/wasm32-unknown-unknown/release/hello_world.wasm
# Deploy (use optimized WASM)
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/hello_world-optimized.wasm \
--network mainnet \
--source <your-mainnet-keypair>
⚠️ Security Note: Always audit and test thoroughly before deploying to mainnet. Use multisig for admin operations in production.
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗