On-chain programs
Three Anchor programs. Each holds only what it needs, and none can move another’s assets.
contracts/ in the repository and builds with Anchor 0.30. Not deployed or audited. Program IDs below are local placeholders.soliq_vault
The Soliq Vault: sqLP mint, ONyc reserve, instant unstakes and cooldown settlement.
Accounts
| Account | Seeds | Holds |
|---|---|---|
| Vault | ["vault", onyc_mint] | Parameters, share accounting, cooling total, curator |
| Authority | ["authority", vault] | PDA that signs for the reserve, stake accounts and swaps |
| LP mint | ["lp", vault] | sqLP. Mint authority is the vault authority |
| ONyc reserve | ATA of authority | The vault’s ONyc |
| Cooldown ticket | ["cooldown", stake_account] | One per stake account bought: lamports, epoch, payer of rent |
Instructions
| Instruction | Who | Does |
|---|---|---|
| initialize | Admin | Creates vault, authority, LP mint. Sets curator and parameters. |
| deposit(amount, min_lp) | Anyone | Takes ONyc, mints sqLP at NAV. Zaps prepend a swap in the same transaction. |
| withdraw(lp, min_out) | Anyone | Burns sqLP, pays ONyc minus the withdrawal fee. |
| instant_unstake(min_out) | Anyone | Takes a stake account, swaps ONyc to SOL via a whitelisted router, pays the user, deactivates the stake, opens a cooldown ticket. |
| settle_cooldown | Anyone (keeper) | After deactivation: withdraws lamports, swaps SOL to ONyc, closes the ticket. |
| set_params | Curator, timelocked | Fee curve, slippage, withdrawal fee, caps, accepted mints. |
| set_paused | Guardian | Pauses deposits and unstakes. Withdrawals stay open. |
Swaps without trusting the router
The program does not trust swap routes passed by the client. It records the authority’s balances, invokes the whitelisted router program with the provided accounts, and then checks the result: SOL received must cover the payout, and ONyc spent must be within the slippage limit of the oracle price. Anything else reverts the whole transaction.
let before = (onyc_reserve.amount, authority.lamports());
invoke_signed(&route_ix, remaining_accounts, &[authority_seeds])?;
let spent = before.0 - onyc_reserve.reload()?.amount;
let got = authority.lamports() - before.1;
require!(got >= payout, VaultError::InsufficientOutput);
require!(spent <= oracle_max_in(payout, slippage_bps), VaultError::Slippage);soliq_lend
Loan accounting and collateral custody. Its only lender is the vault: the vault authority PDA funds it with USDC, and nobody else can. The program only moves USDC. Borrowing any other token is a Jupiter swap the app adds to the same transaction, so it either all happens or none of it does.
Accounts
| Account | Seeds | Holds |
|---|---|---|
| Market | ["market"] | Lender (vault authority), LTV limits, fee, loan cap, Pyth feed, totals |
| Reserve | ["reserve"] | USDC token account: what the vault has made available for loans |
| Obligation | ["obligation", market, stake_account] | Owner, debt at the last checkpoint, stake lamports at the last checkpoint |
Instructions
| Instruction | Does |
|---|---|
| fund / defund | Lender only. The vault moves USDC in after selling ONyc, and takes idle USDC back out. Protocol fees stay behind. |
| deposit_stake | Moves staker and withdrawer authority to the market PDA. Delegation unchanged. Opens an obligation. |
| refresh | Anyone. Brings an obligation’s debt up to date: debt × stake_now / stake_then, plus the fee. Keepers run it every epoch. |
| borrow(amount) | Refreshes, reads SOL/USD from Pyth, checks LTV ≤ max and the loan cap, sends USDC. |
| repay(amount) | Refreshes, takes USDC. Anyone can repay for anyone. |
| withdraw_stake | Requires zero debt. Returns authorities to the owner, rewards included, and closes the obligation. |
| liquidate(repay) | If LTV > liquidation LTV: repay up to 50% of debt, split stake worth repay × (1 + penalty) to the liquidator. |
| claim_fees | Admin. Sends accrued fees from the reserve to the fee wallet: loan fees to buybacks, the liquidation cut to the insurance fund. |
fund_loans instruction that sells ONyc for USDC and calls fund, and countinglender_value in NAV, is the next piece of work.soliq_distributor
A merkle distributor for season allocations.
| Instruction | Does |
|---|---|
| new_distributor(root, total, deadline) | Creates a distributor with a funded token vault. |
| claim(index, amount, proof) | Verifies the leaf hash(index, claimant, amount) and transfers. Marks the index claimed. |
| clawback | After the deadline, returns unclaimed tokens to the community pool. |
Security model
- Upgrades by a 4-of-7 multisig behind a 48-hour timelock, until governance takes over.
- A guardian key can pause deposits, unstakes and new borrows. It cannot pause withdrawals or repayments, and it cannot move funds.
- Every PDA is derived and checked on-chain; no instruction accepts a reserve or authority account from the client unverified.
- Oracle prices are rejected if stale (over 60 slots) or if their confidence interval exceeds 1%.
- Two independent audits and a public contest before mainnet. Deposit caps at launch.