Saffron Pool v2

Introduction

Saffron Pool V2

Miscellaneous State Variables

TypeVisibilityNameDescription

address

public

governance

Governance address

address

public

new_governance

Pending governance address if accepted

bool

public

deposits_disabled

Deposit enabled switch (true=disabled; false=allowed)

bool

public

shut_down

Pool shutdown switch (true=shutdown; false=online)

IERC20

public

base_asset

Base asset token address

address

public

adapter

Saffron Adapter contract address

address

public

fee_manager

Fee manager contract address

string

public

pool_name

Pool name (for frontends)

uint256

public

senior_token_supply

Senior tranche SaffronPositionToken totalSupply

uint256

public

senior_exchange_rate

Exchange rate from senior tranche tokens to base assets

uint256

public

fee_holdings

Fee yield receiver balance

SaffronPositionToken

public

position_token

User holdings SaffronPositionToken (ERC20)

SaffronPositionNFT

public

NFT

User holdings SaffronPositionNFT (Insurance Fund NFT)

Constructor

constructor(address _adapter, address _base_asset, string memory name, string memory symbol, string memory _pool_name)
TypeNameDescription

address

_adapter

Address of Saffron Adapter to interface with underlying platform

address

_base_asset

Address of Base Asset token to be managed

string

name

Symbol of provided LP token

string

symbol

Name of provided LP token

string

_pool_name

Name of the pool

deposit()

Deposit base assets to the pool

function deposit(uint256 amount) external nonReentrant
TypeNameDescription

uint256

amount

Amount (wei) of Insurance Assets to be deposited

withdraw()

Withdraw capital from the pool by burning SAFF-LP tokens

function withdraw(uint256 lp_amount) external nonReentrant
TypeNameDescription

uint256

lp_amount

Amount (wei) of Insurance Assets to be deposited

begin_unfreeze_NFT()

Begin to unfreeze an NFT so it may be withdrawn

function begin_unfreeze_NFT(uint256 token_id) external
TypeNameDescription

uint256

token_id

Position NFT ID to be unfrozen

update_exchange_rate()

Updates senior exchange rate based on current Auto Compounded earnings, if any. Also update the total supply for each tranche

function update_exchange_rate() public non_reentrant_update

get_latest_pool_holdings()

Updates senior exchange rate based on current Auto Compounded earnings, if any. Also update the total supply for each tranche

function get_latest_pool_holdings() internal returns (uint256)

get_update_exchange_rate_vars()

Get internal state variables

function get_update_exchange_rate_vars() internal returns (UpdateExchangeRateVars memory uv)

get_yield_receiver_supply()

Get the calculated base asset holdings of all yield receivers by multiplying their token supplies by their exchange rates

function get_yield_receiver_supply() public view returns (uint256)

set_exchange_rate()

Set values for yield receivers for waterfall mode (only valid while pool is in a shut-down state)

function set_exchange_rate(uint256 yield_receiver, uint256 value) external
TypeNameDescription

uint256

yield_receiver

Yield receiver to be updated ( =0 senior tranche; !=0 fees)

uint256

value

New exchange rate for specified yield receiver

set_fee_manager()

Set fee manager (usually insurance fund)

function set_fee_manager(address to) external
TypeNameDescription

address

to

Address of fee manager

withdraw_fees()

Withdraw protocol fees

function withdraw_fees(address to) external nonReentrant
TypeNameDescription

address

_pool

Address of new pool

shut_down_pool()

Set the shut-down state of the pool

function shut_down_pool(bool _shut_down) external
TypeNameDescription

bool

_shut_down

true shut-down; false not shut-down

disable_deposits()

Disable deposits (waterfall mode)

function disable_deposits(bool _deposits_disabled) external
TypeNameDescription

bool

_deposits_disabled

true disable deposits; false allow deposits

propose_governance()

Propose transfer of governance to new address

function propose_governance(address to) external override
TypeNameDescription

address

to

Address of proposed new governance

accept_governance()

Accept the role of governance (must be called by previously proposed candidate)

function accept_governance() external override

set_adapter()

Set a new Saffron Adapter to interface with underlying platform

function set_adapter(address to) external
TypeNameDescription

address

_adapter

Address of Saffron Adapter to interface with underlying platform

sweep_erc()

Transfer LP assets to Mojito Staking

function sweep_erc(address _token, address _to) external
TypeNameDescription

address

amount_qlp

Amount (wei) of LP Assets to be staked in Mojito

address

to

Address to receive swept assets

Last updated