Synthetix

Synthetix

new Synthetix(contractSettings)

Source:
Parameters:
Name Type Description
contractSettings ContractSettings

Methods

acceptOwnership(txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
txParams TxParams

addSynth(synth, txParams)

Source:
Only the contract owner may call this., Add an associated Synth contract to the Synthetix system.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
synth String.<EthAddress>
txParams TxParams

allowance(owner, spender)

Source:
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
owner String.<EthAddress>
spender String.<EthAddress>
Returns:
BigNumber

approve(spender, value, txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
spender String.<EthAddress>
value BigNumber
txParams TxParams
Returns:
boolean

availableSynthCount()

Source:
Returns the count of available synths in the system, which you can use to iterate availableSynths.
Call (no gas consumed, doesn't require signer)
Returns:
BigNumber

availableSynths(uint256)

Source:
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
uint256 BigNumber
Returns:
String

balanceOf(account)

Source:
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
account String.<EthAddress>
Returns:
BigNumber

burnSynths(currencyKey, amount, txParams)

Source:
Burn synths to clear issued synths/free SNX.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
currencyKey bytes4
amount BigNumber
txParams TxParams

collateral(account)

Source:
The total SNX owned by this account, both escrowed and unescrowed, against which synths can be issued. This includes those already being used as collateral (locked), and those available for further issuance (unlocked).
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
account String.<EthAddress>
Returns:
BigNumber

collateralisationRatio(issuer)

Source:
The current collateralisation ratio for a user. Collateralisation ratio varies over time as the value of the underlying Synthetix asset changes, e.g. if a user issues their maximum available synths when they hold $10 worth of Synthetix, they will have issued $2 worth of synths. If the value of Synthetix changes, the ratio returned by this function will adjust accordlingly. Users are incentivised to maintain a collateralisation ratio as close to the issuance ratio as possible by altering the amount of fees they're able to claim from the system.
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
issuer String.<EthAddress>
Returns:
BigNumber

debtBalanceOf(issuer, currencyKey)

Source:
If a user issues synths backed by SNX in their wallet, the SNX become locked. This function will tell you how many synths a user has to give back to the system in order to unlock their original debt position. This is priced in whichever synth is passed in as a currency key, e.g. you can price the debt in sUSD, XDR, or any other synth you wish.
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
issuer String.<EthAddress>
currencyKey bytes4
Returns:
BigNumber

decimals()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
Number

effectiveValue(sourceCurrencyKey, sourceAmount, destinationCurrencyKey)

Source:
A function that lets you easily convert an amount in a source currency to an amount in the destination currency.
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
sourceCurrencyKey bytes4
sourceAmount BigNumber
destinationCurrencyKey bytes4
Returns:
BigNumber

escrow()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

exchange(sourceCurrencyKey, sourceAmount, destinationCurrencyKey, destinationAddress, txParams)

Source:
Function that allows you to exchange synths you hold in one flavour for another.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
sourceCurrencyKey bytes4
sourceAmount BigNumber
destinationCurrencyKey bytes4
destinationAddress String.<EthAddress>
txParams TxParams
Returns:
boolean

exchangeRates()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

feePool()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

initiateSelfDestruct(txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
txParams TxParams

initiationTime()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
BigNumber

issueMaxSynths(currencyKey, txParams)

Source:
Issuance is only allowed if the synthetix price isn't stale., Issue the maximum amount of Synths possible against the sender's SNX.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
currencyKey bytes4
txParams TxParams

issueSynths(currencyKey, amount, txParams)

Source:
Issuance is only allowed if the synthetix price isn't stale. Amount should be larger than 0., Issue synths against the sender's SNX.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
currencyKey bytes4
amount BigNumber
txParams TxParams

maxIssuableSynths(issuer, currencyKey)

Source:
The maximum synths an issuer can issue against their total synthetix quantity, priced in XDRs. This ignores any already issued synths, and is purely giving you the maximimum amount the user can issue.
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
issuer String.<EthAddress>
currencyKey bytes4
Returns:
BigNumber

name()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

nominatedOwner()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

nominateNewOwner(_owner, txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
_owner String.<EthAddress>
txParams TxParams

owner()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

proxy()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

remainingIssuableSynths(issuer, currencyKey)

Source:
The remaining synths an issuer can issue against their total synthetix balance.
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
issuer String.<EthAddress>
currencyKey bytes4
Returns:
BigNumber

removeSynth(currencyKey, txParams)

Source:
Only the contract owner may call this., Remove an associated Synth contract from the Synthetix system.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
currencyKey bytes4
txParams TxParams

selfDestruct(txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
txParams TxParams

SELFDESTRUCT_DELAY()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
BigNumber

selfDestructBeneficiary()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

selfDestructInitiated()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
boolean

setEscrow(_escrow, txParams)

Source:
Only the contract owner may call this., Set the associated synthetix escrow contract.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
_escrow String.<EthAddress>
txParams TxParams

setExchangeRates(_exchangeRates, txParams)

Source:
Only callable by the contract owner., Set the ExchangeRates contract address where rates are held.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
_exchangeRates String.<EthAddress>
txParams TxParams

setMessageSender(sender, txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
sender String.<EthAddress>
txParams TxParams

setPreferredCurrency(currencyKey, txParams)

Source:
Set your preferred currency. Note: This does not automatically exchange any balances you've held previously in other synth currencies in this address, it will apply for any new payments you receive at this address.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
currencyKey bytes4
txParams TxParams

setProxy(_proxy, txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
_proxy String.<EthAddress>
txParams TxParams

setSelfDestructBeneficiary(_beneficiary, txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
_beneficiary String.<EthAddress>
txParams TxParams

setSynthetixState(_synthetixState, txParams)

Source:
Only callable by the contract owner., Set the synthetixState contract address where issuance data is held.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
_synthetixState String.<EthAddress>
txParams TxParams

setTokenState(_tokenState, txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
_tokenState String.<EthAddress>
txParams TxParams

symbol()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

synthetixState()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

synthInitiatedExchange(from, sourceCurrencyKey, sourceAmount, destinationCurrencyKey, destinationAddress, txParams)

Source:
Only the synth contract can call this function, Function that allows synth contract to delegate exchanging of a synth that is not the same sourceCurrency.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
from String.<EthAddress>
sourceCurrencyKey bytes4
sourceAmount BigNumber
destinationCurrencyKey bytes4
destinationAddress String.<EthAddress>
txParams TxParams
Returns:
boolean

synthInitiatedFeePayment(from, sourceCurrencyKey, sourceAmount, txParams)

Source:
Only the synth contract can call this function., Function that allows synth contract to delegate sending fee to the fee Pool.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
from String.<EthAddress>
sourceCurrencyKey bytes4
sourceAmount BigNumber
txParams TxParams
Returns:
boolean

synths(bytes4)

Source:
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
bytes4 bytes4
Returns:
String

terminateSelfDestruct(txParams)

Source:
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
txParams TxParams

tokenState()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
String

totalIssuedSynths(currencyKey)

Source:
Total amount of synths issued by the system, priced in currencyKey.
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
currencyKey bytes4
Returns:
BigNumber

totalSupply()

Source:
Call (no gas consumed, doesn't require signer)
Returns:
BigNumber

transfer(to, value, txParams)

Source:
ERC20 transfer function.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
to String.<EthAddress>
value BigNumber
txParams TxParams
Returns:
boolean

transfer(to, value, data, txParams)

Source:
ERC20 transfer function.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
to String.<EthAddress>
value BigNumber
data bytes
txParams TxParams
Returns:
boolean

transferableSynthetix(account)

Source:
When issuing, escrowed SNX are locked first, then non-escrowed SNX are locked last, but escrowed SNX are not transferable, so they are not included in this calculation., The number of SNX that are free to be transferred by an account.
Call (no gas consumed, doesn't require signer)
Parameters:
Name Type Description
account String.<EthAddress>
Returns:
BigNumber

transferFrom(from, to, value, data, txParams)

Source:
ERC20 transferFrom function.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
from String.<EthAddress>
to String.<EthAddress>
value BigNumber
data bytes
txParams TxParams
Returns:
boolean

transferFrom(from, to, value, txParams)

Source:
ERC20 transferFrom function.
Transaction (consumes gas, requires signer)
Parameters:
Name Type Description
from String.<EthAddress>
to String.<EthAddress>
value BigNumber
txParams TxParams
Returns:
boolean