Documentation

Everything you need to use, integrate, and build on the Dnipro protocol.

Build Your Own Adapter

Create a Dnipro-compatible adapter in four steps using the CLI generator.

01

Scaffold with the CLI

$ npm install -g @dnipro/cli
$ dnipro generate my-protocol

Generates a complete Anchor program template with all three required instructions pre-wired.

02

Implement the three interface functions

// adapter_deposit: accept tokens, issue shares
pub fn adapter_deposit(ctx, amount, min_shares_out) -> Result<u64>

// adapter_withdraw: redeem shares, return tokens  
pub fn adapter_withdraw(ctx, shares, min_amount_out) -> Result<u64>

// adapter_current_value: read-only value query
pub fn adapter_current_value(ctx, shares) -> Result<u64>

Fill in your protocol-specific logic. The template handles Anchor boilerplate.

03

Build and deploy

# Colosseum demo path
# Create an Anchor project in Solana Playground
# Build → copy the generated program ID → Deploy

For the current hackathon build, Solana Playground is the canonical Devnet deployment path. Local Anchor remains useful for development when identities are managed deliberately.

04

Register after verification

# Register only after verification
# The live demo dashboard registers the deployed Devnet Vault
# through the Registry governance authority

The Registry allowlists the adapter program, mint, state and vault accounts. External protocol routes should remain reference-only until their CPI path is verified.

SDK Quick Reference

Initialize client

import { DniproClient } from '@dnipro/sdk';
const client = new DniproClient(connection);

List all adapters

const adapters = await client.getAllAdapters();
// → AdapterDisplay[]

Get user positions

const portfolio = await client.getPortfolioSummary(wallet.publicKey);
// → { positions, totalValue, totalPnl, ... }

Build deposit transaction

const tx = client.buildDepositTransaction({
  user: wallet.publicKey,
  adapterProgramId: ADAPTER_PROGRAM_IDS.kamino,
  underlyingMint: USDC_MINT,
  adapterVault: vaultPubkey,
  feeRecipientAccount: feeAccount,
  deposit: { amount: usdcToAtomics(1000) },
});

Simulate deposit

const sim = await client.simulateDeposit(
  ADAPTER_PROGRAM_IDS.kamino,
  usdcToAtomics(1000)
);
// → { estimatedOutput, estimatedFee, warnings }