Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | support@geniusyield.co |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
GeniusYield.Api.Dex.PartialOrder
Description
Synopsis
- data PORefs = PORefs {}
- data PartialOrderInfo = PartialOrderInfo {
- poiRef ∷ !GYTxOutRef
- poiOwnerKey ∷ !GYPubKeyHash
- poiOwnerAddr ∷ !GYAddress
- poiOfferedAsset ∷ !GYAssetClass
- poiOfferedOriginalAmount ∷ !Natural
- poiOfferedAmount ∷ !Natural
- poiAskedAsset ∷ !GYAssetClass
- poiPrice ∷ !GYRational
- poiNFT ∷ !GYTokenName
- poiStart ∷ !(Maybe GYTime)
- poiEnd ∷ !(Maybe GYTime)
- poiPartialFills ∷ !Natural
- poiMakerLovelaceFlatFee ∷ !Natural
- poiTakerLovelaceFlatFee ∷ !Natural
- poiContainedFee ∷ !POIContainedFee
- poiContainedPayment ∷ !Natural
- poiUTxOValue ∷ !GYValue
- poiUTxOAddr ∷ !GYAddress
- poiNFTCS ∷ !GYMintingPolicyId
- data POIContainedFee = POIContainedFee {}
- partialOrderInfoToIn ∷ HasDexScripts a ⇒ a → PORefs → PartialOrderInfo → PartialOrderAction → GYTxIn 'PlutusV2
- partialOrderInfoToPayment ∷ PartialOrderInfo → GYValue → GYTxOut 'PlutusV2
- partialOrderInfoToPartialOrderDatum ∷ PartialOrderInfo → PartialOrderDatum
- poiGetContainedFeeValue ∷ PartialOrderInfo → GYValue
- expectedPaymentWithDeposit ∷ PartialOrderInfo → Bool → GYValue
- data PartialOrderAction
- data PartialOrderDatum = PartialOrderDatum {
- podOwnerKey ∷ PubKeyHash
- podOwnerAddr ∷ Address
- podOfferedAsset ∷ AssetClass
- podOfferedOriginalAmount ∷ Integer
- podOfferedAmount ∷ Integer
- podAskedAsset ∷ AssetClass
- podPrice ∷ Rational
- podNFT ∷ TokenName
- podStart ∷ Maybe POSIXTime
- podEnd ∷ Maybe POSIXTime
- podPartialFills ∷ Integer
- podMakerLovelaceFlatFee ∷ Integer
- podTakerLovelaceFlatFee ∷ Integer
- podContainedFee ∷ PartialOrderContainedFee
- podContainedPayment ∷ Integer
- partialOrderNftPolicy ∷ GYDexApiQueryMonad m a ⇒ PORefs → m (GYMintingPolicy 'PlutusV2)
- partialOrderNftPolicyId ∷ GYDexApiQueryMonad m a ⇒ PORefs → m GYMintingPolicyId
- partialOrders ∷ GYDexApiQueryMonad m a ⇒ PORefs → m (Map GYTxOutRef PartialOrderInfo)
- getPartialOrderInfo ∷ GYDexApiQueryMonad m a ⇒ PORefs → GYTxOutRef → m PartialOrderInfo
- placePartialOrder ∷ GYDexApiMonad m a ⇒ PORefs → GYAddress → (Natural, GYAssetClass) → GYAssetClass → GYRational → Maybe GYTime → Maybe GYTime → Maybe GYStakeCredential → m (GYTxSkeleton 'PlutusV2)
- placePartialOrder' ∷ (GYDexApiMonad m a, HasCallStack) ⇒ PORefs → GYAddress → (Natural, GYAssetClass) → GYAssetClass → GYRational → Maybe GYTime → Maybe GYTime → Natural → Natural → Maybe GYStakeCredential → GYTxOutRef → PartialOrderConfigInfoF GYAddress → m (GYTxSkeleton 'PlutusV2)
- completelyFillPartialOrder ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → GYTxOutRef → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → Natural → m (GYTxSkeleton 'PlutusV2)
- partiallyFillPartialOrder ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → GYTxOutRef → Natural → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → Natural → m (GYTxSkeleton 'PlutusV2)
- fillPartialOrder ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → GYTxOutRef → Natural → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → Natural → m (GYTxSkeleton 'PlutusV2)
- fillPartialOrder' ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → PartialOrderInfo → Natural → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → Natural → m (GYTxSkeleton 'PlutusV2)
- fillMultiplePartialOrders ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [(GYTxOutRef, Natural)] → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → m (GYTxSkeleton 'PlutusV2)
- completelyFillMultiplePartialOrders ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [GYTxOutRef] → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → m (GYTxSkeleton 'PlutusV2)
- fillMultiplePartialOrders' ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [(PartialOrderInfo, Natural)] → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → m (GYTxSkeleton 'PlutusV2)
- cancelPartialOrder ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → GYTxOutRef → m (GYTxSkeleton 'PlutusV2)
- cancelPartialOrder' ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → PartialOrderInfo → m (GYTxSkeleton 'PlutusV2)
- cancelMultiplePartialOrders ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [PartialOrderInfo] → m (GYTxSkeleton 'PlutusV2)
- partialOrderAddr ∷ GYDexApiQueryMonad m a ⇒ PORefs → m GYAddress
- partialOrderPrice ∷ PartialOrderInfo → Natural → GYValue
- partialOrderPrice' ∷ PartialOrderInfo → Natural → Natural
Documentation
Constructors
PORefs | |
Fields
|
PartialOrderInfo
data PartialOrderInfo #
Constructors
PartialOrderInfo | |
Fields
|
Instances
data POIContainedFee #
Constructors
POIContainedFee | |
Fields |
Instances
partialOrderInfoToIn ∷ HasDexScripts a ⇒ a → PORefs → PartialOrderInfo → PartialOrderAction → GYTxIn 'PlutusV2 #
expectedPaymentWithDeposit ∷ PartialOrderInfo → Bool → GYValue #
Note that at any moment, an order UTxO contains:- * An NFT. * Remaining offered tokens. * Payment for tokens consumed. * Initial deposit. * Collected fees.
Redeemer & Datum
data PartialOrderAction #
Constructors
PartialCancel | |
PartialFill Integer | |
CompleteFill |
Instances
data PartialOrderDatum #
Datum specifying a partial order.
Constructors
PartialOrderDatum | |
Fields
|
Instances
Partial order NFT policy
Arguments
∷ GYDexApiQueryMonad m a | |
⇒ PORefs | |
→ m (GYMintingPolicy 'PlutusV2) | The minting policy of the partial order NFT. |
Arguments
∷ GYDexApiQueryMonad m a | |
⇒ PORefs | |
→ m GYMintingPolicyId | The minting policy id of the partial order NFT. |
Queries
partialOrders ∷ GYDexApiQueryMonad m a ⇒ PORefs → m (Map GYTxOutRef PartialOrderInfo) #
getPartialOrderInfo ∷ GYDexApiQueryMonad m a ⇒ PORefs → GYTxOutRef → m PartialOrderInfo #
Tx constructors
Arguments
∷ GYDexApiMonad m a | |
⇒ PORefs | |
→ GYAddress | Order owner |
→ (Natural, GYAssetClass) | Amount and asset to offer. |
→ GYAssetClass | The asset being asked for as payment. |
→ GYRational | The price for one unit of the offered asset. |
→ Maybe GYTime | The earliest time when the order can be filled (optional). |
→ Maybe GYTime | The latest time when the order can be filled (optional). |
→ Maybe GYStakeCredential | Stake credential of user. We do not support pointer reference. |
→ m (GYTxSkeleton 'PlutusV2) |
Arguments
∷ (GYDexApiMonad m a, HasCallStack) | |
⇒ PORefs | |
→ GYAddress | Order owner |
→ (Natural, GYAssetClass) | Amount and asset to offer. |
→ GYAssetClass | The asset being asked for as payment. |
→ GYRational | The price for one unit of the offered asset. |
→ Maybe GYTime | The earliest time when the order can be filled (optional). |
→ Maybe GYTime | The latest time when the order can be filled (optional). |
→ Natural | Additional lovelace fee. |
→ Natural | Additional fee in offered tokens. |
→ Maybe GYStakeCredential | Stake credential of user. We do not support pointer reference. |
→ GYTxOutRef | |
→ PartialOrderConfigInfoF GYAddress | |
→ m (GYTxSkeleton 'PlutusV2) |
Arguments
∷ (HasCallStack, GYDexApiMonad m a) | |
⇒ PORefs | |
→ GYTxOutRef | The order reference. |
→ Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) | |
→ Natural | Additional taker fee in payment tokens. |
→ m (GYTxSkeleton 'PlutusV2) |
Completely fill a partially-fillable order.
Arguments
∷ (HasCallStack, GYDexApiMonad m a) | |
⇒ PORefs | |
→ GYTxOutRef | The order reference. |
→ Natural | The amount of offered tokens to buy. |
→ Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) | |
→ Natural | Additional taker fee in payment tokens. |
→ m (GYTxSkeleton 'PlutusV2) |
Partially fill a partially-fillable order.
Arguments
∷ (HasCallStack, GYDexApiMonad m a) | |
⇒ PORefs | |
→ GYTxOutRef | The order reference. |
→ Natural | The amount of offered tokens to buy. |
→ Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) | |
→ Natural | Additional taker fee in payment tokens. |
→ m (GYTxSkeleton 'PlutusV2) |
Fills an order. If the provided amount of offered tokens to buy is equal to the offered amount, then we completely fill the order. Otherwise, it gets partially filled.
Arguments
∷ (HasCallStack, GYDexApiMonad m a) | |
⇒ PORefs | |
→ PartialOrderInfo | The order information. |
→ Natural | The amount of offered tokens to buy. |
→ Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) | |
→ Natural | Additional taker fee in payment tokens. |
→ m (GYTxSkeleton 'PlutusV2) |
Fills an order. If the provided amount of offered tokens to buy is equal to the offered amount, then we completely fill the order. Otherwise, it gets partially filled.
This differs from fillPartialOrder
in that it takes fetched order information instead of it's reference.
fillMultiplePartialOrders ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [(GYTxOutRef, Natural)] → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → m (GYTxSkeleton 'PlutusV2) #
Fills multiple orders. If the provided amount of offered tokens to buy in an order is equal to the offered amount, then we completely fill the order. Otherwise, it gets partially filled.
completelyFillMultiplePartialOrders ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [GYTxOutRef] → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → m (GYTxSkeleton 'PlutusV2) #
Completely fill multiple orders.
fillMultiplePartialOrders' ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [(PartialOrderInfo, Natural)] → Maybe (GYTxOutRef, PartialOrderConfigInfoF GYAddress) → m (GYTxSkeleton 'PlutusV2) #
Fills multiple orders. If the provided amount of offered tokens to buy in an order is equal to the offered amount, then we completely fill the order. Otherwise, it gets partially filled.
Arguments
∷ (HasCallStack, GYDexApiMonad m a) | |
⇒ PORefs | |
→ GYTxOutRef | The order reference. |
→ m (GYTxSkeleton 'PlutusV2) |
Arguments
∷ (HasCallStack, GYDexApiMonad m a) | |
⇒ PORefs | |
→ PartialOrderInfo | The order information. |
→ m (GYTxSkeleton 'PlutusV2) |
cancelMultiplePartialOrders ∷ (HasCallStack, GYDexApiMonad m a) ⇒ PORefs → [PartialOrderInfo] → m (GYTxSkeleton 'PlutusV2) #
Cancel multiple partial orders.
Utilities
partialOrderAddr ∷ GYDexApiQueryMonad m a ⇒ PORefs → m GYAddress #