This is a brief workflow of creating BNPL plans.

To use Cyan's BNPL feature, follow these steps.

  1. Pricer Step 1
  2. Pricer Step 2
  3. Create BNPL Plans
  4. Make a payment

📘

Info

In order to create a BNPL plan, a user wallet address is required. This is due to the fact Cyan will create a unique signature and return it as a requirement to initiate the BNPL plan via smart contracts. The signature is automatically generated and will return in the response request for BNPL prices.

There are four steps in the BNPL plan process. They are:

  1. Create Cyan Wallet
  2. Fund the NFT purchase
  3. Purchase the NFT
  4. Activate the loan

For step 1, a new wallet will be created if the user does not have a Cyan Wallet yet (ERC-1271 smart contract wallet). A small gas fee is associated with the creation.

In step 2, funds are requested from the respective Cyan Vault. If the risk is appropriate and the funds are available, ETH (or ERC-20) will be sent to the admin wallet to execute the purchase of the NFT. Occasionally, new plans may be rejected at this step if the risk is intolerable or the user is trying to take advantage in some manner (wash trade, etc.).

In step 3, the admin wallet makes the purchase of the NFT and initiates the transfer of the NFT to the protocol.

Lastly in step 4, the NFT is transferred to the user's newly created Cyan Wallet and their downpayment settles and moves to the respective vault. The loan commences after settlement on the blockchain.


A batch plan is when multiple BNPL loans are executed in one transaction. This will be utilized when users "sweep the floor" or purchase multiple NFTs in a batch plan to save on gas and time.

To create a batch plan, the user needs to have a Cyan Wallet. The SDK handles wallet creation internally, but if you want to do it manually, you can retrieve the user's Cyan Wallet using the getCyanWallet method and create a wallet using the createCyanWallet method.


If the plan uses a non-native currency, the user must provide permission for that currency on the Cyan protocol. The SDK handles currency permissions internally, but you can also trigger it manually using the checkAndAllowCurrencyForPlan method.

1. Pricer Step 1

The BNPL Pricer takes a currency address and an array of NFT items as input, and returns a set of potential loan options.

📘

Pricer Step 1

For further details and implementation specifics, please refer to Pricer Step 1.

🚧

Terms & Conditions

When your users initiate a deal on Cyan, they automatically agree to the Terms & Conditions of Cyan. We have an optional signable step you may elect to implement on your front end to make it clear to the user what happens if they miss a payment.

2. Pricer Step 2

After the user selects a loan option from the first step, they should pass the chosen option to Pricer Step 2 to obtain the necessary data for creating a BNPL Plan.

📘

Pricer Step 2

For further details and implementation specifics of Pricer Step 2, please refer to Pricer Step 2.

3. Create BNPL Plans

To create a BNPL Plan, call the createBnpls method with returned data from the second step of the pricer.

const currencyAddress = '0x0000000000000000000000000000000000000000';
const plans = [...]; // Array of the successfully priced plans from step 2
const payFromCyanWallet = false;
               
const result = await cyan.createBnpls(
  currencyAddress,
  plans, 
  payFromCyanWallet // Optional boolean representing whether to pay the downpayment using the original wallet or not (only works for native currency)
);

4. Make a Payment

To make the next payment in a created BNPL Plan, please follow the steps in Plans.