This guide describes how to integrate Credit Vaults into Web3 applications using both the Pareto REST API and smart contracts. It is intended for technical audiences familiar with Web3 and frontend frameworks.
Smart contract instantiation
To interact with on-chain vaults, tokens, and queue contracts, a Web3 contract instance must be created using the ABI and contract address:
const contract = new web3.eth.Contract(abi, address);
This pattern is required for calling methods such as depositAA, requestWithdraw, approve. Refer to the for full syntax details.
API access
All API routes below belong to the public Pareto API at https://api.pareto.credit. Refer to the for a complete overview.
1. Required vault data
These steps outline the minimum data required to render a vault and enable interactions.
1
Load
Use either:
GET /v1/vaults/{_id} — by ID
GET /v1/vaults?address=0x... — by address
Only vaults with visibility: PUBLIC should be displayed to users.
2
Retrieve Signatures
Each vault contains a signatures array of the form:
Filter all entries where entity === 'LENDER'and use the _id values to load them. This returns the full signature definitions required to enable future user interactions.
GET /v1/signatures?_id=signatureId1,signatureId2
3
Retrieve underlying
Retrieve token information with:
GET /v1/tokens/{vault.tokenId}
4
Fetch latest
Fetch up-to-date vault metrics. This includes share price, APRs, TVL, and queue configuration.
GET /v1/vault-latest-block?vaultId={vault._id}
2. Required wallet access data
Defines the required checks and data fetches needed immediately after wallet connection to verify access and authorization for vault operations.
1
Check wallet access
To verify if a wallet is allowed to interact with the vault, instantiate the contract using the cdoEpoch ABI and address retrieved from the vault JSON:
The allowance must be verified only when the vault is in RUNNING state and uses the withdrawQueue. In this case, the withdrawQueue contract address should be used as spender.
// during NETTING period
await vaultContract.methods
.requestWithdraw(lpAmount, vault.address)
.send({ from: walletAddress });
// during cycle RUNNING
await withdrawQueueContract.methods
.requestWithdraw(lpAmount)
.send({ from: walletAddress });
Managing requests
All deposit requests (during the RUNNING state), and all withdrawals (instant or standard) are tracked under the requests array of the vaultBlock object. Each entry in this array represents a user-initiated interaction awaiting processing.