Data structure in our centralized system
This page explains the data structure of ParaSwap's centralized service handling limit orders. It's adding some features like:
tracking maker
balance
andallowance
for ERC20 tokens.tracking state of orders
Fulfillment.
Cancellation.
Expiration.
Partially fulfillment.
For more information, please refer to the following document:
On chain Data StructureERC20: Order structure
Difference with on-chain limit order
nonceAndMeta
: In our centralized system we force nonce and meta to be constructed from an address plus a random integer between0
and2 ^ 53 - 1
shifted 160 bits. The address that we pack is the actual taker address. (The address that swaptakerAsset
tomaketAsset
)
takerFromMeta
: is the decoded taker fromnonceAndMeta
. In Augustus contract we check the actualtakerAddress
(The address who swaptakerAsset
tomakerAsset
) by extracting its value fromnonceAndMeta
.fillableBalance
: is the amount that remains to be filled and can be used to check if the amount is partially filled. (fillableBalance
≠makeAmount
)swappableBalance
: is the actual amount that can be filled at this time.makerBalance
: max amountmakerAddress
can fill the limit order.orderHash
: hash of the on-chain Data structure.permitMakerAsset: always null for now will be used to store permit.
type
:P2P
/LIMIT
differentiatep2p
from normal ordersP2P
: hastakerFromMeta
set to some specific address.LIMIT
: hastakerFromMeta
set to0x....0
.
state
:PENDING
/FULFILLED
/EXPIRED
/CANCELLED
.PENDING
: order is still usable.FULFILLED
: order is fully fulfilled.EXPIRED
: order is expired.CANCELLED
: order is canceled.
NFT ERC 20/721/1155 Order structure
Difference with on-chain NFT order
makerAsset
: is the decoded address of themakerAsset
from our limit order contract.makerAssetId
: is the decoded token type from themakerAsset
from our limit order contract.takerAsset
: is the decoded address of themakerAsset
from our limit order contract.takerAssetId
: is the decoded token type from thetakerAsset
from our limit order contract.takerFromMeta
: is the decoded taker fromnonceAndMeta
. In Augustus contract we check the actualtakerAddress
(The address who swaptakerAsset
tomakerAsset
) by extracting its value fromnonceAndMeta
.fillableBalance
: is the amount that remains to be filled and can be used to check if the amount is partially filled. (fillableBalance
≠makeAmount
)orderHash
: hash of the on-chain Data structure.permitMakerAsset: always null for now will be used to store permit.
type
:P2P
/LIMIT
differentiatep2p
from normal ordersP2P
: hastakerFromMeta
set to some specific address.LIMIT
: hastakerFromMeta
set to0x....0
.
state
:PENDING
/FULFILLED
/EXPIRED
/CANCELLED
.PENDING
: order is still usable.FULFILLED
: order is fully fulfilled.EXPIRED
: order is expired.CANCELLED
: order is canceled.
Last updated