Borrow (CDP)
Create the client
import { Mento, ChainId } from '@mento-protocol/mento-sdk'
import { parseUnits } from 'viem'
const mento = await Mento.create(ChainId.CELO)Open a trove
// Borrow GBPm against USDm collateral (debt token = GBPm)
const openTx = await mento.borrow.buildOpenTroveTransaction('GBPm', {
owner: ownerAddress,
ownerIndex: 0,
collAmount: parseUnits('10000', 18), // USDm collateral
boldAmount: parseUnits('1000', 18), // GBPm to borrow
annualInterestRate: parseUnits('0.05', 18), // 5%
maxUpfrontFee: parseUnits('100', 18),
})Predict upfront fee (before opening)
Get trove data
Get system parameters
Adjust and close troves
Summary
Operation
Service method
Last updated