Functions

A contract which facilitates the exchange of synthetic assets for their underlying

Structs

Account

FieldType

unexchangedBalance

uint256

exchangedBalance

uint256

occupiedTick

uint256

UpdateAccountParams

FieldType

owner

address

unexchangedDelta

int256

exchangedDelta

int256

ExchangeCache

FieldType

totalUnexchanged

uint256

satisfiedTick

uint256

ticksHead

uint256

ExchangeState

FieldType

examineTick

uint256

totalUnexchanged

uint256

satisfiedTick

uint256

distributeAmount

uint256

accumulatedWeight

struct FixedPointMath.Number

maximumWeight

struct FixedPointMath.Number

dustedWeight

struct FixedPointMath.Number

UpdateAccountCache

FieldType

unexchangedBalance

uint256

exchangedBalance

uint256

occupiedTick

uint256

totalUnexchanged

uint256

currentTick

uint256

UpdateAccountState

FieldType

unexchangedBalance

uint256

exchangedBalance

uint256

totalUnexchanged

uint256

Functions

constructor

    function constructor() public;

initialize

    function initialize() external;

_onlyAdmin

    function _onlyAdmin() internal;

setCollateralSource

    function setCollateralSource() external;

setPause

    function setPause() external;

deposit

    function deposit(
        uint256 amount,
        address owner
    ) external;

Deposits tokens to be exchanged into an account.

Parameters:

NameTypeDescription

amount

uint256

The amount of tokens to deposit.

owner

address

The owner of the account to deposit the tokens into.

withdraw

    function withdraw(
        uint256 amount,
        address recipient
    ) external;

Withdraws tokens from the caller's account that were previously deposited to be exchanged.

Parameters:

NameTypeDescription

amount

uint256

The amount of tokens to withdraw.

recipient

address

The address which will receive the withdrawn tokens.

claim

    function claim(
        uint256 amount,
        address recipient
    ) external;

Claims exchanged tokens.

Parameters:

NameTypeDescription

amount

uint256

The amount of tokens to claim.

recipient

address

The address which will receive the claimed tokens.

exchange

    function exchange(uint256 amount) external;

Exchanges amount underlying tokens for amount synthetic tokens staked in the system.

Parameters:

NameTypeDescription

amount

uint256

The amount of tokens to exchange.

getUnexchangedBalance

    function getUnexchangedBalance(address owner) external returns (uint256);

Gets the unexchanged balance of an account.

Parameters:

NameTypeDescription

owner

address

The address of the account owner.

Return Values:

NameTypeDescription

The

uint256

unexchanged balance.

getExchangedBalance

    function getExchangedBalance(address owner) external returns (uint256 exchangedBalance);

Gets the exchanged balance of an account, in units of debtToken.

Parameters:

NameTypeDescription

owner

address

The address of the account owner.

Return Values:

NameTypeDescription

The

uint256

exchanged balance.

getClaimableBalance

    function getClaimableBalance() external returns (uint256 claimableBalance);

_updateAccount

    function _updateAccount(struct TransmuterV2.UpdateAccountParams params) internal;

Updates an account.

Parameters:

NameTypeDescription

params

struct TransmuterV2.UpdateAccountParams

The call parameters.

_onlyWhitelisted

    function _onlyWhitelisted() internal;

Reverts if msg.sender is not in the whitelist. Checks the whitelist for msg.sender.

_normalizeUnderlyingTokensToDebt

    function _normalizeUnderlyingTokensToDebt(uint256 amount) internal returns (uint256);

Normalize amount of underlyingToken to a value which is comparable to units of the debt token.

Parameters:

NameTypeDescription

amount

uint256

The amount of the debt token.

Return Values:

NameTypeDescription

The

uint256

normalized amount.

_normalizeDebtTokensToUnderlying

    function _normalizeDebtTokensToUnderlying(uint256 amount) internal returns (uint256);

Normalize amount of the debt token to a value which is comparable to units of underlyingToken.

This operation will result in truncation of some of the least significant digits of amount. This truncation amount will be the least significant N digits where N is the difference in decimals between the debt token and the underlying token.

Parameters:

NameTypeDescription

amount

uint256

The amount of the debt token.

Return Values:

NameTypeDescription

The

uint256

normalized amount.

_getExchangedBalance

    function _getExchangedBalance() internal returns (uint256 exchangedBalance);

Last updated