Skip to content

Instantly share code, notes, and snippets.

View OxMarco's full-sized avatar

OxMarco OxMarco

View GitHub Profile

iLayer Smart Contract Docs

Financial analytics tools for merchants

Data Collected

Customers

By storing and analysing the payment card data, we can derive the following:

  • New vs returning customers
  • Geographical origin
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IPairFactory} from "./IPairFactory.sol";
import {IPair} from "./IPair.sol";
contract UniV2PoolBricker {
address public constant weth = 0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f;

Rooter - Business Plan

TL;DR

Rooter is a payment terminal that minimises processing costs through internal payment routing while offering superior inventory, customer management, and customised incentive program tools.

It features a dual‑mode POS that automatically detects and processes both traditional card transactions (via the schema, Visa/Mastercard/Amex) and crypto transactions via blockchain settlement (thus skipping the schema fees), dynamically choosing the optimal payment route without any manual input required.

Rooter also provides a cloud POS to manage inventory/SKU and customer retention; for sales and inventory analytics tools we use financial modelling and a LLM to make the numerical results into user-friendly action items.

A case for onchain payments

Many companies are attempting to develop their own payment systems. However, this approach faces significant challenges and is generally economically impractical:

  1. Specialized Expertise Required: A payment processor demands deep expertise in both payments and blockchain, if targeting web3. Translating a card/bank payment message into a blockchain message requires a rare skill set, and most companies only excel in one of these areas.
  2. Resource-Intensive Development: Building a payment processor requires total focus and extensive resources, which diverts attention away from core business areas like consumer experience, card issuance, and wallet functionality. As a result, many companies ultimately revert to traditional infrastructure for card issuance rather than achieving full self-custody—examples include 1inch, Ether.fi, and Unlimit.

Yet, still most crypto companies are using tradfi for banking. Why? (out of 10 companies surveyed)

  • insurance (bank accounts are
@OxMarco
OxMarco / Router.sol
Created December 14, 2024 12:20
Token and swap router
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;
import {ERC20, ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import {ERC20Burnable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
contract Token is ERC20Permit, ERC20Burnable {
string public image;
constructor(string memory _name, string memory _symbol, string memory _image, uint256 _totalSupply)

General Principles

  • Set goals for the team to pursue and align around.
  • One focus per quarter - either a product area or theme; constrains build efforts.
  • Mostly defined Projects.
  • Leave space for smaller items that add a lot of value.
  • Projects should take 1-3 weeks to build with teams of 2-3 people.
  • Build in 2-week Cycles - task density should feel reasonable.
  • Break work into smaller parts when possible - to track / see progress.
  • Every Feature / Project / Design Doc / Task has a single named owner, and the owner is responsible for the ultimate delivery.
  • Increase velocity.
@OxMarco
OxMarco / The Evolution of Banking.md
Last active October 12, 2024 12:46
The Evolution of Banking: Traditional Systems and the Rise of Stablecoins

The Evolution of Banking: Traditional Systems and the Rise of Stablecoins

Banks are quintessential to financial intermediation, engaging in two primary transformations:

  1. Maturity Transformation: Banks convert short-term deposits into longer-term loans. For example, a bank might use funds from savings accounts, which can be withdrawn at any time, to finance 30-year mortgages. This process is crucial for economic growth but introduces inherent liquidity risks.

  2. Fungibility Transformation: Banks transform highly liquid, fungible assets (like cash deposits) into less liquid, non-fungible assets such as loans or bonds. This function allows for the efficient allocation of capital throughout the economy.

With the advent of post-1950s financial evolution, the predominance of traditional banking has been paralleled by the emergence of shadow banking a sector characterised by similar financial activities undertaken by non-bank financial institutions subject to lesser regulations, which now comprise

@OxMarco
OxMarco / Swing Pricing.md
Last active August 31, 2024 08:06
Swing Pricing - a systematic review of possible implementations

Swing Pricing and Liquidation Premiums - a systematic review of possible implementations for a mutual fund

Introduction

One of the primary issues in market turmoil situations, such as bank runs, is the advantage that first movers have: when investors rush to redeem their shares in a fund, those who move first often receive a better asset value, while remaining investors are left to bear the costs related with liquidation. A well-designed liquidity transformation method moves the redemption costs to the redeeming investors, mitigating this first-mover advantage and promoting fairness among all investors.

Swing Pricing

Swing pricing adjusts the NAV of a fund to reflect the costs associated with redemptions. This adjustment ensures that the remaining investors are equally affected by the costs incurred due to others redeeming their shares. As a result, swing pricing is a key tool in managing funds, designed to mitigate the adverse effects of large-scale redemptions and to break the first-mover advan

// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.24;
import {ERC4626, IERC4626} from "@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";