Yelay V3 SDK Docs
  • Intro
  • Main entities
  • Setting up your account
  • Initialization
  • Deposit
  • Withdrawals
  • Tracking balance and TVL
  • Yield tracking and claiming
  • Supportive methods
  • Deposits with timelock
  • Yelay's yield farming sources
Powered by GitBook
On this page

Initialization

PreviousSetting up your accountNextDeposit

Last updated 11 days ago

Installation

To install the SDK, use npm or pnpm:

npm install @yelay-lite/sdk

or

pnpm add @yelay-lite/sdk

The SDK uses ethers.js v5.

Vaults and pools

Yelay has two types of vaults: test (on Base) and production (various chains)

  • Use test vaults on Base for testing transactions.

  • For real user funds, use production vaults only.

Test vaults are available on Base only, while production vaults are be deployed across multiple chains in addition to Base.

To retrieve actual vault addresses, use the getVaults() method.

Alternatively, see up-to-date addresses of deployed vaults across all chains here:

To fetch pool IDs belonging to a vault, use the clientData() method.

Both methods are described here: 🔗

Initialising the SDK

To start using the SDK, initialize it with an Ethereum signer or provider and a chain ID.

For Test Use

Ensure you pass the third parameter as true to initialize access to test vaults instead of production vaults.

import { Signer } from 'ethers';
import { Provider } from '@ethersproject/abstract-provider';
import { YelayLiteSdk } from '@yelay-lite/sdk';

const signerOrProvider: Signer | Provider = /* Your signer or provider */;
const chainId = 8453; // Supported chain ID

const sdk = new YelayLiteSdk(signerOrProvider, chainID, true);

For Production Use

Initialize the SDK with an Ethereum signer or provider and a chain ID:

import { Signer } from 'ethers';
import { Provider } from '@ethersproject/abstract-provider';
import { YelayLiteSdk, sdkConfig } from '@yelay-lite/sdk';

const signerOrProvider: Signer | Provider = /* Your signer or provider */;
const chainId = 8453; // Supported chain ID

const sdk = new YelayLiteSdk(signerOrProvider, chainId);
https://github.com/YieldLayer/yelay-lite/tree/27a03d61f56fea92e4ab73d36fe401391dd20edd/deployments
Yelay SDK Supportive Methods