FxEscrow) has a set of interfaces you can use to
execute trades either as a maker or a taker. This page describes the user-facing
methods of the StableFX contract.
Contract address
TheFxEscrow contract is deployed at
0x1f91886C7028986aD885ffCee0e40b75C9cd5aC1
on the Arc testnet.
Interfaces
recordTrade
Records a trade agreement onchain. Returns the contract ID of the trade.
| Name | Type | Description |
|---|---|---|
taker | address | The address of the taker |
takerDetails | TakerDetails | The details of the taker |
takerSignature | bytes | The signature of the taker |
maker | address | The address of the maker |
makerDetails | MakerDetails | The details of the maker |
makerSignature | bytes | The signature of the maker |
| Name | Type | Description |
|---|---|---|
id | uint256 | The contract ID of the trade |
takerDeliver
Delivers quote currency for a single trade using Permit2 on the taker side.
| Name | Type | Description |
|---|---|---|
id | uint256 | The ID of the trade |
permit | IPermit2.PermitTransferFrom | The Permit2-compliant transfer permit |
signature | bytes | The signature for the transfer permit |
takerBatchDeliver
Delivers quote currency for multiple trades using Permit2 on the taker side.
| Name | Type | Description |
|---|---|---|
ids | uint256[] | An array of trade IDs |
permit | IPermit2.PermitBatchTransferFrom | The Permit2-compliant batch transfer permit |
signature | bytes | The signature for the batch permit |
makerDeliver
Delivers base currency for a single trade using Permit2 on the maker side.
| Name | Type | Description |
|---|---|---|
id | uint256 | The ID of the trade |
permit | IPermit2.PermitTransferFrom | The Permit2-compliant transfer permit |
signature | bytes | The signature for the transfer permit |
makerBatchDeliver
Delivers quote currency for multiple trades using Permit2 on the maker side.
| Name | Type | Description |
|---|---|---|
ids | uint256[] | An array of trade IDs |
permit | IPermit2.PermitBatchTransferFrom | The Permit2-compliant batch transfer permit |
signature | bytes | The signature for the batch permit |
makerNetDeliver
Net settlement for multiple trades on the maker side.
| Name | Type | Description |
|---|---|---|
ids | uint256[] | An array of trade IDs |
permit | IPermit2.PermitBatchTransferFrom | The Permit2-compliant batch transfer permit |
signature | bytes | The signature for the batch permit |
breach
Marks a trade as breached after maturity.
| Name | Type | Description |
|---|---|---|
id | uint256 | The ID of the trade |
breach (batch)
Marks multiple trades as breached after maturity.
| Name | Type | Description |
|---|---|---|
ids | uint256[] | An array of trade IDs |
calculateMakerNet
Calculate maker net token positions for batch operations. Returns an array of
Balance structs representing net positions.
| Name | Type | Description |
|---|---|---|
maker | address | The address of the maker |
ids | uint256[] | An array of trade IDs |
| Name | Type | Description |
|---|---|---|
balances | Balance[] | An array of Balance structs representing net positions |