Direct offer
The most simple liquidity providing strategy, no offer logic, just a Wallet.
A Direct Offer is a reactive Offer listed on Mangrove that is not equipped with any on-chain logic. Whenever it is matched by a taker order, the offer sources its liquidity on an Externally Owned Account (EOA).

How to deploy it?

You need to tell Mangrove you wish to post a new offer, signing this transaction with the wallet that contains the promised liquidity. Here is an example using Mangrove's JS API.
const { Mangrove } = require("@mangrovedao/mangrove.js");
const ethers = require("ethers");
let provider = new ethers.providers.WebSocketProvider(
let wallet = new ethers.Wallet(MUMBAI_TESTER_PRIVATE_KEY, provider);
//connecting the API to Mangrove
let mgv = await Mangrove.connect({ signer: wallet });
//connecting mgv to a market
let market = await{ base: "DAI", quote: "USDC" });
// check its live, should display the best Bids and Asks of the DAI,USDC market
// create a simple LP on `market`
let directLP = await mgv.liquidityProvider(market);
// //Ask on market (promise base (DAI) in exchange of quote (USDC))
// //LP needs to approve Mangrove for base transfer
let tx = await directLP.approveMangroveForBase();
await tx.wait();
// // querying mangrove to know the bounty for posting a new Ask on `market`
let prov = await directLP.computeAskProvision();
tx = await directLP.fundMangrove(prov);
await tx.wait();
// //Posting a new Ask (offering 105 DAI for 104 USDC)
const { id: ofrId } = await directLP.newAsk({ wants: 105, gives: 104 });
Copy link