Yield-splitting protocol with fixed-income pools, an auto-roll vault, and a no-loss yield lottery.
- Multi-maturity pool deployment in one run (1M / 2M / 3M by default)
- Principal/Yield token split (
TPS/TYS) viaOrlanceVault - Router zap flow (
ETH -> stETH -> Vault) for better UX - Dedicated AMM per maturity (
TPS/stETH) - Optional seeded TVL + AMM liquidity for non-empty demo state
- Auto-roll strategy vault (
OrlanceAutoRoller, OAS share token) - No-loss yield lottery (
OrlanceNoLossLottery) with round-based winner draw
- Foundry installed
- Arbitrum Sepolia RPC URL
- Deployer private key funded with testnet ETH
# From workspace root
cd orlance-sc
# Install dependencies (if needed)
forge install
# Build
forge build# Run all tests
forge test
# Run with gas report
forge test --gas-report
# Verbose mode
forge test -vvvorlance-sc/
|- src/
| |- core/
| | |- OrlanceVault.sol
| | |- OrlanceRouter.sol
| | |- OrlanceAutoRoller.sol
| | |- OrlanceNoLossLottery.sol
| | |- PrincipalToken.sol
| | `- YieldToken.sol
| |- mocks/
| | |- MockLido.sol
| | `- SimpleAMM.sol
| |- interfaces/
| `- libraries/
|- script/
| `- FullDeploy.s.sol
|- test/
| |- Orlance.t.sol
| `- OrlanceLottery.t.sol
|- .env.example
`- foundry.toml
| Contract | Description | Main Responsibility |
|---|---|---|
OrlanceVault |
Custody hub | Mint/burn TPS/TYS, handle deposits, redemption, and yield claims |
PrincipalToken |
Principal token | Represents principal claim at maturity |
YieldToken |
Yield token | Represents claim on accrued yield |
| Contract | Description | Main Responsibility |
|---|---|---|
OrlanceRouter |
Zap helper | One-tx ETH to stETH to Vault deposit |
SimpleAMM |
Pool AMM | TPS/stETH swaps + LP liquidity |
MockLido |
Mock stETH | Faucet + simulated yield for testing/demo |
| Contract | Description | Main Responsibility |
|---|---|---|
OrlanceAutoRoller |
Auto-roll vault | Manages roll-over across maturities, mints OAS shares |
OrlanceNoLossLottery |
Yield lottery | Round-based deposits and winner payout from accrued yield |
Create your local .env:
cp .env.example .envPowerShell:
Copy-Item .env.example .envMinimum required:
ARB_SEPOLIA_RPC_URLPRIVATE_KEY
One-liner (PowerShell):
cd "orlance-sc"; forge script script/FullDeploy.s.sol:FullDeployScript --rpc-url $env:ARB_SEPOLIA_RPC_URL --broadcastFullDeploy will:
- Deploy
MockLido,OrlanceVault,OrlanceRouter - Create 3 maturity pools
- Deploy AMMs per pool (if enabled)
- Seed pool TVL + AMM liquidity (if enabled)
- Deploy auto-roller (if enabled)
- Deploy lottery (if enabled)
- Print addresses, maturities, and seeded amounts to logs
If SEED_POOLS=true and seed values are not set, defaults are:
- Pool TVL seed:
12 / 8 / 5 stETH(pool 1/2/3) - AMM seed:
3 / 2 / 1 stETH(pool 1/2/3)
Override with:
SEED_POOL_1_TVL_STETH,SEED_POOL_2_TVL_STETH,SEED_POOL_3_TVL_STETHSEED_POOL_1_AMM_STETH,SEED_POOL_2_AMM_STETH,SEED_POOL_3_AMM_STETH
Pool generation:
POOL_NAME_PREFIXBASE_MATURITY_OFFSET_DAYSMATURITY_STEP_DAYSPOOL_NAME_1..3MATURITY_TIMESTAMP_1..3
Feature flags:
DEPLOY_AMMSEED_POOLSDEPLOY_AUTO_ROLLERDEPLOY_LOTTERY
Lottery:
LOTTERY_INITIAL_MATURITYLOTTERY_ROUND_DURATION_SECONDS
Optional verification:
ETHERSCAN_API_KEY
Draw lottery winner (owner only):
cd "orlance-sc"; $seed = cast keccak "draw-$(Get-Date -Format o)"; cast send <LOTTERY_ADDRESS> "drawWinner(bytes32)" $seed --rpc-url $env:ARB_SEPOLIA_RPC_URL --private-key $env:PRIVATE_KEYTrigger auto-roller roll-over:
cd "orlance-sc"; cast send <AUTO_ROLLER_ADDRESS> "rollOver(uint256)" <NEW_MATURITY_TIMESTAMP> --rpc-url $env:ARB_SEPOLIA_RPC_URL --private-key $env:PRIVATE_KEY- Copy deployment logs (addresses + maturities).
- Update FE env files:
orlance-fe/.envorlance-fe/.env.example
- Restart FE server.
- Validate:
- pools and TVL per maturity
- auto-roller next roll-over
- lottery current round and winner history
MIT License.