Building a DeFi Lending Platform on NEAR Blockchain With a Custom Oracle and Vesting Rewards
Built for a Web3 startup that wanted AAVE-grade lending inside the NEAR ecosystem, this DeFi lending platform lets users lend and borrow digital assets without ever handing over custody.
- → $4.99M supplied — total value supplied through the protocol on mainnet
- → 1,000+ wallets — supplying and borrowing in the first quarter
- → 4 lending markets — live at launch — WETH, WNEAR, USDT, USDC
- → ~30s price updates — from the custom DEX + CEX oracle

Project Details
NearFinance is a non-custodial lending and borrowing liquidity protocol running on the NEAR blockchain protocol. The client came to LITSLINK with a clear brief: bring the lending mechanics that made AAVE and Compound successful to a chain that didn’t have them yet. We covered business analysis for the blockchain project, product design, smart contracts development, software engineering, and full-cycle QA.








Business Challenge: Building a Decentralized Lending Protocol on NEAR
Our client, a Web3 startup, set out to build a non-custodial lending and borrowing platform native to NEAR — a money market for lending, borrowing, and earning against crypto without giving up custody. At the time, the NEAR ecosystem had no mature blockchain lending platform of that kind.
The brief borrowed AAVE and Compound protocol best practices, but couldn’t copy their code. NEAR’s runtime is asynchronous, its contracts are written in Rust, and cross-contract calls behave nothing like Solidity’s. Three problems defined the project.

Lending and Borrowing on NEAR
Collateral factors, health checks, interest rate curves, and liquidation logic — every mechanic Ethereum users take for granted had to be re-engineered for NEAR's asynchronous execution model. Smart contracts development on NEAR had to account for that at every step, or user funds would be at risk.

Custom Oracle for Asset Pricing
Third-party oracle coverage on NEAR was thin at the time, and pulling prices from a single DEX would have exposed the protocol to flash-loan-style manipulation. The client needed oracle service development from scratch: a feed that aggregates DEX and CEX data, filters outliers, and fast updates.

Vesting Rewards and Ledger Trading
The client wanted rewards with vesting time written into the contracts, so incentives stay locked for a set period before they unlock. On top of that came Ledger trading integration, because nobody serious about secure digital asset lending signs large transactions from a hot wallet.
Our DeFi Lending and Borrowing Platform Solution
We assigned a Solution Architect with hands-on crypto trading experience to lead the build, then staffed the team around it: blockchain engineers for the Rust contracts, back-end and front-end developers, and a UX/UI designer. Eight people in total.
The core question wasn’t “can we port AAVE?” It was: what should a lending protocol on NEAR look like when the chain settles in about a second and gas costs cents? That reframing shaped the whole DeFi liquidity protocol, from the contract architecture to the React.js DeFi frontend.
The result is a decentralized lending and borrowing protocol where deposits, borrows, rewards, and liquidations all run through Rust contracts on-chain: a transparent financial protocol with no custodial middle layer, verifiable by anyone.
Rust smart contracts run the on-chain logic. The Node.js blockchain backend is written in TypeScript and handles indexing plus the oracle service, with Redis caching price data across the blockchain infrastructure. AWS EC2 runs the services, EventBridge schedules the oracle jobs, and CloudWatch watches it all with alerts on anomalies.
Non-Custodial Lending and Borrowing Protocol
Users lend and borrow digital assets straight from their NEAR wallets. Funds never touch a company account — smart contracts hold every position, which is what makes the protocol genuinely non-custodial.
Custom Oracle Service (DEX + CEX Data Integration)
An in-house oracle aggregates price data from multiple DEXs and CEXs, filters anomalies, and pushes updates on-chain. One manipulated pool can't trigger unfair liquidations.
Rewards With Vesting Time
Depositors earn protocol rewards that unlock on a vesting schedule. Liquidity providers who stay get paid in full; mercenary capital that leaves early forfeits part of the upside.
Ledger Trading Integration
Hardware wallet holders can supply, borrow, and claim rewards while their keys never leave the device. Every transaction is signed on the Ledger itself — a must-have for larger portfolios.
Flexible Deposit Management
Supply, withdraw, top up collateral, or repay at any moment, with borrow limits and the health factor recalculated in real time. Deposit management in DeFi rarely feels this routine.
Scrum Methodology
Project Journey
Nine months, two-week sprints, roughly 18 of them. The first DevNet demo went out in week six — early enough for the client to catch a mismatch between expected and actual liquidation thresholds before any real funds were involved.
Discovery covered the protocol’s economic model, the four user roles — lender, borrower, liquidator, and admin — the oracle architecture, and which AAVE/Compound mechanics were worth keeping versus dropping. That groundwork is why NEAR blockchain development later went ahead without major rework.
How the Lending Protocol Works
- Users sign in with a NEAR wallet or a Ledger. The dashboard reads balances straight from the chain — no registration, no custody handover.
- WETH, WNEAR, USDT, or USDC at launch. Each market shows live supply and borrow APY before the user commits a single token.
- Rust contracts record the deposit or loan, apply collateral factors, and update the account's borrow limit in one transaction.
- The custom oracle aggregates DEX and CEX data and pushes fresh prices on-chain, keeping every health factor honest.
- Suppliers accrue protocol rewards that unlock on a vesting timeline — a yield that favors liquidity that stays.
- Positions can be closed, topped up, or repaid at any moment. The contract recalculates limits instantly.
Scrum Process Flow
Smart contracts punish big-bang releases — you can’t hotfix user funds out of a bad deployment. Our blockchain development team built iteratively instead: each sprint’s contract changes were deployed and tested on DevNet, and only QA-validated builds got promoted to mainnet.

-Timeline
Development Process — Five Phases
Discovery & Product Workshop
- Auditing which AAVE and Compound mechanics to adapt
- Defining 4 user roles and the reward economics
- Business analysis and risk mapping for the blockchain project
Architecture & UX Prototyping
- Designing contract architecture for NEAR's async runtime
- Prototyping the Market and My Account Flows
- Specifying the oracle's DEX and CEX data sources
Agile Development (Sprints)
- Writing Rust smart contracts for lending, rewards, and vesting
- Building the Node.js/TypeScript backend and React.js frontend
- Deploying every sprint increment to devnet
QA & Testing
- Full cycle QA across contracts, Oracle, and UI — blockchain edge cases included
- Stress-testing liquidations against simulated price swings
- Verifying Ledger signing on real devices
Launch & Support
- Devnet and mainnet deployment with staged promotion
- Monitoring via CloudWatch dashboards and alerts
- Post-launch support and contract iteration
Results
Before
- ✕ Lending liquidity on NEAR is scattered across bridges to other chains.
- ✕No AAVE-style borrowing mechanics native to the ecosystem.
- ✕ Price feeds are dependent on third-party providers with thin NEAR coverage.
- ✕ Liquidity incentives prone to instant farm-and-dump.
- ✕No single interface for supplying, borrowing, and tracking account health.
After
- ✔ ~$5M in total value locked consolidated on one NEAR-native protocol.
- ✔ 4 lending markets live (WETH, WNEAR, USDT, USDC), with $1.4M+ borrowed.
- ✔ Custom oracle refreshing prices every ~30s from DEX + CEX feeds.
- ✔Early withdrawals down ~33% once vesting rewards went live.
- ✔ One dashboard for deposits, borrows, rewards, and the health factor.

Impact of the Lending Protocol After Launch
-Verified Reviews
Our Reputation on Top Platforms
LITSLINK is consistently rated among the top blockchain and artificial intelligence development companies on Clutch and GoodFirms, with reviews that single out communication and the team’s depth on complex integrations.
Have a DeFi Project in Mind?
Need a DeFi lending platform of your own, or a partner for DeFi lending and borrowing platform development? Tell us what you’re building and we reply within 48 hours.












