- C++ 61.5%
- TypeScript 31.4%
- JavaScript 6.1%
- Shell 0.7%
- CMake 0.2%
- Other 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- WISP_NETWORK picks the wasm wallet client and the contract ID at build time - submitTx/useTx: a wallet decline is neither a success nor an error; TxMessage shows failures - views report current debt and the HTP index; claimable bonds via view_claims; compute_lup dropped - Take confirms price and budget first; Settle offered after 72h or once collateral is gone - 512px logo doubles as the favicon; rebuilt wisp.wasm for the new auction layout |
||
| assets | ||
| dapp | ||
| scripts | ||
| shaders/wisp | ||
| tests | ||
| third_party | ||
| .gitignore | ||
| .gitmodules | ||
| README.md | ||
Wisp
An oracleless, peer-to-pool lending platform on Beam.
Wisp lets anyone lend, borrow, and liquidate on-chain without price oracles or governance. Modeled on Ajna Finance, it replaces the usual external price feed with lender-chosen price buckets: lenders deposit a quote asset into the price level they're willing to lend against, and borrowers draw debt valued against those deposits. There is no oracle to manipulate, and the admin cannot set rates, prices or liquidation terms.
Wisp is built as a Beam shader (an on-chain smart contract + a wallet-side app binary) plus a dapp frontend — both living in this repository.
How it works
| Piece | What it does |
|---|---|
| Price buckets | A fixed ladder of prices (50 bps apart). Lenders deposit the quote asset into a chosen bucket — that is their valuation. No oracle needed. |
| Lending | Deposits priced at or above the LUP (the ones lent out) earn a single uniform variable rate and accrue LP balances; deposits are always swappable for collateral at their bucket price. |
| Borrowing | Post a collateral asset, draw quote-token debt matched against lender buckets top-down. A loan stays safe while its threshold price ≤ the lowest utilized price (LUP). Loans are perpetual with an automatic variable rate. |
| Liquidations | When a loan's threshold price rises above the LUP, anyone can Kick it (posting a bond) into a Dutch auction; takers buy the collateral as the price decays. Bad debt is absorbed by reserves, then by top-bucket lenders. |
The interest rate is set endogenously by pool utilization (no governance), and
protocol reserves (origination fees + a slice of interest + liquidation
penalties) form a cushion against bad debt. Pools are permissionless — anyone can
open one for any {collateral, quote} asset pair. The contract is deployed through
the upgradable3 wrapper, so the admin keys can replace the contract code after
the configured upgrade delay. Beyond that the admin can only set a protocol fee of at
most 1% of interest (sent to the BeamX DAO or burned) and remove a pool that holds
nothing; it has no power over rates, prices or liquidations.
Building & running
Shaders compile with the Beam shader-sdk WASM toolchain (Clang → wasm32), not a
desktop compiler. After cloning with submodules:
git clone --recurse-submodules <repo-url>
# or, if already cloned:
git submodule update --init --recursive
# build the shaders
scripts/build-shader.sh shaders/wisp/contract.cpp # → contract.wasm
scripts/build-shader.sh shaders/wisp/app.cpp # → app.wasm
# deploy + assert the contract via Beam's ContractTestProcessor
scripts/run-host-tests.sh
# run the dapp (connects to a headless dappnet wallet in the browser)
cd dapp && yarn install && yarn start