Docs

Developers

Program

Accounts, addresses, instructions and units of the Taper program.

Taper is one Anchor program. Everything on this page comes from its interface definition (IDL), which ships with the SDK.

Addresses

USDC mintEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
SOL mintSo11111111111111111111111111111111111111112
JitoSOL mintJ1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn
NVDAx mintXsc9qvGR1efVDFGLrVsmkzv3qi45LTBjeUKSPmx9qEh
Pyth receiverrec2HHDDnjLfj4kE7VyEtFA1HPGQLK33259532cRyHp

The program and market addresses appear here when the markets open.

Accounts

Seven account types hold all state. Every address is a program-derived address from fixed seeds.

AccountSeedsHolds
Market"market", collateral mint, USDC mint, adminLimits, oracle settings, the rate model, pool cash, debt index and shares, last price used, jump fee.
Bands"bands", marketAll 128 bands in one zero-copy account: each band's dollars, collateral and total shares.
Loan"loan", market, borrowerDebt shares, the first band and band count, and the loan's share of each of its bands.
Lender"lender", market, ownerThe lender's shares of the pool.
StakeConfig"stake_config", adminThe stake token for every market under this admin, and its vault.
SessionStake"session_stake", stake config, ownerA candidate's staked TAPER, the roles it backs and when its last one ended.
SessionRole"session_role", marketA stock market's session signer, or none.

Staked TAPER sits in one vault per stake config, at "stake_vault" with the config as the second seed. Each market also owns two token vaults, at "stable" and "collateral" with the market as the second seed. The USDC vault backs pool cash plus every band's dollars; the collateral vault backs every band's collateral.

Keeping all bands in one account means a swap that crosses twenty bands still passes one account. The cost is that every swap and borrow in a market writes to the same account, so a market's trades land one after another.

Units

QuantityUnit
USDCMicro-dollars, the token's own 6 decimals.
CollateralMicro-tokens: one millionth of a token, whatever the mint's decimals. SOL and JitoSOL amounts are multiplied by 1,000 to get lamports or atoms; NVDAx by 100.
PricesMicro-dollars per whole collateral token.
Debt indexFixed point with 12 decimals.
Rates, fees, discountsBasis points.

Instructions

InstructionSignerWhat it does
open_loancollateral, debt, countBorrowerDeposit collateral over count bands under the price and borrow debt USDC.
repaymax_amountAnyonePay down a loan's debt. Paying more than is owed clears it; only what is owed moves.
close_loanmax_payment, min_collateralBorrowerSettle the whole loan: band dollars pay the debt first, the wallet pays the rest, and the collateral comes back.
deposit_liquidityamount, min_sharesLenderSupply USDC to the pool for lender shares.
withdraw_liquidityshares, min_amountLenderBurn lender shares for USDC out of the pool's idle cash.
swapbuy_collateral, max_input, min_output, max_crossingsAnyoneTrade with the bands at the oracle-derived price: buy collateral with USDC, or sell it back.
liquidatemax_payment, min_collateralAnyoneClose a loan with negative health: pay its discounted collateral value and take the collateral.
healthAnyoneRecord a fresh price and emit a loan's health. Moves no funds.
sync_collateralAnyoneRecord a changed NVDAx multiplier after a corporate action.
init_marketpAdminCreate a market with its immutable parameters.
set_sessionopen, borrow_untilAdminOpen the NVDAx borrowing window for one trading session.
recenter_marketbase_priceAdminMove an empty market's band grid to a new base price.
sign_sessionopen, borrow_untilSession signerOpen the NVDAx borrowing window as the market's appointed signer, with at least 1,000,000 TAPER staked.
init_stake_configAdminName the stake token for markets under this admin: a fixed-supply mint with six decimals and no freeze authority.
stake_sessionamountAnyoneStake TAPER as a candidate for session signer.
unstake_sessionamountStakerTake stake back once it backs no role and 30 days have passed since its last one.
appoint_session_signerAdminMake a candidate with at least 1,000,000 TAPER staked a stock market's session signer.
remove_session_signerAdminRemove a market's session signer. Its stake stays bound for 30 days.
burn_session_stakeAdminBurn a signer's whole stake, while it backs a role or within 30 days after.

Events

The program emits seven events, which the indexer stores and the app reads for history.

EventWhenFields
LoanChangeA loan opens (action 0), is repaid (1), closes (2) or is liquidated (3).market, loan, borrower, action, debt, x, y, bad_debt
PoolChangeA lender deposits or withdraws.market, user, deposit, amount, shares
BandSwapSomeone trades with the bands.market, trader, buy_collateral, input, output, oracle, crossings
HealthSnapshothealth is called.loan, debt, assets, x, y, oracle
SessionWindowThe admin or the session signer opens a borrowing window.market, user (who signed), open, borrow_until
SessionSignerChangeA session signer is appointed or removed.market, user, appointed
SessionStakeChangeTAPER is staked (action 0), unstaked (1) or burned (2).config, user, action, amount, staked

x is dollars and y collateral, in the units above.

Compute

Measured on the built program: opening a loan over four bands takes about 58,000 to 62,000 compute units, over fifty bands 117,717, and a swap across 49 bands 328,791. Transactions that touch many bands need a compute budget above Solana's 200,000 default; the SDK requests 1.4 million by default.