Owner
: the address of the LP that owns the SCEA.
Initiator
: the address used by the platform for transaction initiation.
Mediator
: the address used by the platform for transaction mediation.
Escrow
: this is a 3-dimensional mapping that holds the record of assets currently locked in the SCEA and unavailable for spending. It is organized by token to make lookup faster.
Tokens
to OrderTypes
(BUY
or SELL
), which are represented by integers.
OrderType
, maps either client addresses or order IDs to the locked value. For transactions via non-custodial wallets, the ClientOrderKey
is a base 64 address.
When integrated with third-party custodial exchanges, the exchangeโs liquidity address might be shared by multiple users. In this case, the OrderID
integer uniquely distinguishes Sell transactions initiated by each user from the third-party exchange.
LockBalance
: this tracks the total balance locked per token. Though this value can be computed on-the-fly by looping through the data in the Escrow, it can lead to the rapid accumulation of gas spent. This property can be incremented each time funds are locked, and decremented when funds are unlocked.