Delegate
Delegate is a contract that allows users to set on-chain trading rules that accept and execute AirSwap orders that meet price criteria. In terms of the underlying SwapERC20 protocol, a trader setting rules is authorizing the Delegate to act as sender
on its behalf. The trader interfacing with the delegate is the signer
of each order. Delegate acts as an on-chain intermediary for cases where a Trader does not have an immediate counterparty or wishes to make an order publicly available.
See the deployments page for latest deployed Delegate contract addresses.
Rules
To enable Delegate call the setRule
function. Token approvals must be set up by senderWallet
on the senderToken
to allow Delegate to act as a spender.
Rules can be be updated using setRule
again or canceled using unsetRule
.
Swaps
As a counterparty, query logs or subscribe to SetRule
and UnsetRule
events for pricing information. With price in hand, create and sign an order at any time and then call swap
on the Delegate contract. Upon success, Delegate emits a DelegateSwap
event.
Delegate uses SwapERC20 swapLight
behind the scenes to complete the swap.
Last updated