[{"data":1,"prerenderedAt":203},["ShallowReactive",2],{"docs:en:\u002Fdocs\u002Fduel\u002Fconcepts\u002Frealignment":3},{"id":4,"title":5,"body":6,"cover":194,"description":195,"extension":196,"meta":197,"navigation":198,"path":199,"seo":200,"stem":201,"__hash__":202},"docs\u002Fdocs\u002Fduel\u002Fconcepts\u002Frealignment.md","Realignment",{"type":7,"value":8,"toc":185},"minimark",[9,13,22,27,30,40,52,56,65,69,72,78,158,164,175,178,182],[10,11,5],"h1",{"id":12},"realignment",[14,15,16,17,21],"p",{},"A duel has three pools: A in ETH, B in ETH, and A in B. Their prices can diverge after a trade. After each trade, in the same transaction, the hook ",[18,19,20],"strong",{},"attempts"," a profitable realignment. It can be skipped or limited by available ETH; exact agreement is not guaranteed.",[23,24,26],"h2",{"id":25},"how-it-works","How it works",[14,28,29],{},"When the price discrepancy gives a triangular cycle a profit edge above 0.1% before sizing, the hook can trade around the triangle at zero fee. This is a cycle-profit threshold, not a guarantee that any two pool prices stay within 0.1%:",[31,32,33,37],"ul",{},[34,35,36],"li",{},"if A became expensive in ETH compared with the A\u002FB pool, the hook buys B with ETH, swaps it for A in the A\u002FB pool and\nsells that A for ETH;",[34,38,39],{},"if B did, the same the other way round.",[14,41,42,43,46,47,51],{},"A closed formula sizes the profitable loop, then caps it at what the selling ETH pool can pay. It only keeps a loop that makes a profit. ",[18,44,45],{},"The captured profit goes to the round pot."," A failed attempt rolls back and is skipped, so it does not block the user’s swap, unless it ran out of gas: the swap then reverts with ",[48,49,50],"code",{},"ArbitrageStarved",", so that no one can skip the realignment by sending too little gas. A limited or skipped loop can leave a price discrepancy.",[23,53,55],{"id":54},"what-it-means-for-the-split","What it means for the split",[14,57,58,59,64],{},"The ",[60,61,63],"a",{"href":62},"\u002Fdocs\u002Fduel\u002Fconcepts\u002Fsplit","split"," and rounds read only the two ETH pools. The A\u002FB price never counts directly. A switch through A\u002FB affects them only if realignment actually trades the ETH pools. If no ETH price moves, the switch changes neither the split nor the round’s average, and does not activate an otherwise quiet round.",[23,66,68],{"id":67},"what-it-means-for-traders","What it means for traders",[14,70,71],{},"The A\u002FB pool holds some of each side. When realignment runs after one side rises, it can sell some of that side into its ETH pool and buy some of the other side. Three possible effects:",[14,73,74,77],{},[18,75,76],{},"A buy can be partly offset right after it."," When realignment runs, it can sell part of the bought side and send the captured ETH profit to the pot. An immediate round trip can therefore cost more than swap fees. These illustrative internal measurements use default terms, on a fresh duel and on a duel where one side holds 97% of the split (10 ETH bought on it, none on the other); costs depend on the pool state and are not a fixed rate:",[79,80,81,100],"table",{},[82,83,84],"thead",{},[85,86,87,91,94,97],"tr",{},[88,89,90],"th",{},"Buy then sell at once",[88,92,93],{},"Fresh duel",[88,95,96],{},"At 97\u002F3, side ahead",[88,98,99],{},"At 97\u002F3, side behind",[101,102,103,117,131,144],"tbody",{},[85,104,105,109,112,115],{},[106,107,108],"td",{},"0.1 ETH",[106,110,111],{},"about 4%",[106,113,114],{},"about 2%",[106,116,111],{},[85,118,119,122,125,128],{},[106,120,121],{},"1 ETH",[106,123,124],{},"about 5%",[106,126,127],{},"about 3%",[106,129,130],{},"about 12%",[85,132,133,136,139,141],{},[106,134,135],{},"5 ETH",[106,137,138],{},"about 10%",[106,140,111],{},[106,142,143],{},"about 32%",[85,145,146,149,152,155],{},[106,147,148],{},"20 ETH",[106,150,151],{},"about 22%",[106,153,154],{},"about 7%",[106,156,157],{},"about 61%",[14,159,160,163],{},[18,161,162],{},"Behind, one big buy costs the most."," While the side ahead rose, realignment filled the A\u002FB pool with the side behind. A buy of the side behind has that stock sold into it: the bigger the single buy, the more of it goes to the pot. Several smaller buys, each followed by its own realignment, cost less than one large buy of the same total.",[14,165,166,169,170,174],{},[18,167,168],{},"The sides are coupled when realignment runs."," A buy on one side can also lift the other, so a comeback can cost more than the ETH gap suggests. A limited or skipped realignment may produce a different outcome. See ",[60,171,173],{"href":172},"\u002Fdocs\u002Fduel\u002Fconcepts\u002Fsplit#the-leader-has-an-edge-not-a-lock","The leader has an edge, not a lock",".",[14,176,177],{},"By default, the A\u002FB pool starts with 2% of each supply, the smallest share the contracts allow, to keep this coupling light. A larger initial share strengthens the coupling; its effect depends on the pool state and the size of the trade.",[23,179,181],{"id":180},"why-do-it-in-the-hook","Why do it in the hook",[14,183,184],{},"A profitable realignment attempts to reduce the discrepancy and sends its captured profit to the pot. It reduces arbitrage opportunities but does not eliminate them: the loop may be limited, skipped, or leave a residual gap.",{"title":186,"searchDepth":187,"depth":188,"links":189},"",2,3,[190,191,192,193],{"id":25,"depth":187,"text":26},{"id":54,"depth":187,"text":55},{"id":67,"depth":187,"text":68},{"id":180,"depth":187,"text":181},null,"After each trade, Duel’s hook attempts a zero-fee loop through a duel’s three pools to realign their prices. Its profit goes to the pot. What it costs traders.","md",{},true,"\u002Fdocs\u002Fduel\u002Fconcepts\u002Frealignment",{"title":5,"description":195},"docs\u002Fduel\u002Fconcepts\u002Frealignment","1y00c0KoA9idOXw2pb0M7IerWwvmLPRxbwgA_hFcotY",1791226974097]