Docs

How a deposit becomes liquidity on Montra's Uniswap v4 pools, what it costs, and where the contracts live.

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. 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. 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. 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. 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. 5.Opening. One transaction places every step. amount0Max and amount1Max bound 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.

Spot
1
Even depth on every step.
Curve
e^(−4.6x²) + 0.05
Deepest beside the price, thinning fast toward the edges.
Bid-Ask
0.18 + 1.55x²
Light near the price, heaviest at the edges.
Fusion
Half Curve, half Bid-Ask
Depth at the price and at the extremes.
Custom
Set per step
Your own weight for every step, painted on the profile.

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. claim pays your fees and leaves your liquidity in place. withdraw removes 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.

Who can start one
Only the wallet that created the well. Anyone else who wants to sponsor starts their own well with the range they want to pay for.
Reward token
Any ERC20, or native HYPE sent as value. Fee-on-transfer tokens fund only what actually arrives.
Duration
From 1 hour to 2 years. At most 8 farms per well.
Split
By liquidity, through a reward-per-liquidity accumulator like the fee one. A deposit earns only rewards that stream after it lands.
Price range
Rewards stream whether or not the price is inside the well's range. Uniswap v4 keeps no per-range time record and Montra pools run Montra's hook, so in-range-only rewards can't be enforced on chain.
Top-ups
The sponsor can add rewards and move the end later with fundFarm. A running farm's rate can only go up; an ended farm restarts from now.
Empty well
Rewards that stream while the well holds no liquidity go back to the sponsor with reclaimFarm. Nothing else can be taken back.
Protocol fee
None. Stepwell takes nothing from farm rewards.

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.

interval
Seconds between timed runs. Zero means milestones only.
milestones
Up to 32 ticks the token price must reach, ordered in the direction the token appreciates. When the price crosses one, a run is due.
band
Ticks on each side of the price that a run may use. At least one tick spacing.
steps
Steps per run, split across both sides. At most 20.
perRun0 / perRun1
The most each run may spend of each currency.
recipient
Who owns the flights each run opens.

Keepers choose when, never where

Any approved keeper, or the operator, may call 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

Protocol fee
1%
The trading fees you collect from a flight or a well.
Protocol fee cap
10%
Hard cap written into the contracts (1,000 basis points). The owner cannot set a higher rate.
On your deposit
0%
The liquidity you put in is never charged.
Swap router
0%
StepwellSwap takes no fee of its own.
Farm rewards
0%
Rewards a sponsor streams to a well are paid out in full.

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

Every listed pool uses Montra's launch hook, which may take its own share of each swap before LP fees are credited. The fees you see on Stepwell are what reaches liquidity providers after that.

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

Fee yield
24h fees as an APR on the pool's liquidity, log-scaled. Full marks at 1,500%.
30
Fees paid
Absolute fees over 24h, log-scaled. Full marks at $25,000.
20
Depth
Liquidity already in the pool, log-scaled. Full marks at $2.5M.
20
Age
Grows in a straight line over the first 30 days, then stays full.
10
Holder safety
Starts at 20 and loses points for concentrated or suspicious holders. 10 until analysed.
20

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

StepwellLaddersFlights and single steps
Not deployed on Elysium
StepwellStakesWells and farms
Not deployed on Elysium
StepwellRoutesChannels
Not deployed on Elysium
StepwellSwapSwaps
Not deployed on Elysium

Elysium and Montra

Contracts and endpoints Stepwell depends on

Uniswap v4 PoolManagerHolds every pool
Montra hookLaunch hook on every listed pool
Chain idElysium
99901
RPCPublic endpoint
https://rpc.elysium.kinetiq.xyz

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

Shared structs
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

StepwellLadders.sol
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

StepwellStakes.sol
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

StepwellStakes.sol
// 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

StepwellRoutes.sol
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

StepwellSwap.sol
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);