How a flight is built
A flight is a set of narrow concentrated-liquidity positions in one pool, opened, collected and closed together. Each step is its own v4 position owned by the ladder contract, kept apart from every other flight by using the flight's id as the position salt.
- 1.Range in market cap. You set the lowest and highest market cap you want to trade between. The app converts both to ticks using the token's supply and the pool's decimals, then rounds outward to the pool's tick spacing.
- 2.Slicing. The range is cut into up to 40 steps by default (the builder goes to 80; the contract accepts up to 100 per flight). Each step is at least one tick spacing wide, so a narrow range on a wide-spaced pool may end up with fewer steps than asked.
- 3.The active slot is skipped. The tick-spacing slot that contains the current price is left empty. Steps below it hold only the quote asset, steps above hold only the token, so every step is single-sided and no swap is needed to open.
- 4.Sizing. The shape assigns a weight to every step. Each side's budget is split by weight, and each step's liquidity is computed from its amount with Uniswap's own formulas, shaved by one basis point so rounding never asks for more than you approved.
- 5.Opening. One transaction places every step.
amount0Maxandamount1Maxbound what can be spent, and a deadline stops a stale transaction landing later.
Collecting and closing
collect pulls the fees of every step at once. close removes a share of every step, in basis points, so you can take out a quarter of a flight or all of it, and pays out the accrued fees with it. Flights can also be handed to another address with transferLadder, fees and all.
Single steps
A single step is a flight of one step, one tick spacing wide, placed away from the price. It behaves like a limit order that earns the LP fee as it fills. Close it once the price has crossed it, or it will unfill if the price returns.
Shapes
A shape is a weight function over each step's normalised distance from the price, x, from 0 beside the price to 1 at the far edge. Both sides of the flight use the same function, mirrored.
Shapes are computed in the app. The contract stores and enforces the steps it is given; it does not know or care which shape produced them.
Wells
A well is one shared v4 position with a fixed range. Anyone can create one for a pool with createStake, and anyone can pour into it with deposit. Each depositor owns a share of the well's liquidity.
- Fee accumulator. The well tracks fees per unit of liquidity as they arrive. Each depositor records the accumulator when they join and is owed the difference when they claim, so payouts are exact without anyone iterating over depositors.
- No shared earlier fees. A new deposit settles at the current accumulator. It earns only from trades that happen after it lands.
- Claim and withdraw.
claimpays your fees and leaves your liquidity in place.withdrawremoves liquidity and pays everything you are owed with it.
A well is a fee farm: depositors earn their share of the trading fees its range collects, from the moment they join. A well can also carry reward farms, described next.
Farms
A farm is a reward stream attached to a well. Its sponsor deposits a token up front with createFarm, and it streams to the well's liquidity at a constant rate until the end time, on top of trading fees. Projects use farms to pay for depth in their own pool.
A bad reward token can't trap your deposit
claim and withdraw pay farm rewards with a gas-capped transfer that never reverts. If a reward token refuses the transfer, that reward stays owed to you and your principal and fees still go out. claimFarm retries a single farm and reverts if the transfer fails.Channels
A channel turns a project's budget into liquidity for its own pool over time. The operator creates it with createRoute, funds it with fund, and can pause it with setActive or take back what is unspent with withdraw at any time.
Keepers choose when, never where
execute once a run is due. The steps are computed inside the contract from the live price at that moment: Spot-shaped, half above and half below, inside the band. A run can never spend more than the per-run budget or what the channel holds.Swap
StepwellSwap is a minimal exact-input router for a single v4 pool, used to top up whichever side of a flight you are short of. quote simulates the swap through the PoolManager and returns the output without moving anything; swap executes it with a minimum output and a deadline. Native HYPE is sent as value and any unused amount is refunded. The swap router takes no fee of its own.
Fees
Whenever trading fees are taken out of the pool for a flight or a well, Stepwell keeps 1% of them and the rest is yours. Flights opened by a channel are ordinary flights and pay the same. The rate is adjustable by the owner, but the contracts reject anything above 1,000 basis points (10%), and the cut is only ever applied to fees, never to the liquidity you put in.
Montra's hook comes first
Pool score
Every listed pool gets a score from 0 to 100, recomputed as it trades. It is meant for sorting, not as advice. The log-scaled parts use log10(1 + value) / log10(1 + cap), capped at 1.
Score weights
Five parts, 100 points
Holder safety starts at 20. It loses up to 8 points as the top 10 holders rise from 25% to 100% of supply, and up to 3 points each for snipers, insiders, bundlers and the deployer as each climbs toward 20%. A token whose holders have not been analysed yet scores 10 here.
Risks
- Token risk. Montra tokens are new and thinly held. Below your range you hold only the token, and it can go to zero.
- Impermanent loss. A flight is usually worth less than holding when the price has moved. Fees may or may not cover the gap.
- The hook. Montra's hook runs on every swap and liquidity change in these pools. Stepwell does not control it.
- Farm rewards. A farm's APR moves with the reward token's price and with how much liquidity is in the well. Rewards stream even while the well is out of range and earning no fees. A sponsor can pick any token, including a worthless one.
- Admin powers. The owner can pause new positions and farm funding (never exits or claims), set the protocol fee up to the 10% cap, and set per-position deposit caps.
- Data. Prices, scores and holder safety figures come from an indexer and can lag or be wrong. The chain is the source of truth.
The full list is in the terms and risks.
Contracts
All addresses are on Elysium. Verify an address on the explorer before approving anything to it.
Stepwell
Not deployed on Elysium yet
Elysium and Montra
Contracts and endpoints Stepwell depends on
Function reference
The contracts are small and meant to be called directly. Every entry point that moves funds takes a deadline and slippage bounds. Native HYPE is address(0) and is always currency0; send it as value. hookData is passed through to Montra's hook and is normally empty.
Types
struct Step { // StepwellLadders.Step int24 tickLower; int24 tickUpper; uint128 liquidity;} struct RouteParams { // StepwellRoutes.RouteParams PoolKey key; address recipient; bool baseIs0; uint32 interval; // seconds between timed runs; 0 = milestones only int24 band; // ticks each side of the price uint16 steps; // per run, split across both sides (max 20) uint128 perRun0; uint128 perRun1; int24[] milestones; // in the base-appreciating direction}Flights: StepwellLadders
function open( PoolKey calldata key, Step[] calldata steps, uint256 amount0Max, uint256 amount1Max, address recipient, uint256 deadline, bytes calldata hookData) external payable returns (uint256 ladderId, uint256 amount0, uint256 amount1); function collect(uint256 ladderId, bytes calldata hookData) external returns (uint256 amount0, uint256 amount1); function close( uint256 ladderId, uint16 bps, // 10_000 closes fully uint256 amount0Min, uint256 amount1Min, uint256 deadline, bytes calldata hookData) external returns (uint256 amount0, uint256 amount1);Wells: StepwellStakes
function createStake(PoolKey calldata key, int24 tickLower, int24 tickUpper) external returns (uint256 stakeId); function deposit( uint256 stakeId, uint128 liquidity, uint256 amount0Max, uint256 amount1Max, uint256 deadline, bytes calldata hookData) external payable returns (uint256 amount0, uint256 amount1); function withdraw( uint256 stakeId, uint128 liquidity, uint256 amount0Min, uint256 amount1Min, uint256 deadline, bytes calldata hookData) external returns (uint256 amount0, uint256 amount1); // Pays fees, plus every farm reward owed in this well.function claim(uint256 stakeId, bytes calldata hookData) external returns (uint256 amount0, uint256 amount1);Farms: StepwellStakes
// Well creator only. token = address(0) for native HYPE, sent as value.function createFarm(uint256 stakeId, Currency token, uint256 amount, uint64 duration) external payable returns (uint256 farmId); // Sponsor only. newEnd >= end; a running farm's rate may not drop.function fundFarm(uint256 farmId, uint256 amount, uint64 newEnd) external payable; // One farm, reverting if the transfer fails.function claimFarm(uint256 farmId) external returns (uint256 amount); // Sponsor only: rewards that streamed while the well was empty.function reclaimFarm(uint256 farmId, address to) external returns (uint256 amount); function farmsOf(uint256 stakeId) external view returns (uint256[] memory ids, Farm[] memory farms); function pendingFarmRewards(uint256 stakeId, address account) external view returns (uint256[] memory ids, address[] memory tokens, uint256[] memory amounts);Channels: StepwellRoutes
function createRoute(RouteParams calldata p) external returns (uint256 routeId); function fund(uint256 routeId, uint256 amount0, uint256 amount1) external payable; function execute(uint256 routeId) external returns (uint256 ladderId); function withdraw(uint256 routeId, uint256 amount0, uint256 amount1, address to) external; function setActive(uint256 routeId, bool active) external;execute reverts with NotDue unless the interval has passed or the next milestone has been reached. previewSteps(routeId) returns the steps a run would place right now.
Swap: StepwellSwap
function swap( PoolKey calldata key, bool zeroForOne, uint256 amountIn, uint256 minOut, address to, uint256 deadline, bytes calldata hookData) external payable returns (uint256 amountOut); // call with eth_call only; never send as a transactionfunction quote(PoolKey calldata key, bool zeroForOne, uint256 amountIn, bytes calldata hookData) external returns (uint256 amountOut);