Obs. 02
Sharky.fi
A token lending protocol, shipped to mainnet
- Engagement
- Protocol engineering
- Period
- 2023 — 2025
- Domain
- DeFi · Solana
- Scope
- On-chain program · SDK · Product
Sharky is the largest NFT lending protocol Solana has had, by all-time lending volume. Ermitage designed and shipped its token lending protocol end to end — the on-chain program, the developer SDK, and the product around it — from an empty directory to a live mainnet deployment. We also wrote most of the protocol's newer lending logic, including support for two additional classes of collateral.
Architecture
On-chain program · SDK · Product
01
Problem
Sharky had built its business lending against NFTs. Lending against fungible tokens is a different problem wearing similar clothes. Prices move continuously rather than between sales, so positions need live valuation. Collateral can arrive wrapped in token extensions that alter transfer behaviour, which the program must handle explicitly. And all of it shipped into a program already running with live positions inside it.
02
The protocol
The design separates the three things a lending market needs. Pools supply capital and account for what each lender is owed. An order book matches terms between the two sides. Loans track a position through borrowing, repayment, extension and foreclosure. It shipped as part of the protocol's on-chain program, went to mainnet, and was supported through launch. Alongside it we wrote the lending logic for two further collateral types the protocol wanted to accept.
03
From program to product
A program is not a product. We wrote the SDK other engineers integrate against, the state layer the interface runs on, the live data that keeps positions current, and hardware wallet support for the largest holders. Collateral valuation draws on independent price feeds; in a lending market, a single price source is a single point of failure. Around twenty-five assets were onboarded through that pipeline. The token lending line was later retired as Sharky refocused, which is the ordinary fate of a product line inside a larger protocol.