Protocol overview
How Nolus works end to end, covering users and lenders, markets, where position assets live on Solana, the life of a position and fixed-rate interest.
Nolus gives users leveraged spot exposure at a fixed rate. When a user opens a position, Nolus buys the actual asset with the user's down payment and a loan from a lending pool, and the rate on that loan stays fixed until the position closes.
Nolus is deployed on a purpose-built, semi-permissioned ledger, while the position assets stay on Solana. Solray, the Nolus program on Solana, holds them in each position's own account and runs the swaps there.
Users, lenders and NLS holders
The protocol brings together users who want leverage and lenders who supply it. Users open positions with a down payment to get leveraged long or short exposure to an asset, and while a position is open they can repay it, close it, or set take profit and stop loss levels.
Lenders provide the loans behind those positions. They deposit the pool currency into a lending pool and receive nLPN pool shares in return, whose value grows with the loan interest that positions pay, and they can withdraw later. On top of that interest, lenders receive NLS rewards that are distributed to the pools.
NLS is the native token of the Nolus chain, which holders stake with validators and use to vote in chain governance.
Markets and protocols
Each market on Nolus is served by its own protocol, a set of contracts with
its own lending pool, oracle and position factory. Every protocol today runs
on Solana with Metis as the swap venue, and its name reflects that:
SOLANA-METIS-<LPN>, where the LPN is the currency that its lending pool
lends.
Whether a market is long or short depends on what it borrows. Long markets
borrow USDC from the lending pool of SOLANA-METIS-USDC and buy the asset the
user wants exposure to, while short markets borrow the shorted token from that
token's pool, sell it, and hold USDC as the position asset.
The app at app.nolus.io shows the current markets. To list the protocols and their contract addresses programmatically, query the admin contract as described in Discover contract addresses.
Where assets live
Every token the protocol works with stays on Solana, and Nolus works with
receipts for those tokens. Solray locks a user's tokens in escrow, and Nolus
credits a receipt for each one, an ibc/ balance on Nolus that stands for the
token held on Solana. As a result, lending, repayments and settlement can all
run on Nolus with receipts.
A position's own assets are held on Solana as well, in a dedicated account in Solray's Remote Lease app. The Lease contract on Nolus controls that account over IBC, and when the position needs to trade, the swap runs on Solana through Metis.
For a user, all of this starts with a Solana wallet. Users connect Phantom or Solflare, and because their Nolus account is derived from the same Solana key, the Solana wallet also signs their Nolus transactions. A user locks tokens on Solana to receive receipts in their Nolus account, opens, repays and closes positions on Nolus, and later redeems receipts so that Solray releases the tokens back to their Solana wallet. Since the Solana-side steps are Solana transactions, they need SOL for fees. The Solray page describes escrow and receipts in detail.
Life of a position
A position goes from a quote to an open position on Solana, then stays open until the user repays or closes it or the protocol liquidates it:
- The user asks the protocol's Leaser for a quote, and for a given down payment and position asset the Leaser returns the total position, the loan, and the annual loan and margin interest rates.
- When the user sends
open_leaseto the Leaser with the down payment, the Leaser creates a Lease contract for the position, which borrows the loan from the lending pool. - The Lease opens its own account in Solray's Remote Lease app on Solana and then redeems its receipts for the down payment and the loan, so that Solray releases those tokens from escrow into the account.
- One swap through Metis buys the position asset, after which the position is open and its asset sits in its Solana account.
- While the position is open, interest accrues and the oracle tracks the price, and the Lease re-checks its loan-to-value (LTV) on price moves and on a timer.
- The user can repay the loan in part or in full, or sell the position. A full repayment returns the asset to Solray's escrow and credits a receipt for it to the user's Nolus account automatically, whereas a close credits the proceeds to the user as pool-currency receipts.
- If the LTV crosses the liquidation threshold, the protocol sells part of the position to bring it back to a healthy level, or all of it when a partial sale cannot, as Liquidations and risk explains.
Of these steps, only opening the account on Solana can make the open fail. If
Solana rejects that request or the request times out, the position ends in
open_failed, the down payment is refunded in full and the loan is closed.
Funding the account and the swap that follows never fail the open, because
they are retried until they succeed.
Fixed-rate interest
A position pays two kinds of interest, loan interest and margin interest, and both rates are fixed when the position opens. The figures in this section are examples from the current configuration.
Loan interest goes to the lending pool and so to its lenders. Its rate comes from the pool's utilization curve at the moment the position opens. With a base rate of 3%, optimal utilization of 70% and an addon of 2%, the rate starts at 3% when the pool is idle and rises with utilization until it reaches 9.67% at the optimal utilization. The loan rate gives the full formula.
Margin interest of 4.5% a year is charged on top of the loan rate. Margin interest funds NLS buybacks and the Nolus referral program.
Interest is due every 30 days. When interest stays unpaid past the due period, the protocol collects it by selling part of the position. To check the live values, run the queries in Loan-to-value and the position parameters and The loan rate.
Where to go next
Architecture
The contract set, how to discover addresses, and how Nolus drives positions on Solana.
Spot Margin
Quote, open, query, repay and close a position, with the JSON messages for each step.
Lending
Supply a lending pool, receive nLPN and claim NLS rewards.
Liquidations and risk
LTV thresholds, warnings, partial and full liquidation, and slippage protection.
Introduction
Developer docs for Nolus, fixed-rate spot margin on Solana. Learn the contracts, lending pools, Solray and the public APIs, with queries and messages.
Architecture
The contracts behind each Nolus protocol and the platform, how to discover their addresses, the off-chain services, and how positions run on Solana.