LogoLogo
Swivel v4.0.0
Swivel v4.0.0
  • Litepaper
    • Principal Tokens (PTs)
      • Exiting/Selling PTs
      • Secondary AMM's
    • Yield Tokens (YTs)
      • Exiting/Selling YTs
    • AMM vs. Orderbook
  • Swivel Safety Module (SSM)
    • Staking
    • Withdrawing
  • Swivel Exchange
    • Exchange Functions
      • Simple Fixed Yield Lending
      • Professional Fixed-Yield Lending
      • Purchasing YTs
      • Selling PTs
      • Selling YTs
      • Splitting/Combining Tokens
      • Redeeming Tokens/Interest
    • Maturity
    • Liquidity Incentives
    • Minimums, Rate Limits & Fees
    • Retroactive Distribution
    • How to Claim SWIV Tokens
  • Developers
    • Exchange API
      • GET
        • Get Markets
        • Orderbook
        • Get Order
        • OHCLV (Candles)
        • Get Effective Price (Preview Market Order)
        • Get Order History
        • Get Last Trade Info
      • POST
        • Order
    • Swivel.js
      • API
        • Swivel
        • MarketPlace
        • VaultTracker
    • Swivel.py
      • swivel
        • swivel.abstracts
          • swivel.abstracts.deployed
          • swivel.abstracts.market_place
          • swivel.abstracts.swivel
          • swivel.abstracts.vault_tracker
        • swivel.contracts
          • swivel.contracts.market_place
          • swivel.contracts.swivel
          • swivel.contracts.vault_tracker
        • swivel.vendors
          • swivel.vendors.signer
          • swivel.vendors.w3
    • Scrivel (Python Examples)
    • Contracts Overview
      • Contracts
        • Swivel
        • MarketPlace
        • VaultTracker
        • Creator
    • Ubiquitous Language V4
      • Shared Language
      • UI Language
      • Technical Language
      • Compound Language
      • Finance Terms
  • Community & Media
  • Incentives
  • Other Resources
    • Institutions
      • Rate Profile Optimization
        • Instruments and Participants
        • Market Opportunities and Pricing
        • Counterparty Risk Management
        • Benefits and drawbacks of standardization
        • User Needs
          • Corporate Treasury and Funding
          • Institutional Investors and Asset Managers
          • Speculators and Proprietary Trading Functions
          • Brokers and Market Makers
          • Liquidity Management, Funding and Resource Management
          • Risk Management and Insurance
          • Smaller Institutions and Individuals
      • Swivel for Enterprise
        • Overview
        • How Swivel works
        • Flexible Order Book
        • Future Developments
      • Delegated Credit
        • Challenges of Delegated Credit
          • Credit Pools
          • Intermediating Trust in Credit Delegation
Powered by GitBook
On this page
  • VaultTracker
  • Contents
  • Globals
  • Modifiers
  • Functions
  1. Developers
  2. Contracts Overview
  3. Contracts

VaultTracker

Annotated source code of the VaultTracker.sol smart contract

VaultTracker

Contents

Globals

Note this list contains both internal and external attributes

Var
Type

vaults

mapping(address => struct VaultTracker.Vault)

cTokenAddr

address

marketPlace

address

swivel

address

maturity

uint256

maturityRate

uint256

protocol

uint8

Modifiers

authorized

Restricts msg.sender as the only viable caller of a method

Declaration

modifier authorized

Functions

constructor

Declaration

function constructor(
uint8 m,
uint256 c,
address s,
address mp
) public

Modifiers:

No modifiers

Args:

Arg
Type
Description

m

uint8

Maturity timestamp associated with this vault

c

uint256

Compounding Token address associated with this vault

s

address

Address of the deployed swivel contract

mp

address

Address of the designated admin, which is the Marketplace addess stored by the Creator contract

addNotional

Adds notional to a given address

Declaration

function addNotional(
address o,
uint256 a
) external authorized returns
(bool)

Modifiers:

Modifier

authorized

Args:

Arg
Type
Description

o

address

Address that owns a vault

a

uint256

Amount of notional added

removeNotional

Removes notional from a given address

Declaration

function removeNotional(
address o,
uint256 a
) external authorized returns
(bool)

Modifiers:

Modifier

authorized

Args:

Arg
Type
Description

o

address

Address that owns a vault

a

uint256

Amount of notional to remove

redeemInterest

Redeem's interest accrued by a given address

Declaration

function redeemInterest(
address o
) external authorized returns
(uint256)

Modifiers:

Modifier

authorized

Args:

Arg
Type
Description

o

address

Address that owns a vault

matureVault

Matures the vault

Declaration

function matureVault(
uint256 c
) external authorized returns
(bool)

Modifiers:

Modifier

authorized

Args:

Arg
Type
Description

c

uint256

The current cToken exchange rate

transferNotionalFrom

Transfers notional from one address to another

Declaration

function transferNotionalFrom(
address f,
address t,
uint256 a
) external authorized returns
(bool)

Modifiers:

Modifier

authorized

Args:

Arg
Type
Description

f

address

Owner of the amount

t

address

Recipient of the amount

a

uint256

Amount to transfer

transferNotionalFee

Transfers, in notional, a fee payment to the Swivel contract without recalculating marginal interest for the owner

Declaration

function transferNotionalFee(
address f,
uint256 a
) external authorized returns
(bool)

Modifiers:

Modifier

authorized

Args:

Arg
Type
Description

f

address

Owner of the amount

a

uint256

Amount to transfer

rates

Return both the current maturityRate if it's > 0 (or exchangeRate in its place) and the Compounding exchange rate

While it may seem unnecessarily redundant to return the exchangeRate twice, it prevents many kludges that would otherwise be necessary to guard it

Declaration

function rates(
) public returns
(uint256, uint256)

Modifiers:

No modifiers

Returns:

Type
Description

exchangeRate

if maturityRate > 0, exchangeRate, exchangeRate if not.

balancesOf

Returns both relevant balances for a given user's vault

Declaration

function balancesOf(
address o
) external returns
(uint256, uint256)

Modifiers:

No modifiers

Args:

Arg
Type
Description

o

address

Address that owns a vault

PreviousMarketPlaceNextCreator