Satay Finance
  • Overview
    • Introduction
  • Our Three Pillars
    • Blocks
    • Strategies
    • Vaults
  • Technical Overview
    • Protocol Module
    • Wrapper Module (Legacy)
    • Asset Module
    • Vault Module
    • Base Strategy Module
    • Satay Module
  • Blocks
    • Echelon Block
    • Layerbank Block
    • MovePosition Block
  • Strategy Implementations
    • Leveraged Liquid Staking
    • Liquid Staking + LP Farming
    • Borrow Optimization
    • Echelon Simple
    • Layerbank Simple
    • MovePosition Simple
    • MovePosition Ticket
Powered by GitBook
On this page
  • Overview
  • Constants
  • Public Functions
  • Market Operations
  • Account Information
  • Reward Operations
  1. Blocks

Echelon Block

PreviousSatay ModuleNextLayerbank Block

Last updated 3 months ago

Overview

The echelon_block::echelon_block module contains the block implementation for Echelon. Modules in the blocks package are modules that contain convenience functions that interface with an underlying protocol(e.g. echelon, moveposition, etc). These block functions are used by to interact with an underlying protocol, instead of interacting with it directly.

Constants

  • SUPPLY_MARKET_TYPE: u64 = 200 - Type identifier for supply market operations

  • BORROW_MARKET_TYPE: u64 = 201 - Type identifier for borrow market operations

Public Functions

Market Operations

  • supply<CoinType>(account: &signer, market: Object<Market>, coin: Coin<CoinType>): Supplies coins to the specified market.

  • supply_fa(account: &signer, market: Object<Market>, asset: FungibleAsset): Supplies fungible assets to the specified market.

  • borrow<CoinType>(account: &signer, market: Object<Market>, amount: u64): Coin<CoinType>: Borrows coins from the specified market.

  • withdraw<CoinType>(account: &signer, market: Object<Market>, shares: u64): Coin<CoinType>: Withdraws coins from the specified market based on shares.

  • withdraw_fa(account: &signer, market: Object<Market>, shares: u64): FungibleAsset: Withdraws fungible assets from the specified market based on shares.

Account Information

  • account_coins(account: address, market: Object<Market>): u64: Returns the number of coins an account has in a market.

  • account_shares(account: address, market: Object<Market>): u64: Returns the number of shares an account has in a market.

  • amount_borrowable<CoinType>(account: address, market: Object<Market>): u64: Returns the amount of coins an account can borrow from a market.

  • amount_withdrawable<CoinType>(account: address, market: Object<Market>): u64: Returns the amount of coins an account can withdraw from a market.

  • coins_to_shares(market: Object<Market>, coins: u64): u64: Converts coin amount to share amount for a given market.

Reward Operations

  • get_supply_reward<CoinType>(account: address, market: address): u64: Returns the claimable supply reward amount for a specific coin type.

  • get_supply_reward_fa(account: address, market: address, metadata: Object<Metadata>): u64: Returns the claimable supply reward amount for a fungible asset.

  • get_borrow_reward<CoinType>(account: address, market: address): u64: Returns the claimable borrow reward amount for a specific coin type.

  • get_borrow_reward_fa(account: address, market: address, metadata: Object<Metadata>): u64: Returns the claimable borrow reward amount for a fungible asset.

  • claim_supply_reward<CoinType>(account: &signer, market: address): Coin<CoinType>: Claims supply rewards for a specific coin type.

  • claim_supply_reward_fa(account: &signer, metadata: Object<Metadata>, market: address): FungibleAsset: Claims supply rewards for a fungible asset.

concrete strategy implementations