Skip to content

Commit

Permalink
do not match mm orders
Browse files Browse the repository at this point in the history
  • Loading branch information
lehieuhust committed Aug 21, 2023
1 parent 27c3c8c commit d56ba8e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/market-maker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const getRandomSpread = (min: number, max: number) => {
return getRandomRange(min * atomic, max * atomic) / atomic;
};

const mm_address_2 = "orai1gqew39xtnshrrt8nmk0qy4gqkup5yhmnaryfp7";
const generateMatchOrders = async (oraiPrice: number, usdtContractAddress: Addr, orderbookAddress: Addr, sender: UserWallet, spread: number, assetInfos: AssetInfo[], direction: OrderDirection, limit: 10, { buyPercentage, sellDepth, buyDepth }: MakeOrderConfig): Promise<OraiswapLimitOrderTypes.ExecuteMsg[]> => {
const upperPriceLimit = oraiPrice * (1 + spread);
const lowerPriceLimit = oraiPrice * (1 - spread);
Expand Down Expand Up @@ -56,12 +57,12 @@ const generateMatchOrders = async (oraiPrice: number, usdtContractAddress: Addr,


for (const order of ordersbyPrice.orders) {
console.log({order});
if (order.bidder_addr === sender.address) {
if (order.bidder_addr === sender.address || order.bidder_addr === mm_address_2) {
continue;
}

const lef_offer_amount = Number(order.offer_asset.amount) - Number(order.filled_offer_amount);
console.log({trader_lef_amount: lef_offer_amount});
console.log({order}, {trader_lef_amount: lef_offer_amount});
mmAskVolumebyPrice += lef_offer_amount;
}

Expand Down

0 comments on commit d56ba8e

Please sign in to comment.