Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions integrations/solder-cortex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Solder Cortex Integration for SIDEX
* Conviction scoring for trading decisions.
*
* Before executing trades, check wallet conviction across DeFi + prediction markets.
* High conviction = trader has real skin in the game.
*
* Demo: http://76.13.193.103/
* GitHub: https://github.com/metalmcclaw/solder-cortex
*/

const CORTEX_API = process.env.CORTEX_API_URL || 'http://76.13.193.103/api';

async function getWalletConviction(wallet) {
try {
const res = await fetch(`${CORTEX_API}/conviction/${wallet}`);
return res.ok ? await res.json() : null;
} catch (e) {
console.error('Cortex error:', e.message);
return null;
}
}

async function shouldFollowTrade(wallet, minConviction = 0.7) {
const c = await getWalletConviction(wallet);
if (!c) return { follow: false, reason: 'Could not fetch conviction' };
return c.score >= minConviction
? { follow: true, reason: `High conviction (${c.score.toFixed(2)})`, conviction: c }
: { follow: false, reason: `Low conviction (${c.score.toFixed(2)})`, conviction: c };
}

module.exports = { getWalletConviction, shouldFollowTrade, CORTEX_API };