Stablecoinswap API

Contract is written in Vyper (0.1.0b9)

addLiquidity

Adding liquidity is free. However, removing liquidity bears the same fee as the swap operation. This is to prevent users from bypassing the trading fee by depositing liquidity in one token and instantly withdrawing it in another token.

def addLiquidity(
    token_address: address, 
    erc20_token_amount: uint256, 
    deadline: timestamp
) -> bool

removeLiquidity

def removeLiquidity(
    token_address: address, 
    stableswap_token_amount: uint256, 
    erc20_min_output_amount: uint256, 
    deadline: timestamp
) -> bool

swapTokens

def swapTokens(
    input_token: address,
    output_token: address, 
    erc20_input_amount: uint256, 
    erc20_min_output_amount: uint256, 
    deadline: timestamp
) -> bool

tokenExchangeRateAfterFees

@constant
def tokenExchangeRateAfterFees(
    input_token_address: address, 
    output_token_address: address
) -> uint256

tokenOutputAmountAfterFees

@constant
def tokenOutputAmountAfterFees(
    input_token_amount: uint256, 
    input_token_address: address, 
    output_token_address: address
) -> uint256

poolOwnership

@constant
def poolOwnership(user_address: address) -> decimal

fees

@constant
def fees(fee_name: string[32]) -> decimal

inputTokens

inputTokens: public(map(address, bool))

outputTokens

outputTokens: public(map(address, bool))

priceOracleAddress

priceOracleAddress: public(address)

Last updated