Welcome to Echelon! This doc will give a high level understanding of how to integrate with our Echelon Testnet Environment. This document will provide method documentation for Echelon, with addresses supplied here.
public fun supply<CoinType>(
account: &signer,
market_obj: Object<Market>,
asset: Coin<CoinType>
)
Supplies a specific amount of CoinType
to the market, which is credited to the lender’s account in exchange for interest-bearing tokens.
public fun withdraw<CoinType>(
account: &signer,
market_obj: Object<Market>,
shares_to_withdraw: u64
): Coin<CoinType>
Withdraws a specific amount of coins (CoinType
) from the market by redeeming a specified amount of interest-bearing tokens.
public fun borrow<CoinType>(
account: &signer,
market_obj: Object<Market>,
amount: u64
): Coin<CoinType>
Allows a user to borrow a specific amount of CoinType
from the market.
public fun repay<CoinType>(
borrower: &signer,
market_obj: Object<Market>,
asset: Coin<CoinType>
)
Repays the borrowed amount along with the accrued interest back to the market.
public fun supply_fa(
account: &signer,
market_obj: Object<Market>,
asset: FungibleAsset
)
Supplies a specific amount of fungible assets to the market in exchange for interest-bearing tokens.