Poseidon Signature Guide
Poseidon Hashing
Construct Order Data
Below is an example of how you can structure the order data, including all relevant details:
{
"vesselPublicKey": "0xYourVesselPublicKey",
"takerFeeRate": 2000,
"makerFeeRate": 2000,
"timestamp": 1644568800000,
"clientOrderId": "uniqueOrderIdentifier",
"buyAssetId": 4,
"sellAssetId": 1,
"buyAssetAmount": 18000000000,
"sellAssetAmount": 64800000000000000000
}
Construct AMM Data
{
"vesselPublicKey": "0xYourVesselPublicKey",
"takerFeeRate": 2000,
"makerFeeRate": 2000,
"timestamp": 1644568800000,
"clientOrderId": "uniqueOrderIdentifier",
"buyAssetId": 4,
"sellAssetId": 1,
"buyAssetAmount": 18000000000,
"sellAssetAmount": 64800000000000000000
}
Poseidon Calculation
For Placing Order
1.
2.
3.
4.
For Adding Liquidity
For Removing Liquidity
For Collecting Fee
ECDSA Signature
JavaScript Example
Generate Order Signature Script Code
Generate AMM Signature Script Code