MarginPoolContract class

Builds DeepBook-v3 margin_pool move calls. Every method takes the Transaction first and emits a single move call.

Constructors

MarginPoolContract(DeepBookConfig config)

Properties

config DeepBookConfig
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

borrowShares(Transaction tx, String coinKey) → TransactionResult
Get the total borrow shares.
interestRate(Transaction tx, String coinKey) → TransactionResult
Get the current interest rate.
lastUpdateTimestamp(Transaction tx, String coinKey) → TransactionResult
Get the last update timestamp.
maxUtilizationRate(Transaction tx, String coinKey) → TransactionResult
Get the max utilization rate.
minBorrow(Transaction tx, String coinKey) → TransactionResult
Get the minimum borrow amount.
mintSupplierCap(Transaction tx) → TransactionResult
Mint a supplier cap for the margin pool.
mintSupplyReferral(Transaction tx, String coinKey) → TransactionResult
Mint a supply referral for a margin pool.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
protocolSpread(Transaction tx, String coinKey) → TransactionResult
Get the protocol spread.
supply(Transaction tx, String coinKey, dynamic supplierCap, dynamic supplyCoin, {String? referralId}) → TransactionResult
Supply to a margin pool. supplyCoin must already be resolved by the caller.
supplyCap(Transaction tx, String coinKey) → TransactionResult
Get the supply cap.
supplyShares(Transaction tx, String coinKey) → TransactionResult
Get the total supply shares.
toString() String
A string representation of this object.
inherited
totalBorrow(Transaction tx, String coinKey) → TransactionResult
Get the total borrow amount.
totalSupply(Transaction tx, String coinKey) → TransactionResult
Get the total supply amount.
userSupplyAmount(Transaction tx, String coinKey, String supplierCapId) → TransactionResult
Get user supply amount for a supplier cap.
userSupplyShares(Transaction tx, String coinKey, String supplierCapId) → TransactionResult
Get user supply shares for a supplier cap.
withdraw(Transaction tx, String coinKey, dynamic supplierCap, {num? amountToWithdraw}) → TransactionResult
Withdraw from a margin pool. If amountToWithdraw is null, withdraws all.
withdrawReferralFees(Transaction tx, String coinKey, String referralId) → TransactionResult
Withdraw referral fees from a margin pool.

Operators

operator ==(Object other) bool
The equality operator.
inherited