LogoLogo
Block ExplorerDiscordTwitterMirror
  • What Is Canto?
  • Free Public Infrastructure
    • NOTE
    • Canto Lending Market
    • Canto DEX
  • Canto Neofinance
    • Overview
    • Application Specific Dollar
  • User Guides
    • Connecting to Canto
    • Bridging Assets
      • Bridging to Canto
      • Bridging from Canto
      • Synapse Bridge
      • Celer cBridge
    • Providing Liquidity
    • Lending & Borrowing
    • Staking
    • Governance
  • EVM Development
    • Overview
    • Quickstart Guide
    • NOTE, DEX, and Lending Market
    • Contract Secured Revenue (CSR)
    • Verifying Contracts
    • Contract Addresses
    • Testnet
  • Running a Node
    • Validators
      • Quickstart Guide
      • Useful Commands
      • Snapshots
      • FAQ
      • Troubleshooting
      • Uptime
      • Slashing
    • Archive Node
    • Graph Node (Subgraphs)
  • Technical Reference
    • Application Specific Dollar
      • asdOFT
      • asdRouter
      • asdUSDC
    • Liquidity Coordinator
      • VotingEscrow
      • GaugeController
      • LendingLedger
      • LiquidityGauge
    • Architecture & Design
      • Onboarding Module
      • Gravity Bridge
      • NOTE Design
      • Canto Lending Protocol
      • IBC Token Recovery
    • Governance
      • Governance Module
      • GovShuttle Module
      • Lending Market Governance
    • Tokenomics
    • Audits
Powered by GitBook
On this page
  • NOTE
  • Canto DEX
  • Canto Lending Market
  1. EVM Development

NOTE, DEX, and Lending Market

PreviousQuickstart GuideNextContract Secured Revenue (CSR)

Last updated 1 year ago

When building DApps, you may wish to leverage Canto's Free Public Infrastructure, such as its native unit of account, DEX, or lending market. This page provides an overview of how these primitives are designed and how you can interact with them.

For mainnet and testnet deployment addresses, refer to the Contract Addresses page:

NOTE

must be borrowed from the Accountant via the Canto Lending Market. The amount of NOTE circulating at any given time (including NOTE that users have supplied back to the Canto Lending Market) is equal to the sum of all NOTE and cNOTE not held by the Accountant.

The NOTE smart contract may be modified and redeployed at a new address in the future. For this reason, DApps should use the CToken.underlying() view on the contract to determine the address for NOTE instead of hardcoding it.

Canto DEX

The Canto DEX is built around three contracts: , , and . Each liquidity pool is represented by a unique BaseV1Pair contract generated by the BaseV1Factory.

For most use cases, BaseV1Router01 offers sufficient functionality. Key methods include:

Method
Description

pairFor

Calculates the address for a pair

isPair

Checks if an address is a valid pair

getReserves

Fetches and sorts the reserves for a pair

getAmountOut

Calculates amount out for a specified pair

addLiquidity

Adds liquidity to a pair

removeLiquidity

Removes liquidity from a pair

swapExactTokensforTokensSimple

Swaps one token for another directly

swapExactTokensforTokens

Swaps one token for another using a specified route

getUnderlyingPrice

Gets underlying asset price as a mantissa

Canto Lending Market

Key methods on CToken contracts include:

Method
Description

mint

Deposits a token and mints the corresponding CToken

redeem

Redeems a specified amount of CToken tokens for the underlying token

redeemUnderlying

Redeems CToken tokens for a specified amount of the underlying token

borrow

Borrows the underlying token

repayBorrow

Repays a borrow of the underlying token

For CANTO-specific and other methods, refer to the .

The Canto Lending Market is an adaptation of . Its functional design is unchanged in that the primary means of interacting with the lending market is the , an ERC20 representation of a supplied asset.

For more information on the Canto Lending Market's design, see the .

Contract Addresses
NOTE
cNOTE
BaseV1Factory
BaseV1Pair
BaseV1Router01
contract source code
Compound v2
CToken
Compound v2 docs