👩‍💻
Builder Portal
  • Sovryn Builder Portal
    • Contribution
  • Design System
    • Design principles
    • Structure
    • Usage by Sovryn
  • UI Library
    • Overview
    • Getting Started
    • Atoms
      • Accordion
      • Badge
      • HealthBar
      • Button
      • DynamicValue
      • Heading
      • ErrorBadge
      • Icon
      • Input
      • Lottie
      • Paragraph
      • Toggle
      • Link
      • Checkbox
    • Molecules
      • AmountInput
      • ContextLink
      • Dialog
      • Dropdown
      • ErrorList
      • Footer
      • FormGroup
      • Header
      • HelperButton
      • Menu
      • NavMenuItem
      • Notification
      • Overlay
      • Pagination
      • RadioButton
      • RadioButtonGroup
      • Select
      • SimpleTable
      • StatusItem
      • Table
      • TableBase
      • Tabs
      • Tooltip
      • TransactionId
      • VerticalTabs
      • VerticalTabsMobile
      • WalletContainer
      • WalletIdentity
    • Working with Components
    • Links
    • Contribution
  • Sovryn SDK
    • Smart Router
      • Creating a New Swap Route
      • Available routes
        • AMM
        • MoC integration
        • MYNT bAsset
        • MYNT fixed rate
    • Sovryn Onboard
      • Installation
      • Usage
      • Custom Connectors
      • Custom UI
      • Contribution
    • The Graph
      • Overview
      • Usage
      • Sovryn Subgraphs
      • Advanced Usage
  • sovryn.app
    • Overview
    • Sovryn UI Library Usage
    • The Graph Usage
    • Links
    • Contribution
    • Dapp specific components
      • MaxButton
  • Smart Contracts
    • Overview
    • AMM
      • Liquidity
        • V1 Converters
        • V2 Converters
      • Conversion
      • Wrapper
        • V1 liquidity
        • V2 liquidity
        • Swaps
    • Sovryn Protocol
      • Lending
        • Mint
        • Burn
      • Borrowing
        • Borrow
        • Repay
      • Margin Trading
        • Open
        • Close
      • Collateral Management
    • Liquidity Mining
      • Deposit
      • Withdraw
      • Rewards
    • FastBTC
      • RSK->BTC
    • Bitocracy
      • Staking
      • Governor
      • Fee Sharing
      • Vesting
    • Zero
      • Borrower operations
      • Trove Manager
      • Satability Pool
      • Rewards
    • Mynt & DLLR
      • Basset to Masset Conversion
      • Masset to Basset Conversion
      • MOC Integration Conversion
Powered by GitBook
On this page
  • Mint with ERC20
  • Mint with RBTC
  1. Smart Contracts
  2. Sovryn Protocol
  3. Lending

Mint

Users may provide funds to the lending pool in exchange for iTokens, which represent shares in the pool.

Mint with ERC20

In order to provide funds to the pool, call mint on the respective iToken contract. This will take your deposit and give you iTokens in return. The function retrieves the tokens from the message sender, so make sure to first approve the loan token contract to access your funds.

function mint(address receiver, uint256 depositAmount, bool useLM) external nonpayable nonReentrant globallyNonReentrant 
returns(uint256 minted)

Arguments

Name
Type
Description

receiver

address

the receiver of the tokens

depositAmount

uint256

the amount of underlying tokens provided on the loan. (Not the number of loan tokens to mint).

useLM

bool

if true -> deposit the pool tokens into the Liquidity Mining contract

Returns

The amount of loan tokens minted

Mint with RBTC

In order to provide funds to the RBTC lending pool, call mintWithBTC on the iWRBTC contract. This will take your deposit and give you iWRBTC in return.

function mintWithBTC(address receiver, bool useLM) external payable nonReentrant globallyNonReentrant 
returns(mintAmount uint256)

Arguments

Name
Type
Description

receiver

address

the receiver of the tokens

useLM

bool

if true -> deposit the pool tokens into the Liquidity Mining contract

PreviousLendingNextBurn

Last updated 1 year ago