The Trade Module is a module that enables SetTokens to perform atomic trades using DEXs such as Uniswap, Sushiswap and 1inch. Integrations mappings are stored on the IntegrationRegistry contract.
function trade(ISetToken _setToken, string memory _exchangeName, address _sendToken, uint256 _sendQuantity, address _receiveToken, uint256 _minReceiveQuantity, bytes memory _data)
Manager only. Executes a trade on a supported DEX. Only callable by the SetToken's manager. Although the SetToken units are passed in for the send and receive quantities, the total quantity sent and received is the quantity of SetToken units multiplied by the SetToken totalSupply.
Instance of the SetToken
Human readable name of the exchange in the integrations registry
Address of the token to be sent to the exchange
Units of token in SetToken sent to the exchange
Address of the token that will be received from the exchange
Min units of token in SetToken to be received from the exchange
Arbitrary bytes to be used to construct trade call data
function initialize(ISetToken _setToken)
Manager only. Initializes this module to the SetToken.
Address of the SetToken