The following APIs are implemented by peers on the network to make and take liquidity.
Orders are priced and executable swaps that specify all parties of a trade.
Given a signerAmount
, senderWallet
, and token pair, return a complete order. The senderAmount
value is the amount the taker would send. The taker is buying from you.
getSenderSideOrder(signerAmount: string,signerToken: string,senderToken: string,senderWallet: string,swapContract: string,proxyingFor: string,)
Param | Type | Description |
|
| Amount of ERC-20 the signer would transfer. |
|
| Token the signer would transfer. |
|
| Token the sender would transfer. |
|
| Wallet of the sender. |
|
| Swap contract intended for use. |
|
|
|
Depending on the swapContract
, a successful getSenderSideOrder
returns a signed Order or a Light Order that includes the requested senderAmount
.
Given a senderAmount
, senderWallet
, and token pair, return a complete order. The signerAmount
value is the amount you would send. The taker is selling to you.
getSignerSideOrder(senderAmount: string,signerToken: string,senderToken: string,senderWallet: string,swapContract: string,proxyingFor: string,)
Param | Type | Description |
|
| Amount of ERC-20 the sender would transfer. |
|
| Token the signer would transfer. |
|
| Token the sender would transfer. |
|
| Wallet of the sender. |
|
| Swap contract intended for use. |
|
|
|
Depending on the value set as swapContract
a successful getSignerSideOrder
returns a signed Order or a Light Order including the requested signerAmount
.
Quotes indicate prices at which a peer is interested in trading.
Given a token pair, return a quote object with the maximum amounts a maker is willing to trade.
getMaxQuote(signerToken: string,senderToken: string): Quote
Param | Type | Description |
|
| The token the sender would transfer. |
|
| The token the signer would transfer. |
A successful getMaxQuote
returns a Quote object.
Given a signerAmount
and token pair, return a complete quote. The senderAmount
value is the amount the taker would send. The taker is buying from the maker.
getSenderSideQuote(signerAmount: string,signerToken: string,senderToken: string): Quote
Param | Type | Description |
|
| Amount of ERC-20 the signer would transfer. |
|
| Token the sender would transfer. |
|
| Token the signer would transfer. |
A successful getSenderSideQuote
returns a Quote object including the requested senderAmount
.
Given a senderAmount
and token pair, return a complete quote. The signerAmount
value is the amount the maker would send. The taker is selling to the maker.
getSignerSideQuote(senderAmount: string,senderToken: string,signerToken: string): Quote
Param | Type | Description |
|
| Amount of ERC-20 the sender would transfer. |
|
| Token the sender would transfer. |
|
| Token the signer would transfer. |
A successful getSignerSideQuote
returns a Quote object including the requested signerAmount
Last look is to say that, after having emitted an indicative quote, a maker may accept or decline an order provided to it by a taker. Quotes are primarily served through the Quote
API, but other methods to disseminate pricing information may exist, for example SetRule
events on Delegate
contracts.
Given an Order, assess its price, and conditionally perform a swap.
provideOrder((order: Order))
Param | Type | Description |
|
| Order to swap. |