Skip to content

Exchanger

Work In Progress

Ongoing...

Description

Performs all the heavy lifting internally of exchange and settle functionality.

Source: Exchanger.sol

Architecture


Inheritance Graph

Exchanger inheritance graph


Exchanger architture graph


Constants



Variables



Constructor



Views


feeRateForExchange

Determine the effective fee rate for the exchange, taking into considering swing trading.

Details

Signature

feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) public view returns (uint)


maxSecsLeftInWaitingPeriod

Returns the maximum number of seconds remaining in the waiting period for all exchanges into the given synth (currencyKey) by the account.

This number must be 0 in order for settle() to succeed.

Details

Signature

maxSecsLeftInWaitingPeriod(address account, bytes32 currencyKey) public view returns (uint)

settlementOwing

Returns the total amount to be reclaimed or rebated for the given account and synth (currencyKey). Note: this function can be called at any time, even while the waiting period has not expired.

Details

Signature

settlementOwing(address account, bytes32 currencyKey) public view returns (uint reclaimAmount, uint rebateAmount)


Mutative Functions


settle

Settle processes all exchanges into the given synth, calculating any reclaimed or refunded amounts via settlementOwing and burning any reclaim and issuing any refund. This function may be called by anyone - the msg.sender is irrelevant.

Details

Signature

settle(address from, bytes32 currencyKey) external returns (uint reclaimed, uint refunded)

Preconditions


Owner Functions



Internal & Restricted Functions


Modifiers



Events