Views on offers
Mangrove getters for offers and offer lists.
Public getters
best(address outbound, address inbound)
best(address outbound, address inbound)import "src/IMangrove.sol";
// context of the call
IMangrove mgv;
address outbound_tkn;
address inbound_tkn;
uint best = mgv.best(outbound_tkn, inbound_tkn); const { ethers } = require("ethers");
// context
let outboundTkn; // address of outbound token ERC20
let inboundTkn; // address of inbound token ERC20
let MGV_address;
let MGV_abi; // Mangrove contract's abi
const mgv = new ethers.Contract(
MGV_address,
MGV_abi,
ethers.provider
);
// getting best offer of the (outTkn,inbTk) market
const best = await mgv.best(outboundTkn, inboundTkn); offers(address, address) / offerDetails(address, address, uint)
offers(address, address) / offerDetails(address, address, uint)isLive(address, address, uint)
isLive(address, address, uint)Custom types
MgvLib.MgvStructs.OfferUnpacked
MgvLib.MgvStructs.OfferUnpackedType
Field
Comments
uint32
prev
Predecessor offer id (better price)
uint32
next
Successor offer id (worst price)
uint96
gives
What the offer gives (in wei units of base token of the offer's market)
uint96
wants
What the offer wants (in wei units of quote token of the offer's market)
MgvLib.OfferDetailUnpacked
MgvLib.OfferDetailUnpackedType
Field
Comments
uint24
gasreq
Gas required by the offer (in gas units)
uint16
gasprice
The gas price covered by the offer bounty (in gwei per gas units)
Last updated